1346d41155a2c7c83499aecc00933aa60b5d865b
[senf.git] / senf / Utils / Console / Config.cci
1 // $Id$
2 //
3 // Copyright (C) 2008
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 // GNU General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22
23 /** \file
24     \brief Config inline non-template implementation */
25
26 #include "Config.ih"
27
28 // Custom includes
29
30 #define prefix_ inline
31 ///////////////////////////////cci.p///////////////////////////////////////
32
33 ///////////////////////////////////////////////////////////////////////////
34 // senf::console::detail::RestrictedExecutor
35
36 prefix_ bool senf::console::detail::RestrictedExecutor::complete()
37     const
38 {
39     return parsedNodes_.size() == 1
40         && ! parsedNodes_[0].expired()
41         && *parsedNodes_[0].lock() == executor_.chroot();
42 }
43
44 prefix_ void senf::console::detail::RestrictedExecutor::reset()
45 {
46     parsedNodes_.clear();
47 }
48
49 prefix_ senf::console::DirectoryNode & senf::console::detail::RestrictedExecutor::root()
50     const
51 {
52     return executor_.chroot();
53 }
54
55 prefix_ void senf::console::detail::RestrictedExecutor::chroot(DirectoryNode & node)
56 {
57     executor_.chroot(node);
58 }
59
60 prefix_ std::ostream & senf::console::detail::RestrictedExecutor::stream()
61 {
62     return stream_;
63 }
64
65 ///////////////////////////////////////////////////////////////////////////
66 // senf::console::ConfigBundle
67
68 prefix_ senf::console::ConfigBundle::ConfigBundle()
69 {}
70
71 prefix_ senf::console::ConfigBundle::ConfigBundle(DirectoryNode & root)
72     : executor_ (root)
73 {}
74
75 prefix_ bool senf::console::ConfigBundle::complete()
76     const
77 {
78     return executor_.complete();
79 }
80
81 prefix_ bool senf::console::ConfigBundle::parsed(GenericNode & node)
82     const
83 {
84     return executor_.parsed(node);
85 }
86
87 prefix_ void senf::console::ConfigBundle::reset()
88 {
89     executor_.reset();
90 }
91
92 prefix_ senf::console::DirectoryNode & senf::console::ConfigBundle::root()
93     const
94 {
95     return executor_.root();
96 }
97
98 prefix_ void senf::console::ConfigBundle::chroot(DirectoryNode & node)
99 {
100     executor_.chroot(node);
101 }
102
103 ///////////////////////////////////////////////////////////////////////////
104 // senf::console::detail::ConfigSource
105
106 prefix_ void senf::console::detail::ConfigSource::parse(RestrictedExecutor & executor)
107 {
108     v_parse(executor);
109 }
110
111 ///////////////////////////////////////////////////////////////////////////
112 // senf::console::detail::BundleMixin
113
114 prefix_ senf::console::detail::BundleMixin::BundleMixin()
115 {}
116
117 prefix_ senf::console::detail::BundleMixin::BundleMixin(DirectoryNode & root)
118     : bundle_ (root)
119 {}
120
121 prefix_ void senf::console::detail::BundleMixin::parse()
122 {
123     bundle_.parse();
124 }
125
126 prefix_ void senf::console::detail::BundleMixin::parse(DirectoryNode & restrict)
127 {
128     bundle_.parse(restrict);
129 }
130
131 prefix_ bool senf::console::detail::BundleMixin::complete()
132     const
133 {
134     return bundle_.complete();
135 }
136
137 prefix_ bool senf::console::detail::BundleMixin::parsed(GenericNode & node)
138     const
139 {
140     return bundle_.parsed(node);
141 }
142
143 prefix_ void senf::console::detail::BundleMixin::reset()
144 {
145     bundle_.reset();
146 }
147
148 ///////////////////////////////cci.e///////////////////////////////////////
149 #undef prefix_
150
151 \f
152 // Local Variables:
153 // mode: c++
154 // fill-column: 100
155 // comment-column: 40
156 // c-file-style: "senf"
157 // indent-tabs-mode: nil
158 // ispell-local-dictionary: "american"
159 // compile-command: "scons -u test"
160 // End: