X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FConsole%2FExecutor.hh;h=9341dedee2d18bd77144eeaa632834ef360368cb;hb=532240d72e09e19e57fac9bb55c2560b9c9e5b97;hp=540472d02ba5d3221313558f6c4e5daf2875c989;hpb=a22f6d21df6c911d65f76d7731bcf92b1906bb09;p=senf.git diff --git a/Utils/Console/Executor.hh b/Utils/Console/Executor.hh index 540472d..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_;