17 #ifndef HH_SENF_Utils_Console_Executor_ 18 #define HH_SENF_Utils_Console_Executor_ 1 21 #include <boost/noncopyable.hpp> 61 typedef boost::function<void (DirectoryNode &,std::string const &)>
SecurityPolicy;
128 typedef std::vector<DirectoryNode::weak_ptr> Path;
147 struct InvalidPathException {
149 InvalidPathException() : path() {}
150 InvalidPathException(std::string path_) : path(path_) {}
153 struct InvalidDirectoryException {
155 InvalidDirectoryException() : path() {}
156 InvalidDirectoryException(std::string path_) : path(path_) {}
158 struct InvalidCommandException {};
161 SecurityPolicy policy_;
165 typedef std::vector<Path> DirStack;
void operator()(std::ostream &output, ParseCommandInfo const &command)
Execute command.
#define SENF_LOG_CLASS_AREA()
boost::shared_ptr< DirectoryNode > ptr
Config/console tree directory node.
void senf_console_format_value(DirectoryNode::ptr value, std::ostream &os)
void execute(std::ostream &output, ParseCommandInfo const &command)
Execute command.
Executor & policy(SecurityPolicy policy=SecurityPolicy())
Set security policy.
void complete(LineEditor &editor, Completer completer)
bool skipping() const
true, if currently skipping a directory group
Thrown by the SecurityPolicy to silently ignore a command.
bool autocd() const
Get current autocd status.
Single parsed console command.
boost::function< void(DirectoryNode &, std::string const &)> SecurityPolicy
Executor policy function.
Execute config/console commands.
Thrown by built-in 'exit' command.
GenericNode & getNode(ParseCommandInfo const &command)
bool autocomplete() const
Get current autocomplete status.
DirectoryNode & cwd() const
Current working directory.
boost::iterator_range< token_iterator > TokensRange
unspecified_keyword_type name
Argument name.
Config/console node tree base-class.
DirectoryNode & chroot() const
Get root node.
std::string cwdPath() const
Return pathname of current directory.