diff options
author | randomdan <randomdan@localhost> | 2013-03-18 18:58:21 +0000 |
---|---|---|
committer | randomdan <randomdan@localhost> | 2013-03-18 18:58:21 +0000 |
commit | 6deb26e699896e5b9f875470658d8a66f02b1f75 (patch) | |
tree | a220f468b36725cf406ea8d8e5112bd675615f66 | |
parent | Add basic equality test (diff) | |
download | project2-6deb26e699896e5b9f875470658d8a66f02b1f75.tar.bz2 project2-6deb26e699896e5b9f875470658d8a66f02b1f75.tar.xz project2-6deb26e699896e5b9f875470658d8a66f02b1f75.zip |
Add simple pwd variable
-rw-r--r-- | project2/common/variables/pwd.cpp | 20 |
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); + + |