X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Console%2FScopedDirectory.hh;h=04a33ec3337e7ccdfa2cc6c02166a149670a54f0;hb=9e7071473642404359c8b7a88c78fe02f00baf16;hp=c226b2e94101eafda536ff4b0aafb07c6b32586a;hpb=869df8df564cd4f4934d4cd1c1b290c2aeabbd92;p=senf.git diff --git a/Console/ScopedDirectory.hh b/Console/ScopedDirectory.hh index c226b2e..04a33ec 100644 --- a/Console/ScopedDirectory.hh +++ b/Console/ScopedDirectory.hh @@ -49,7 +49,7 @@ namespace console { * static_cast(0), * static_cast(0), * static_cast(0), - * static_cast(0), + * static_cast(0), * static_cast(0)) ) base_type; typedef typename senf::remove_cvref::type value_type; @@ -59,7 +59,7 @@ namespace console { /// Internal struct Creator { static result_type create(DirectoryNode & node, Owner & owner, - std::string const & name, Object const & ob); + std::string const & name, Object & ob); }; }; @@ -69,6 +69,7 @@ namespace console { { public: DirectoryNode & node() const; ///< Access the proxied DirectoryNode + operator DirectoryNode & () const; ///< Access the proxied DirectoryNode /////////////////////////////////////////////////////////////////////////// ///\name Proxied members (see DirectoryNode) @@ -82,6 +83,7 @@ namespace console { CommandNode & operator()(std::string const & name) const; GenericNode & get(std::string const & name) const; DirectoryNode & mkdir(std::string const & name); + void link(std::string const & name, GenericNode & node); DirectoryNode::ChildrenRange children() const; DirectoryNode & doc(std::string const & doc); @@ -157,12 +159,20 @@ namespace console { implementation just forwards the call to the proxied directory node. */ + template + typename OwnerNodeCreateTraits::result_type add(std::string const & name, + Object & ob); + ///< Create new child node + /**< \see add() */ + protected: private: Owner * owner_; }; +#ifndef DOXYGEN + template <> class ScopedDirectory : public ScopedDirectoryBase { @@ -170,9 +180,12 @@ namespace console { template typename NodeCreateTraits::result_type add(std::string const & name, Object const & ob); + + template + typename NodeCreateTraits::result_type add(std::string const & name, + Object & ob); }; -#ifndef DOXYGEN template SimpleCommandNode & senf_console_add_node( DirectoryNode & node, Owner & owner, std::string const & name, Function const & fn, ...);