ScopedDirectory.cci
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
14 /** \file
15  \brief ScopedDirectory inline non-template implementation */
16 
17 //#include "ScopedDirectory.ih"
18 
19 // Custom includes
20 
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
23 
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::console::ScopedDirectoryBase
26 
27 prefix_ senf::console::DirectoryNode & senf::console::ScopedDirectoryBase::node()
28  const
29 {
30  return *node_;
31 }
32 
33 prefix_ senf::console::ScopedDirectoryBase::operator DirectoryNode &()
34  const
35 {
36  return node();
37 }
38 
39 prefix_ senf::console::GenericNode::ptr
40 senf::console::ScopedDirectoryBase::remove(std::string const & name)
41 {
42  return node().remove(name);
43 }
44 
45 prefix_ bool senf::console::ScopedDirectoryBase::hasChild(std::string const & name)
46  const
47 {
48  return node().hasChild(name);
49 }
50 
51 prefix_ senf::console::DirectoryNode &
52 senf::console::ScopedDirectoryBase::getDirectory(std::string const & name)
53  const
54 {
55  return node().getDirectory(name);
56 }
57 
58 prefix_ senf::console::DirectoryNode &
59 senf::console::ScopedDirectoryBase::operator[](std::string const & name)
60  const
61 {
62  return node()[name];
63 }
64 
65 prefix_ senf::console::CommandNode &
66 senf::console::ScopedDirectoryBase::getCommand(std::string const & name)
67  const
68 {
69  return node().getCommand(name);
70 }
71 
72 prefix_ senf::console::CommandNode &
73 senf::console::ScopedDirectoryBase::operator()(std::string const & name)
74  const
75 {
76  return node()(name);
77 }
78 
79 prefix_ senf::console::GenericNode &
80 senf::console::ScopedDirectoryBase::get(std::string const & name)
81  const
82 {
83  return node().get(name);
84 }
85 
86 prefix_ senf::console::DirectoryNode::ChildrenRange
87 senf::console::ScopedDirectoryBase::children()
88  const
89 {
90  return node().children();
91 }
92 
93 prefix_ senf::console::DirectoryNode &
94 senf::console::ScopedDirectoryBase::doc(std::string const & doc)
95 {
96  return node().doc(doc);
97 }
98 
99 prefix_ std::string const & senf::console::ScopedDirectoryBase::name()
100  const
101 {
102  return node().name();
103 }
104 
105 prefix_ bool senf::console::ScopedDirectoryBase::active()
106  const
107 {
108  return node().active();
109 }
110 
111 prefix_ std::string senf::console::ScopedDirectoryBase::path()
112  const
113 {
114  return node().path();
115 }
116 
117 prefix_ std::string senf::console::ScopedDirectoryBase::path(DirectoryNode const & root)
118  const
119 {
120  return node().path(root);
121 }
122 
123 prefix_ boost::shared_ptr<senf::console::DirectoryNode>
124 senf::console::ScopedDirectoryBase::parent()
125  const
126 {
127  return node().parent();
128 }
129 
130 prefix_ senf::console::GenericNode::ptr senf::console::ScopedDirectoryBase::unlink()
131 {
132  return node().unlink();
133 }
134 
135 prefix_ void senf::console::ScopedDirectoryBase::help(std::ostream & output)
136  const
137 {
138  node().help( output);
139 }
140 
141 prefix_ std::string senf::console::ScopedDirectoryBase::shorthelp()
142  const
143 {
144  return node().shorthelp();
145 }
146 
147 prefix_ senf::console::ScopedDirectoryBase::ScopedDirectoryBase()
148  : node_ (DirectoryNode::create())
149 {}
150 
151 prefix_ senf::console::ScopedDirectoryBase::~ScopedDirectoryBase()
152 {
153  node_->unlink();
154 }
155 
156 //-/////////////////////////////////////////////////////////////////////////////////////////////////
157 #undef prefix_
158 
159 
160 // Local Variables:
161 // mode: c++
162 // fill-column: 100
163 // comment-column: 40
164 // c-file-style: "senf"
165 // indent-tabs-mode: nil
166 // ispell-local-dictionary: "american"
167 // compile-command: "scons -u test"
168 // End: