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 | e248d3eb11b330a286d45fb0ea4c1c0387d85132 (patch) | |
tree | a220f468b36725cf406ea8d8e5112bd675615f66 | |
parent | Add basic equality test (diff) | |
download | project2-e248d3eb11b330a286d45fb0ea4c1c0387d85132.tar.bz2 project2-e248d3eb11b330a286d45fb0ea4c1c0387d85132.tar.xz project2-e248d3eb11b330a286d45fb0ea4c1c0387d85132.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); + + |