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
commit6deb26e699896e5b9f875470658d8a66f02b1f75 (patch)
treea220f468b36725cf406ea8d8e5112bd675615f66
parentAdd basic equality test (diff)
downloadproject2-6deb26e699896e5b9f875470658d8a66f02b1f75.tar.bz2
project2-6deb26e699896e5b9f875470658d8a66f02b1f75.tar.xz
project2-6deb26e699896e5b9f875470658d8a66f02b1f75.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);
+
+