summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrandomdan <randomdan@localhost>2013-03-18 18:58:21 +0000
committerrandomdan <randomdan@localhost>2013-03-18 18:58:21 +0000
commite248d3eb11b330a286d45fb0ea4c1c0387d85132 (patch)
treea220f468b36725cf406ea8d8e5112bd675615f66
parentAdd basic equality test (diff)
downloadproject2-e248d3eb11b330a286d45fb0ea4c1c0387d85132.tar.bz2
project2-e248d3eb11b330a286d45fb0ea4c1c0387d85132.tar.xz
project2-e248d3eb11b330a286d45fb0ea4c1c0387d85132.zip
Add simple pwd variable
-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);
+
+