summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--project2/common/variables/pwd.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/project2/common/variables/pwd.cpp b/project2/common/variables/pwd.cpp
new file mode 100644
index 0000000..8a80dd0
--- /dev/null
+++ b/project2/common/variables/pwd.cpp
@@ -0,0 +1,20 @@
+#include <pch.hpp>
+#include "../variables.h"
+#include "../scriptLoader.h"
+#include <boost/filesystem/operations.hpp>
+
+/// Variable implementation to access session contents
+class Pwd : public VariableImplDyn {
+ public:
+ Pwd(ScriptNodePtr e) :
+ VariableImplDyn(e)
+ {
+ }
+ VariableType value() const
+ {
+ return boost::filesystem::current_path().string();
+ }
+};
+DECLARE_COMPONENT_LOADER("pwd", Pwd, VariableLoader);
+
+