X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FExecutor.hh;h=658cc99b9987f6979d57510f1c26615c7720707b;hb=70905bebad1f8c394fceb3a5d2a493eeecf3bd13;hp=7be8db30bb92a6e782761705db326977fad1362a;hpb=826e50343096b75247521f6593cb78eb8c01615b;p=senf.git diff --git a/Console/Executor.hh b/Console/Executor.hh index 7be8db3..658cc99 100644 --- a/Console/Executor.hh +++ b/Console/Executor.hh @@ -27,8 +27,10 @@ #define HH_Executor_ 1 // Custom includes +#include #include "Parse.hh" #include "../Utils/Logger/SenfLog.hh" +#include "Node.hh" //#include "Executor.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -39,6 +41,7 @@ namespace console { /** \brief */ class Executor + : boost::noncopyable { SENF_LOG_CLASS_AREA(); SENF_LOG_DEFAULT_LEVEL( senf::log::NOTICE ); @@ -48,21 +51,38 @@ namespace console { typedef boost::iterator_range< ParseCommandInfo::argument_iterator> Arguments; + struct ExitException {}; // NOT derived from std::exception ! + /////////////////////////////////////////////////////////////////////////// + //\/name Structors and default members + ///\{ + Executor(); + + ///\} + /////////////////////////////////////////////////////////////////////////// + bool operator()(ParseCommandInfo const & command, std::ostream & output); - + DirectoryNode & cwd() const; + protected: private: + DirectoryNode & traverseTo(ParseCommandInfo::argument_value_type const & path); + + struct InvalidDirectoryException {}; + DirectoryNode::weak_ptr cwd_; + DirectoryNode::weak_ptr oldCwd_; + typedef std::vector DirStack; + DirStack dirstack_; }; }} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "Executor.cci" +#include "Executor.cci" //#include "Executor.ct" //#include "Executor.cti" #endif