From: tho Date: Thu, 4 Feb 2010 13:09:28 +0000 (+0000) Subject: Utils/Console: added missing ScopedDirectory proxy members X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=c92498e86ff9f107be25e9cf159c38f7122dbfc7;p=senf.git Utils/Console: added missing ScopedDirectory proxy members git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1567 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Utils/Console/ScopedDirectory.cci b/senf/Utils/Console/ScopedDirectory.cci index 80b3882..162c658 100644 --- a/senf/Utils/Console/ScopedDirectory.cci +++ b/senf/Utils/Console/ScopedDirectory.cci @@ -105,6 +105,54 @@ senf::console::ScopedDirectoryBase::doc(std::string const & doc) return node().doc(doc); } +prefix_ std::string const & senf::console::ScopedDirectoryBase::name() + const +{ + return node().name(); +} + +prefix_ bool senf::console::ScopedDirectoryBase::active() + const +{ + return node().active(); +} + +prefix_ std::string senf::console::ScopedDirectoryBase::path() + const +{ + return node().path(); +} + +prefix_ std::string senf::console::ScopedDirectoryBase::path(DirectoryNode const & root) + const +{ + return node().path(root); +} + +prefix_ boost::shared_ptr +senf::console::ScopedDirectoryBase::parent() + const +{ + return node().parent(); +} + +prefix_ senf::console::GenericNode::ptr senf::console::ScopedDirectoryBase::unlink() +{ + return node().unlink(); +} + +prefix_ void senf::console::ScopedDirectoryBase::help(std::ostream & output) + const +{ + node().help( output); +} + +prefix_ std::string senf::console::ScopedDirectoryBase::shorthelp() + const +{ + return node().shorthelp(); +} + prefix_ senf::console::ScopedDirectoryBase::ScopedDirectoryBase() : node_ (DirectoryNode::create()) {} diff --git a/senf/Utils/Console/ScopedDirectory.hh b/senf/Utils/Console/ScopedDirectory.hh index 481a4dd..86f5334 100644 --- a/senf/Utils/Console/ScopedDirectory.hh +++ b/senf/Utils/Console/ScopedDirectory.hh @@ -61,6 +61,14 @@ namespace console { GenericNode & get(std::string const & name) const; DirectoryNode::ChildrenRange children() const; DirectoryNode & doc(std::string const & doc); + std::string const & name() const; + bool active() const; + std::string path() const; + std::string path(DirectoryNode const & root) const; + boost::shared_ptr parent() const; + GenericNode::ptr unlink(); + void help(std::ostream & output) const; + std::string shorthelp() const; ///\} diff --git a/senf/Utils/Console/ScopedDirectory.test.cc b/senf/Utils/Console/ScopedDirectory.test.cc index a0248ba..6a6ba60 100644 --- a/senf/Utils/Console/ScopedDirectory.test.cc +++ b/senf/Utils/Console/ScopedDirectory.test.cc @@ -107,6 +107,7 @@ SENF_AUTO_UNIT_TEST(scopedDirectoryBase) dir.add("cb", fty::Command(&callback)); BOOST_CHECK( &dir["foo"] == &dir.get("foo") ); BOOST_CHECK( &dir("cb") == &dir.get("cb") ); + BOOST_CHECK_EQUAL(dir.name(), "dir"); char const * const children[] = { "cb", "foo" }; BOOST_CHECK_EQUAL_COLLECTIONS(