00001 // $Id: ScopedDirectory.cci 1742 2010-11-04 14:51:56Z g0dil $ 00002 // 00003 // Copyright (C) 2008 00004 // Fraunhofer (FOKUS) 00005 // Competence Center NETwork research (NET), St. Augustin, GERMANY 00006 // Stefan Bund <g0dil@berlios.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with this program; if not, write to the 00020 // Free Software Foundation, Inc., 00021 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 00026 //#include "ScopedDirectory.ih" 00027 00028 // Custom includes 00029 00030 #define prefix_ inline 00031 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00032 00033 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00034 // senf::console::ScopedDirectoryBase 00035 00036 prefix_ senf::console::DirectoryNode & senf::console::ScopedDirectoryBase::node() 00037 const 00038 { 00039 return *node_; 00040 } 00041 00042 prefix_ senf::console::ScopedDirectoryBase::operator DirectoryNode &() 00043 const 00044 { 00045 return node(); 00046 } 00047 00048 prefix_ senf::console::GenericNode::ptr 00049 senf::console::ScopedDirectoryBase::remove(std::string const & name) 00050 { 00051 return node().remove(name); 00052 } 00053 00054 prefix_ bool senf::console::ScopedDirectoryBase::hasChild(std::string const & name) 00055 const 00056 { 00057 return node().hasChild(name); 00058 } 00059 00060 prefix_ senf::console::DirectoryNode & 00061 senf::console::ScopedDirectoryBase::getDirectory(std::string const & name) 00062 const 00063 { 00064 return node().getDirectory(name); 00065 } 00066 00067 prefix_ senf::console::DirectoryNode & 00068 senf::console::ScopedDirectoryBase::operator[](std::string const & name) 00069 const 00070 { 00071 return node()[name]; 00072 } 00073 00074 prefix_ senf::console::CommandNode & 00075 senf::console::ScopedDirectoryBase::getCommand(std::string const & name) 00076 const 00077 { 00078 return node().getCommand(name); 00079 } 00080 00081 prefix_ senf::console::CommandNode & 00082 senf::console::ScopedDirectoryBase::operator()(std::string const & name) 00083 const 00084 { 00085 return node()(name); 00086 } 00087 00088 prefix_ senf::console::GenericNode & 00089 senf::console::ScopedDirectoryBase::get(std::string const & name) 00090 const 00091 { 00092 return node().get(name); 00093 } 00094 00095 prefix_ senf::console::DirectoryNode::ChildrenRange 00096 senf::console::ScopedDirectoryBase::children() 00097 const 00098 { 00099 return node().children(); 00100 } 00101 00102 prefix_ senf::console::DirectoryNode & 00103 senf::console::ScopedDirectoryBase::doc(std::string const & doc) 00104 { 00105 return node().doc(doc); 00106 } 00107 00108 prefix_ std::string const & senf::console::ScopedDirectoryBase::name() 00109 const 00110 { 00111 return node().name(); 00112 } 00113 00114 prefix_ bool senf::console::ScopedDirectoryBase::active() 00115 const 00116 { 00117 return node().active(); 00118 } 00119 00120 prefix_ std::string senf::console::ScopedDirectoryBase::path() 00121 const 00122 { 00123 return node().path(); 00124 } 00125 00126 prefix_ std::string senf::console::ScopedDirectoryBase::path(DirectoryNode const & root) 00127 const 00128 { 00129 return node().path(root); 00130 } 00131 00132 prefix_ boost::shared_ptr<senf::console::DirectoryNode> 00133 senf::console::ScopedDirectoryBase::parent() 00134 const 00135 { 00136 return node().parent(); 00137 } 00138 00139 prefix_ senf::console::GenericNode::ptr senf::console::ScopedDirectoryBase::unlink() 00140 { 00141 return node().unlink(); 00142 } 00143 00144 prefix_ void senf::console::ScopedDirectoryBase::help(std::ostream & output) 00145 const 00146 { 00147 node().help( output); 00148 } 00149 00150 prefix_ std::string senf::console::ScopedDirectoryBase::shorthelp() 00151 const 00152 { 00153 return node().shorthelp(); 00154 } 00155 00156 prefix_ senf::console::ScopedDirectoryBase::ScopedDirectoryBase() 00157 : node_ (DirectoryNode::create()) 00158 {} 00159 00160 prefix_ senf::console::ScopedDirectoryBase::~ScopedDirectoryBase() 00161 { 00162 node_->unlink(); 00163 } 00164 00165 //-///////////////////////////////////////////////////////////////////////////////////////////////// 00166 #undef prefix_ 00167 00168 00169 // Local Variables: 00170 // mode: c++ 00171 // fill-column: 100 00172 // comment-column: 40 00173 // c-file-style: "senf" 00174 // indent-tabs-mode: nil 00175 // ispell-local-dictionary: "american" 00176 // compile-command: "scons -u test" 00177 // End: