/** \file
\brief Node inline non-template implementation */
-//#include "Node.ih"
+#include "Node.ih"
// Custom includes
#include "../Utils/senfassert.hh"
return shared_from_this();
}
+prefix_ bool senf::console::GenericNode::operator==(GenericNode & other)
+ const
+{
+ return this == & other;
+}
+
+prefix_ bool senf::console::GenericNode::operator!=(GenericNode & other)
+ const
+{
+ return this != & other;
+}
+
///////////////////////////////////////////////////////////////////////////
// senf::console::DirectoryNode
return ptr(new DirectoryNode());
}
+prefix_ bool senf::console::DirectoryNode::hasChild(std::string const & name)
+ const
+{
+ ChildMap::const_iterator i (children_.find(name));
+ return i != children_.end();
+}
+
prefix_ senf::console::DirectoryNode &
senf::console::DirectoryNode::getDirectory(std::string const & name)
const
return boost::make_iterator_range(children_.begin(), children_.end());
}
+prefix_ senf::console::DirectoryNode::ChildrenRange
+senf::console::DirectoryNode::completions(std::string const & s)
+ const
+{
+ return boost::make_iterator_range(children_.lower_bound(s),
+ children_.lower_bound(s + "\xff"));
+}
+
prefix_ senf::console::DirectoryNode::DirectoryNode()
{}
}
///////////////////////////////////////////////////////////////////////////
+// senf::console::detail::NodeTraverser
+
+prefix_ senf::console::detail::NodeTraverser::NodeTraverser(DirectoryNode & root,
+ DirectoryNode & dir,
+ bool autocomplete)
+ : root_ (root), dir_ (dir.thisptr()), autocomplete_ (autocomplete), init_ (false)
+{}
+
+///////////////////////////////////////////////////////////////////////////
// senf::console::SyntaxErrorException
prefix_ senf::console::SyntaxErrorException::SyntaxErrorException(std::string const & msg)
- : Exception(msg)
+ : message_(msg)
{}
+prefix_ senf::console::SyntaxErrorException::~SyntaxErrorException()
+ throw()
+{}
+
+prefix_ std::string const & senf::console::SyntaxErrorException::message()
+ const
+{
+ return message_;
+}
+
///////////////////////////////////////////////////////////////////////////
// senf::console::CommandNode
return boost::static_pointer_cast<SimpleCommandNode const>(shared_from_this());
}
+#ifndef DOXYGEN
+
+prefix_ senf::console::SimpleCommandNode &
+senf::console::senf_console_add_node(DirectoryNode & node, std::string const & name,
+ SimpleCommandNode::Function fn, int)
+{
+ return node.add(name, SimpleCommandNode::create(fn));
+}
+
+#endif
+
///////////////////////////////cci.e///////////////////////////////////////
#undef prefix_