/// Thrown by the SecurityPolicy to silently ignore a command
struct IgnoreCommandException {};
+ typedef void result_type;
+
///////////////////////////////////////////////////////////////////////////
//\/name Structors and default members
///\{
/**< Output will be written to \a output.
Same as execute(). */
DirectoryNode & cwd() const; ///< Current working directory
+ std::string cwdPath() const; ///< Return pathname of current directory
+ bool skipping() const; ///< \c true, if currently skipping a directory group
bool autocd() const; ///< Get current autocd status
/**< if autocd is enabled, specifying a directory name as
protected:
private:
- GenericNode & traverseNode(ParseCommandInfo::TokensRange const & path);
- GenericNode & traverseCommand(ParseCommandInfo::CommandPathRange const & path);
- DirectoryNode & traverseDirectory(ParseCommandInfo::TokensRange const & path);
+ typedef std::vector<DirectoryNode::weak_ptr> Path;
+
+ void exec(std::ostream & output, ParseCommandInfo const & command);
+
+ void cd(ParseCommandInfo::TokensRange dir);
+ void ls(std::ostream & output, ParseCommandInfo::TokensRange dir);
+ void pushd(ParseCommandInfo::TokensRange dir);
+ void popd();
+ void exit();
+ void help(std::ostream & output, ParseCommandInfo::TokensRange path);
- template <class ForwardRange>
- GenericNode & traverse(DirectoryNode & dir, ForwardRange const & range);
+ GenericNode & traverseNode(ParseCommandInfo::TokensRange const & path);
+ void traverseDirectory(ParseCommandInfo::TokensRange const & path,
+ Path & dir);
+ std::string complete(DirectoryNode & dir, std::string const & name);
struct InvalidPathException {};
struct InvalidDirectoryException {};
DirectoryNode::ptr root_;
SecurityPolicy policy_;
- DirectoryNode::weak_ptr cwd_;
- DirectoryNode::weak_ptr oldCwd_;
- struct DirEntry {
- DirEntry(DirectoryNode::weak_ptr dir_, bool skip_) : dir(dir_), skip(skip_) {}
- DirectoryNode::weak_ptr dir;
- bool skip;
- };
- typedef std::vector<DirEntry> DirStack;
+ mutable Path cwd_;
+ Path oldCwd_;
+
+ typedef std::vector<Path> DirStack;
DirStack dirstack_;
bool autocd_;
bool autocomplete_;
-
- bool skipping_;
};
-
}}
///////////////////////////////hh.e////////////////////////////////////////
#include "Executor.cci"
-#include "Executor.ct"
+//#include "Executor.ct"
//#include "Executor.cti"
#endif