X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FConsole%2FExecutor.hh;h=9341dedee2d18bd77144eeaa632834ef360368cb;hb=7f1c36ac78c8aec05f857d7594ea70e865c822ef;hp=7538eff228fd9e68e788bd73515396149323c351;hpb=958bdb52c39fa39f4ef91cafd9628bcb4f85a03c;p=senf.git diff --git a/Utils/Console/Executor.hh b/Utils/Console/Executor.hh index 7538eff..9341ded 100644 --- a/Utils/Console/Executor.hh +++ b/Utils/Console/Executor.hh @@ -108,16 +108,17 @@ namespace console { /**< if autocomplete is enabled, path components which can be uniquely completed will be completed automatically. Disabled by default (but enabled - automatically by the interactive console) void - autocomplete(bool v). */ + automatically by the interactive console). */ Executor & autocomplete(bool v); ///< Set autocomplete status /**< \see autocomplete() */ + DirectoryNode & chroot() const; ///< Get root node /**< The root node defaults to senf::console::root(). If changed, all path references are relative to this node and objects outside that tree cannot be accessed. */ + Executor & chroot(DirectoryNode & node); ///< chroot into given directory /**< After this call, all path's are interpreted relative to \a node and only nodes in the tree rooted at \a node @@ -147,8 +148,17 @@ namespace console { Path & dir); std::string complete(DirectoryNode & dir, std::string const & name); - struct InvalidPathException {}; - struct InvalidDirectoryException {}; + struct InvalidPathException { + std::string path; + InvalidPathException() : path() {} + InvalidPathException(std::string path_) : path(path_) {} + + }; + struct InvalidDirectoryException { + std::string path; + InvalidDirectoryException() : path() {} + InvalidDirectoryException(std::string path_) : path(path_) {} + }; struct InvalidCommandException {}; DirectoryNode::ptr root_; @@ -163,6 +173,8 @@ namespace console { bool autocomplete_; }; + void senf_console_format_value(DirectoryNode::ptr value, std::ostream & os); + }} ///////////////////////////////hh.e////////////////////////////////////////