///////////////////////////////////////////////////////////////////////////
// senf::console::ParseCommandInfo
+prefix_ senf::console::ParseCommandInfo::ParseCommandInfo()
+ : builtin_ (NoBuiltin)
+{}
+
prefix_ senf::console::ParseCommandInfo::BuiltinCommand
senf::console::ParseCommandInfo::builtin()
const
return boost::make_iterator_range(tokens_.begin(), tokens_.end());
}
-////////////////////////////////////////
-// private members
-
-prefix_ void senf::console::ParseCommandInfo::init()
+prefix_ void senf::console::ParseCommandInfo::clear()
{
builtin_ = NoBuiltin;
commandPath_.clear();
tokens_.clear();
}
-prefix_ void senf::console::ParseCommandInfo::setBuiltin(BuiltinCommand builtin)
+prefix_ bool senf::console::ParseCommandInfo::empty()
+{
+ return builtin_ == NoBuiltin && commandPath_.empty();
+}
+
+prefix_ void senf::console::ParseCommandInfo::builtin(BuiltinCommand builtin)
{
builtin_ = builtin;
+ commandPath_.clear();
}
prefix_ void
-senf::console::ParseCommandInfo::setCommand(std::vector<Token> & commandPath)
+senf::console::ParseCommandInfo::command(std::vector<Token> & commandPath)
{
commandPath_.clear();
commandPath_.swap(commandPath);
+ builtin_ = NoBuiltin;
}
prefix_ void senf::console::ParseCommandInfo::addToken(Token const & token)
}
///////////////////////////////////////////////////////////////////////////
+// senf::console::SyntaxErrorException
+
+prefix_ senf::console::SyntaxErrorException::SyntaxErrorException(std::string const & msg)
+ : message_(msg)
+{}
+
+prefix_ senf::console::SyntaxErrorException::~SyntaxErrorException()
+ throw()
+{}
+
+prefix_ std::string const & senf::console::SyntaxErrorException::message()
+ const
+{
+ return message_;
+}
+
+///////////////////////////////////////////////////////////////////////////
prefix_ senf::console::CheckedArgumentIteratorWrapper::
CheckedArgumentIteratorWrapper(ParseCommandInfo::ArgumentsRange const & range,