36
30
<a name="l00011"></a>00011 <span class="comment"> * General Public License for more details.</span>
37
31
<a name="l00012"></a>00012 <span class="comment"> *</span>
38
32
<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
39
<a name="l00014"></a>00014 <span class="comment"> * along with this program; if not, write to the Free Software</span>
40
<a name="l00015"></a>00015 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston,</span>
41
<a name="l00016"></a>00016 <span class="comment"> * MA 02111-1307 USA</span>
42
<a name="l00017"></a>00017 <span class="comment"> *</span>
43
<a name="l00018"></a>00018 <span class="comment"> *********************************************************************/</span>
44
<a name="l00019"></a>00019
45
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef SBUILD_CHROOT_CONFIG_H</span>
46
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define SBUILD_CHROOT_CONFIG_H</span>
47
<a name="l00022"></a>00022 <span class="preprocessor"></span>
48
<a name="l00023"></a>00023 <span class="preprocessor">#include <<a class="code" href="sbuild-chroot_8h.html">sbuild/sbuild-chroot.h</a>></span>
49
<a name="l00024"></a>00024 <span class="preprocessor">#include <<a class="code" href="sbuild-custom-error_8h.html">sbuild/sbuild-custom-error.h</a>></span>
50
<a name="l00025"></a>00025
51
<a name="l00026"></a>00026 <span class="preprocessor">#include <map></span>
52
<a name="l00027"></a>00027 <span class="preprocessor">#include <ostream></span>
53
<a name="l00028"></a>00028 <span class="preprocessor">#include <vector></span>
54
<a name="l00029"></a>00029 <span class="preprocessor">#include <string></span>
55
<a name="l00030"></a>00030
56
<a name="l00031"></a>00031 <span class="keyword">namespace </span>sbuild
57
<a name="l00032"></a>00032 {
58
<a name="l00033"></a>00033
59
<a name="l00043"></a><a class="code" href="classsbuild_1_1chroot__config.html">00043</a> <span class="keyword">class </span><a class="code" href="classsbuild_1_1chroot__config.html" title="Chroot configuration.">chroot_config</a>
60
<a name="l00044"></a>00044 {
61
<a name="l00045"></a>00045 <span class="keyword">public</span>:
62
<a name="l00047"></a><a class="code" href="classsbuild_1_1chroot__config.html#2f5c15ac05dd764c9844a76d4834db83">00047</a> <span class="keyword">typedef</span> std::vector<chroot::ptr> <a class="code" href="classsbuild_1_1chroot__config.html#2f5c15ac05dd764c9844a76d4834db83" title="A list of chroots.">chroot_list</a>;
63
<a name="l00049"></a><a class="code" href="classsbuild_1_1chroot__config.html#01055affcab815b87f527aed869b0ee1">00049</a> <span class="keyword">typedef</span> std::map<std::string, std::string> <a class="code" href="classsbuild_1_1chroot__config.html#01055affcab815b87f527aed869b0ee1" title="A map between key-value string pairs.">string_map</a>;
64
<a name="l00051"></a><a class="code" href="classsbuild_1_1chroot__config.html#fa4b5864ee09ef003314d14e7e4d5ec3">00051</a> <span class="keyword">typedef</span> std::map<std::string, chroot::ptr> <a class="code" href="classsbuild_1_1chroot__config.html#fa4b5864ee09ef003314d14e7e4d5ec3" title="A map between a chroot name and a chroot object.">chroot_map</a>;
65
<a name="l00052"></a>00052
66
<a name="l00054"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09">00054</a> <span class="keyword">enum</span> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09" title="Error codes.">error_code</a>
67
<a name="l00055"></a>00055 {
68
<a name="l00056"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed0969468f77a768abb2a88dc43f6f17ed32">00056</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed0969468f77a768abb2a88dc43f6f17ed32" title="Alias already associated with chroot.">ALIAS_EXIST</a>,
69
<a name="l00057"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09c2bc345efd46ed2f501f3d8834f06539">00057</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09c2bc345efd46ed2f501f3d8834f06539" title="No such chroot.">CHROOT_NOTFOUND</a>,
70
<a name="l00058"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09d235f70430ba0616aa8feeda61f5a9cc">00058</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09d235f70430ba0616aa8feeda61f5a9cc" title="A chroot or alias already exists with this name.">CHROOT_EXIST</a>,
71
<a name="l00059"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09b00384e1b8586bca2419754279499bf5">00059</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09b00384e1b8586bca2419754279499bf5" title="File is not a regular file.">FILE_NOTREG</a>,
72
<a name="l00060"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed099201ffec6def86b37c1ef884bd327eda">00060</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed099201ffec6def86b37c1ef884bd327eda" title="Failed to open file.">FILE_OPEN</a>,
73
<a name="l00061"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09ed1b617b0954cc663c84384e290536dd">00061</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09ed1b617b0954cc663c84384e290536dd" title="File is not owned by user root.">FILE_OWNER</a>,
74
<a name="l00062"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09cbee3414b1eb338082554736d62bbeca">00062</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09cbee3414b1eb338082554736d62bbeca" title="File has write permissions for others.">FILE_PERMS</a>,
75
<a name="l00063"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed099e60f2de1d5a2289200af5562104e359">00063</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed099e60f2de1d5a2289200af5562104e359" title="Failed to stat file.">FILE_STAT</a>
76
<a name="l00064"></a>00064 };
77
<a name="l00065"></a>00065
78
<a name="l00067"></a><a class="code" href="classsbuild_1_1chroot__config.html#a7ee23a948cd404acfa87df13b4607c6">00067</a> <span class="keyword">typedef</span> <a class="code" href="classsbuild_1_1custom__error.html" title="Custom error.">custom_error<error_code></a> <a class="code" href="classsbuild_1_1custom__error.html" title="Custom error.">error</a>;
79
<a name="l00068"></a>00068
80
<a name="l00070"></a><a class="code" href="classsbuild_1_1chroot__config.html#6138ce730de1d69e0f97d4100228b697">00070</a> <span class="keyword">typedef</span> std::tr1::shared_ptr<chroot_config> <a class="code" href="classsbuild_1_1chroot__config.html#6138ce730de1d69e0f97d4100228b697" title="A shared_ptr to a chroot_config object.">ptr</a>;
81
<a name="l00071"></a>00071
82
<a name="l00073"></a>00073 <a class="code" href="classsbuild_1_1chroot__config.html#24e9f935f723bb1090157225a2fe9105" title="The constructor.">chroot_config</a> ();
83
<a name="l00074"></a>00074
84
<a name="l00083"></a>00083 <a class="code" href="classsbuild_1_1chroot__config.html#24e9f935f723bb1090157225a2fe9105" title="The constructor.">chroot_config</a> (std::string <span class="keyword">const</span>& file,
85
<a name="l00084"></a>00084 <span class="keywordtype">bool</span> active);
86
<a name="l00085"></a>00085
87
<a name="l00087"></a>00087 <span class="keyword">virtual</span> <a class="code" href="classsbuild_1_1chroot__config.html#dd25fa9f67e2db1030b27cc1a6a71d79" title="The destructor.">~chroot_config</a> ();
88
<a name="l00088"></a>00088
89
<a name="l00098"></a>00098 <span class="keywordtype">void</span>
90
<a name="l00099"></a>00099 <span class="keyword">add</span> (std::string <span class="keyword">const</span>& location,
91
<a name="l00100"></a>00100 <span class="keywordtype">bool</span> active);
92
<a name="l00101"></a>00101
93
<a name="l00102"></a>00102 <span class="keyword">private</span>:
94
<a name="l00111"></a>00111 <span class="keywordtype">void</span>
95
<a name="l00112"></a>00112 <a class="code" href="classsbuild_1_1chroot__config.html#b4fbd9e9fd037fd36173906c0268d844" title="Add a configuration file.">add_config_file</a> (std::string <span class="keyword">const</span>& file,
96
<a name="l00113"></a>00113 <span class="keywordtype">bool</span> active);
97
<a name="l00114"></a>00114
98
<a name="l00123"></a>00123 <span class="keywordtype">void</span>
99
<a name="l00124"></a>00124 <a class="code" href="classsbuild_1_1chroot__config.html#4aa57cb018c272403e5e774f23c22e0e" title="Add a configuration directory.">add_config_directory</a> (std::string <span class="keyword">const</span>& dir,
100
<a name="l00125"></a>00125 <span class="keywordtype">bool</span> active);
101
<a name="l00126"></a>00126
102
<a name="l00127"></a>00127 <span class="keyword">protected</span>:
103
<a name="l00138"></a>00138 <span class="keywordtype">void</span>
104
<a name="l00139"></a>00139 <span class="keyword">add</span> (<a class="code" href="classsbuild_1_1chroot.html#ef7d5b607d1a0a4a7ebe1d40e2ec9c3a" title="A shared_ptr to a chroot object.">chroot::ptr</a>& <a class="code" href="classsbuild_1_1chroot.html" title="Common chroot data.">chroot</a>,
105
<a name="l00140"></a>00140 <a class="code" href="classsbuild_1_1basic__keyfile.html" title="Configuration file parser.">keyfile</a> <span class="keyword">const</span>& kconfig);
106
<a name="l00141"></a>00141
107
<a name="l00142"></a>00142 <span class="keyword">public</span>:
108
<a name="l00149"></a>00149 <a class="code" href="classsbuild_1_1chroot__config.html#2f5c15ac05dd764c9844a76d4834db83" title="A list of chroots.">chroot_list</a>
109
<a name="l00150"></a>00150 <a class="code" href="classsbuild_1_1chroot__config.html#c638ba1d392b1294b1175506a81af022" title="Get a list of available chroots.">get_chroots</a> () <span class="keyword">const</span>;
110
<a name="l00151"></a>00151
111
<a name="l00158"></a>00158 <span class="keyword">const</span> <a class="code" href="classsbuild_1_1chroot.html#ef7d5b607d1a0a4a7ebe1d40e2ec9c3a" title="A shared_ptr to a chroot object.">chroot::ptr</a>
112
<a name="l00159"></a>00159 <a class="code" href="classsbuild_1_1chroot__config.html#3224fe813f1bddd6ba56a49b7553f497" title="Find a chroot by its name.">find_chroot</a> (std::string <span class="keyword">const</span>& name) <span class="keyword">const</span>;
113
<a name="l00160"></a>00160
114
<a name="l00167"></a>00167 <span class="keyword">const</span> <a class="code" href="classsbuild_1_1chroot.html#ef7d5b607d1a0a4a7ebe1d40e2ec9c3a" title="A shared_ptr to a chroot object.">chroot::ptr</a>
115
<a name="l00168"></a>00168 <a class="code" href="classsbuild_1_1chroot__config.html#faaaa9bc058e38d398bffeba867cb9f5" title="Find a chroot by its name or an alias.">find_alias</a> (std::string <span class="keyword">const</span>& name) <span class="keyword">const</span>;
116
<a name="l00169"></a>00169
117
<a name="l00177"></a>00177 <a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a>
118
<a name="l00178"></a>00178 <a class="code" href="classsbuild_1_1chroot__config.html#31dd02f6e3d06d4be0cd4db1fee64d36" title="Get the names (including aliases) of all the available chroots, sorted in alphabetical...">get_chroot_list</a> () <span class="keyword">const</span>;
119
<a name="l00179"></a>00179
120
<a name="l00185"></a>00185 <span class="keywordtype">void</span>
121
<a name="l00186"></a>00186 <a class="code" href="classsbuild_1_1chroot__config.html#5b48be455da8714f9ec0b5d7bf52ef85" title="Print all the available chroots to the specified stream.">print_chroot_list</a> (std::ostream& stream) <span class="keyword">const</span>;
122
<a name="l00187"></a>00187
123
<a name="l00194"></a>00194 <span class="keywordtype">void</span>
124
<a name="l00195"></a>00195 <a class="code" href="classsbuild_1_1chroot__config.html#a8179c0a28c714cfb540598c366778ec" title="Print a single line of all the available chroots to the specified stream.">print_chroot_list_simple</a> (std::ostream& stream) <span class="keyword">const</span>;
125
<a name="l00196"></a>00196
126
<a name="l00204"></a>00204 <span class="keywordtype">void</span>
127
<a name="l00205"></a>00205 <a class="code" href="classsbuild_1_1chroot__config.html#43402fdc6b09d73d8e5d43b79eb08733" title="Print information about the specified chroots to the specified stream.">print_chroot_info</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name->chroot mapping).">chroots</a>,
128
<a name="l00206"></a>00206 std::ostream& stream) <span class="keyword">const</span>;
129
<a name="l00207"></a>00207
130
<a name="l00215"></a>00215 <span class="keywordtype">void</span>
131
<a name="l00216"></a>00216 <a class="code" href="classsbuild_1_1chroot__config.html#943165e50dfc44b61fadc62d1c0a677a" title="Print location information about the specified chroots to the specified stream.">print_chroot_location</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name->chroot mapping).">chroots</a>,
132
<a name="l00217"></a>00217 std::ostream& stream) <span class="keyword">const</span>;
133
<a name="l00218"></a>00218
134
<a name="l00226"></a>00226 <span class="keywordtype">void</span>
135
<a name="l00227"></a>00227 <a class="code" href="classsbuild_1_1chroot__config.html#4d9be6a69aeac05a72e640af62166278" title="Print configuration of the specified chroots to the specified stream.">print_chroot_config</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name->chroot mapping).">chroots</a>,
136
<a name="l00228"></a>00228 std::ostream& stream) <span class="keyword">const</span>;
137
<a name="l00229"></a>00229
138
<a name="l00237"></a>00237 <a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a>
139
<a name="l00238"></a>00238 <a class="code" href="classsbuild_1_1chroot__config.html#66ff16712249ed97546e1d17e112b44b" title="Check that all the chroots specified exist.">validate_chroots</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name->chroot mapping).">chroots</a>) <span class="keyword">const</span>;
140
<a name="l00239"></a>00239
141
<a name="l00240"></a>00240 <span class="keyword">private</span>:
142
<a name="l00250"></a>00250 <span class="keywordtype">void</span>
143
<a name="l00251"></a>00251 <a class="code" href="classsbuild_1_1chroot__config.html#b73836a7e4bfa21c3300a5e39e157f75" title="Load a configuration file.">load_data</a> (std::string <span class="keyword">const</span>& file,
144
<a name="l00252"></a>00252 <span class="keywordtype">bool</span> active);
145
<a name="l00253"></a>00253
146
<a name="l00254"></a>00254 <span class="keyword">protected</span>:
147
<a name="l00263"></a>00263 <span class="keyword">virtual</span> <span class="keywordtype">void</span>
148
<a name="l00264"></a>00264 <a class="code" href="classsbuild_1_1chroot__config.html#32a3a4e480c9c0a526dea65abceb7e62" title="Parse a loaded configuration file.">parse_data</a> (std::istream& stream,
149
<a name="l00265"></a>00265 <span class="keywordtype">bool</span> active);
150
<a name="l00266"></a>00266
151
<a name="l00275"></a>00275 <span class="keyword">virtual</span> <span class="keywordtype">void</span>
152
<a name="l00276"></a>00276 <a class="code" href="classsbuild_1_1chroot__config.html#44d852b75f761e278c84b3f05063d455" title="Load a keyfile.">load_keyfile</a> (<a class="code" href="classsbuild_1_1basic__keyfile.html" title="Configuration file parser.">keyfile</a>& kconfig,
153
<a name="l00277"></a>00277 <span class="keywordtype">bool</span> active);
154
<a name="l00278"></a>00278
155
<a name="l00280"></a><a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833">00280</a> <a class="code" href="classsbuild_1_1chroot__config.html#fa4b5864ee09ef003314d14e7e4d5ec3" title="A map between a chroot name and a chroot object.">chroot_map</a> <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name->chroot mapping).">chroots</a>;
156
<a name="l00282"></a><a class="code" href="classsbuild_1_1chroot__config.html#f06b67d2134cd508c6ddf088668ae6e4">00282</a> <a class="code" href="classsbuild_1_1chroot__config.html#01055affcab815b87f527aed869b0ee1" title="A map between key-value string pairs.">string_map</a> <a class="code" href="classsbuild_1_1chroot__config.html#f06b67d2134cd508c6ddf088668ae6e4" title="A list of aliases (alias->name mapping).">aliases</a>;
157
<a name="l00283"></a>00283 };
33
<a name="l00014"></a>00014 <span class="comment"> * along with this program. If not, see</span>
34
<a name="l00015"></a>00015 <span class="comment"> * <http://www.gnu.org/licenses/>.</span>
35
<a name="l00016"></a>00016 <span class="comment"> *</span>
36
<a name="l00017"></a>00017 <span class="comment"> *********************************************************************/</span>
37
<a name="l00018"></a>00018
38
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef SBUILD_CHROOT_CONFIG_H</span>
39
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define SBUILD_CHROOT_CONFIG_H</span>
40
<a name="l00021"></a>00021 <span class="preprocessor"></span>
41
<a name="l00022"></a>00022 <span class="preprocessor">#include <<a class="code" href="sbuild-chroot_8h.html">sbuild/sbuild-chroot.h</a>></span>
42
<a name="l00023"></a>00023 <span class="preprocessor">#include <<a class="code" href="sbuild-custom-error_8h.html">sbuild/sbuild-custom-error.h</a>></span>
43
<a name="l00024"></a>00024
44
<a name="l00025"></a>00025 <span class="preprocessor">#include <map></span>
45
<a name="l00026"></a>00026 <span class="preprocessor">#include <ostream></span>
46
<a name="l00027"></a>00027 <span class="preprocessor">#include <vector></span>
47
<a name="l00028"></a>00028 <span class="preprocessor">#include <string></span>
48
<a name="l00029"></a>00029
49
<a name="l00030"></a>00030 <span class="keyword">namespace </span>sbuild
50
<a name="l00031"></a>00031 {
51
<a name="l00032"></a>00032
52
<a name="l00042"></a><a class="code" href="classsbuild_1_1chroot__config.html">00042</a> <span class="keyword">class </span><a class="code" href="classsbuild_1_1chroot__config.html" title="Chroot configuration.">chroot_config</a>
53
<a name="l00043"></a>00043 {
54
<a name="l00044"></a>00044 <span class="keyword">public</span>:
55
<a name="l00046"></a><a class="code" href="classsbuild_1_1chroot__config.html#2f5c15ac05dd764c9844a76d4834db83">00046</a> <span class="keyword">typedef</span> std::vector<chroot::ptr> <a class="code" href="classsbuild_1_1chroot__config.html#2f5c15ac05dd764c9844a76d4834db83" title="A list of chroots.">chroot_list</a>;
56
<a name="l00048"></a><a class="code" href="classsbuild_1_1chroot__config.html#01055affcab815b87f527aed869b0ee1">00048</a> <span class="keyword">typedef</span> std::map<std::string, std::string> <a class="code" href="classsbuild_1_1chroot__config.html#01055affcab815b87f527aed869b0ee1" title="A map between key-value string pairs.">string_map</a>;
57
<a name="l00050"></a><a class="code" href="classsbuild_1_1chroot__config.html#fa4b5864ee09ef003314d14e7e4d5ec3">00050</a> <span class="keyword">typedef</span> std::map<std::string, chroot::ptr> <a class="code" href="classsbuild_1_1chroot__config.html#fa4b5864ee09ef003314d14e7e4d5ec3" title="A map between a chroot name and a chroot object.">chroot_map</a>;
58
<a name="l00051"></a>00051
59
<a name="l00053"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09">00053</a> <span class="keyword">enum</span> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09" title="Error codes.">error_code</a>
60
<a name="l00054"></a>00054 {
61
<a name="l00055"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed0969468f77a768abb2a88dc43f6f17ed32">00055</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed0969468f77a768abb2a88dc43f6f17ed32" title="Alias already associated with chroot.">ALIAS_EXIST</a>,
62
<a name="l00056"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09c2bc345efd46ed2f501f3d8834f06539">00056</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09c2bc345efd46ed2f501f3d8834f06539" title="No such chroot.">CHROOT_NOTFOUND</a>,
63
<a name="l00057"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09d235f70430ba0616aa8feeda61f5a9cc">00057</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09d235f70430ba0616aa8feeda61f5a9cc" title="A chroot or alias already exists with this name.">CHROOT_EXIST</a>,
64
<a name="l00058"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09b00384e1b8586bca2419754279499bf5">00058</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09b00384e1b8586bca2419754279499bf5" title="File is not a regular file.">FILE_NOTREG</a>,
65
<a name="l00059"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed099201ffec6def86b37c1ef884bd327eda">00059</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed099201ffec6def86b37c1ef884bd327eda" title="Failed to open file.">FILE_OPEN</a>,
66
<a name="l00060"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09ed1b617b0954cc663c84384e290536dd">00060</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09ed1b617b0954cc663c84384e290536dd" title="File is not owned by user root.">FILE_OWNER</a>,
67
<a name="l00061"></a><a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09cbee3414b1eb338082554736d62bbeca">00061</a> <a class="code" href="classsbuild_1_1chroot__config.html#41561f59fc684eef2fe045932139ed09cbee3414b1eb338082554736d62bbeca" title="File has write permissions for others.">FILE_PERMS</a>
68
<a name="l00062"></a>00062 };
69
<a name="l00063"></a>00063
70
<a name="l00065"></a><a class="code" href="classsbuild_1_1chroot__config.html#a7ee23a948cd404acfa87df13b4607c6">00065</a> <span class="keyword">typedef</span> <a class="code" href="classsbuild_1_1custom__error.html" title="Custom error.">custom_error<error_code></a> <a class="code" href="classsbuild_1_1custom__error.html" title="Custom error.">error</a>;
71
<a name="l00066"></a>00066
72
<a name="l00068"></a><a class="code" href="classsbuild_1_1chroot__config.html#6138ce730de1d69e0f97d4100228b697">00068</a> <span class="keyword">typedef</span> std::tr1::shared_ptr<chroot_config> <a class="code" href="classsbuild_1_1chroot__config.html#6138ce730de1d69e0f97d4100228b697" title="A shared_ptr to a chroot_config object.">ptr</a>;
73
<a name="l00069"></a>00069
74
<a name="l00071"></a>00071 <a class="code" href="classsbuild_1_1chroot__config.html#24e9f935f723bb1090157225a2fe9105" title="The constructor.">chroot_config</a> ();
75
<a name="l00072"></a>00072
76
<a name="l00081"></a>00081 <a class="code" href="classsbuild_1_1chroot__config.html#24e9f935f723bb1090157225a2fe9105" title="The constructor.">chroot_config</a> (std::string <span class="keyword">const</span>& file,
77
<a name="l00082"></a>00082 <span class="keywordtype">bool</span> active);
78
<a name="l00083"></a>00083
79
<a name="l00085"></a>00085 <span class="keyword">virtual</span> <a class="code" href="classsbuild_1_1chroot__config.html#dd25fa9f67e2db1030b27cc1a6a71d79" title="The destructor.">~chroot_config</a> ();
80
<a name="l00086"></a>00086
81
<a name="l00096"></a>00096 <span class="keywordtype">void</span>
82
<a name="l00097"></a>00097 <span class="keyword">add</span> (std::string <span class="keyword">const</span>& location,
83
<a name="l00098"></a>00098 <span class="keywordtype">bool</span> active);
84
<a name="l00099"></a>00099
85
<a name="l00100"></a>00100 <span class="keyword">private</span>:
86
<a name="l00109"></a>00109 <span class="keywordtype">void</span>
87
<a name="l00110"></a>00110 <a class="code" href="classsbuild_1_1chroot__config.html#b4fbd9e9fd037fd36173906c0268d844" title="Add a configuration file.">add_config_file</a> (std::string <span class="keyword">const</span>& file,
88
<a name="l00111"></a>00111 <span class="keywordtype">bool</span> active);
89
<a name="l00112"></a>00112
90
<a name="l00121"></a>00121 <span class="keywordtype">void</span>
91
<a name="l00122"></a>00122 <a class="code" href="classsbuild_1_1chroot__config.html#4aa57cb018c272403e5e774f23c22e0e" title="Add a configuration directory.">add_config_directory</a> (std::string <span class="keyword">const</span>& dir,
92
<a name="l00123"></a>00123 <span class="keywordtype">bool</span> active);
93
<a name="l00124"></a>00124
94
<a name="l00125"></a>00125 <span class="keyword">protected</span>:
95
<a name="l00136"></a>00136 <span class="keywordtype">void</span>
96
<a name="l00137"></a>00137 <span class="keyword">add</span> (<a class="code" href="classsbuild_1_1chroot.html#ef7d5b607d1a0a4a7ebe1d40e2ec9c3a" title="A shared_ptr to a chroot object.">chroot::ptr</a>& <a class="code" href="classsbuild_1_1chroot.html" title="Common chroot data.">chroot</a>,
97
<a name="l00138"></a>00138 <a class="code" href="classsbuild_1_1basic__keyfile.html" title="Configuration file parser.">keyfile</a> <span class="keyword">const</span>& kconfig);
98
<a name="l00139"></a>00139
99
<a name="l00140"></a>00140 <span class="keyword">public</span>:
100
<a name="l00147"></a>00147 <a class="code" href="classsbuild_1_1chroot__config.html#2f5c15ac05dd764c9844a76d4834db83" title="A list of chroots.">chroot_list</a>
101
<a name="l00148"></a>00148 <a class="code" href="classsbuild_1_1chroot__config.html#cc56f30c91ee4765662d59b6b0909852" title="Get a list of available chroots.">get_chroots</a> () <span class="keyword">const</span>;
102
<a name="l00149"></a>00149
103
<a name="l00156"></a>00156 <span class="keyword">const</span> <a class="code" href="classsbuild_1_1chroot.html#ef7d5b607d1a0a4a7ebe1d40e2ec9c3a" title="A shared_ptr to a chroot object.">chroot::ptr</a>
104
<a name="l00157"></a>00157 <a class="code" href="classsbuild_1_1chroot__config.html#3224fe813f1bddd6ba56a49b7553f497" title="Find a chroot by its name.">find_chroot</a> (std::string <span class="keyword">const</span>& name) <span class="keyword">const</span>;
105
<a name="l00158"></a>00158
106
<a name="l00165"></a>00165 <span class="keyword">const</span> <a class="code" href="classsbuild_1_1chroot.html#ef7d5b607d1a0a4a7ebe1d40e2ec9c3a" title="A shared_ptr to a chroot object.">chroot::ptr</a>
107
<a name="l00166"></a>00166 <a class="code" href="classsbuild_1_1chroot__config.html#faaaa9bc058e38d398bffeba867cb9f5" title="Find a chroot by its name or an alias.">find_alias</a> (std::string <span class="keyword">const</span>& name) <span class="keyword">const</span>;
108
<a name="l00167"></a>00167
109
<a name="l00175"></a>00175 <a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a>
110
<a name="l00176"></a>00176 <a class="code" href="classsbuild_1_1chroot__config.html#d3038678d455444163b44677d2d3554c" title="Get the names (including aliases) of all the available chroots, sorted in alphabetical...">get_chroot_list</a> () <span class="keyword">const</span>;
111
<a name="l00177"></a>00177
112
<a name="l00183"></a>00183 <span class="keywordtype">void</span>
113
<a name="l00184"></a>00184 <a class="code" href="classsbuild_1_1chroot__config.html#3a5e20d25c6e45b99b032c1410d3611c" title="Print all the available chroots to the specified stream.">print_chroot_list</a> (std::ostream& stream) <span class="keyword">const</span>;
114
<a name="l00185"></a>00185
115
<a name="l00192"></a>00192 <span class="keywordtype">void</span>
116
<a name="l00193"></a>00193 <a class="code" href="classsbuild_1_1chroot__config.html#59f5dceb1944ca6df73ed486faa3e989" title="Print a single line of all the available chroots to the specified stream.">print_chroot_list_simple</a> (std::ostream& stream) <span class="keyword">const</span>;
117
<a name="l00194"></a>00194
118
<a name="l00202"></a>00202 <span class="keywordtype">void</span>
119
<a name="l00203"></a>00203 <a class="code" href="classsbuild_1_1chroot__config.html#43402fdc6b09d73d8e5d43b79eb08733" title="Print information about the specified chroots to the specified stream.">print_chroot_info</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name-&gt;chroot mapping).">chroots</a>,
120
<a name="l00204"></a>00204 std::ostream& stream) <span class="keyword">const</span>;
121
<a name="l00205"></a>00205
122
<a name="l00213"></a>00213 <span class="keywordtype">void</span>
123
<a name="l00214"></a>00214 <a class="code" href="classsbuild_1_1chroot__config.html#943165e50dfc44b61fadc62d1c0a677a" title="Print location information about the specified chroots to the specified stream.">print_chroot_location</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name-&gt;chroot mapping).">chroots</a>,
124
<a name="l00215"></a>00215 std::ostream& stream) <span class="keyword">const</span>;
125
<a name="l00216"></a>00216
126
<a name="l00224"></a>00224 <span class="keywordtype">void</span>
127
<a name="l00225"></a>00225 <a class="code" href="classsbuild_1_1chroot__config.html#4d9be6a69aeac05a72e640af62166278" title="Print configuration of the specified chroots to the specified stream.">print_chroot_config</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name-&gt;chroot mapping).">chroots</a>,
128
<a name="l00226"></a>00226 std::ostream& stream) <span class="keyword">const</span>;
129
<a name="l00227"></a>00227
130
<a name="l00235"></a>00235 <a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a>
131
<a name="l00236"></a>00236 <a class="code" href="classsbuild_1_1chroot__config.html#66ff16712249ed97546e1d17e112b44b" title="Check that all the chroots specified exist.">validate_chroots</a> (<a class="code" href="namespacesbuild.html#4268c3202ab4b20cbebf347a6d69393f" title="A string vector.">string_list</a> <span class="keyword">const</span>& <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name-&gt;chroot mapping).">chroots</a>) <span class="keyword">const</span>;
132
<a name="l00237"></a>00237
133
<a name="l00238"></a>00238 <span class="keyword">private</span>:
134
<a name="l00248"></a>00248 <span class="keywordtype">void</span>
135
<a name="l00249"></a>00249 <a class="code" href="classsbuild_1_1chroot__config.html#b73836a7e4bfa21c3300a5e39e157f75" title="Load a configuration file.">load_data</a> (std::string <span class="keyword">const</span>& file,
136
<a name="l00250"></a>00250 <span class="keywordtype">bool</span> active);
137
<a name="l00251"></a>00251
138
<a name="l00252"></a>00252 <span class="keyword">protected</span>:
139
<a name="l00261"></a>00261 <span class="keyword">virtual</span> <span class="keywordtype">void</span>
140
<a name="l00262"></a>00262 <a class="code" href="classsbuild_1_1chroot__config.html#32a3a4e480c9c0a526dea65abceb7e62" title="Parse a loaded configuration file.">parse_data</a> (std::istream& stream,
141
<a name="l00263"></a>00263 <span class="keywordtype">bool</span> active);
142
<a name="l00264"></a>00264
143
<a name="l00273"></a>00273 <span class="keyword">virtual</span> <span class="keywordtype">void</span>
144
<a name="l00274"></a>00274 <a class="code" href="classsbuild_1_1chroot__config.html#44d852b75f761e278c84b3f05063d455" title="Load a keyfile.">load_keyfile</a> (<a class="code" href="classsbuild_1_1basic__keyfile.html" title="Configuration file parser.">keyfile</a>& kconfig,
145
<a name="l00275"></a>00275 <span class="keywordtype">bool</span> active);
146
<a name="l00276"></a>00276
147
<a name="l00278"></a><a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833">00278</a> <a class="code" href="classsbuild_1_1chroot__config.html#fa4b5864ee09ef003314d14e7e4d5ec3" title="A map between a chroot name and a chroot object.">chroot_map</a> <a class="code" href="classsbuild_1_1chroot__config.html#fd4596298ae5fb82629cce2c696d1833" title="A list of chroots (name-&gt;chroot mapping).">chroots</a>;
148
<a name="l00280"></a><a class="code" href="classsbuild_1_1chroot__config.html#f06b67d2134cd508c6ddf088668ae6e4">00280</a> <a class="code" href="classsbuild_1_1chroot__config.html#01055affcab815b87f527aed869b0ee1" title="A map between key-value string pairs.">string_map</a> <a class="code" href="classsbuild_1_1chroot__config.html#f06b67d2134cd508c6ddf088668ae6e4" title="A list of aliases (alias-&gt;name mapping).">aliases</a>;
149
<a name="l00281"></a>00281 };
150
<a name="l00282"></a>00282
151
<a name="l00283"></a>00283 }
158
152
<a name="l00284"></a>00284
159
<a name="l00285"></a>00285 }
153
<a name="l00285"></a>00285 <span class="preprocessor">#endif </span><span class="comment">/* SBUILD_CHROOT_CONFIG_H */</span>
160
154
<a name="l00286"></a>00286
161
<a name="l00287"></a>00287 <span class="preprocessor">#endif </span><span class="comment">/* SBUILD_CHROOT_CONFIG_H */</span>
162
<a name="l00288"></a>00288
163
<a name="l00289"></a>00289 <span class="comment">/*</span>
164
<a name="l00290"></a>00290 <span class="comment"> * Local Variables:</span>
165
<a name="l00291"></a>00291 <span class="comment"> * mode:C++</span>
166
<a name="l00292"></a>00292 <span class="comment"> * End:</span>
167
<a name="l00293"></a>00293 <span class="comment"> */</span>
168
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 8 21:23:22 2007 for sbuild by
155
<a name="l00287"></a>00287 <span class="comment">/*</span>
156
<a name="l00288"></a>00288 <span class="comment"> * Local Variables:</span>
157
<a name="l00289"></a>00289 <span class="comment"> * mode:C++</span>
158
<a name="l00290"></a>00290 <span class="comment"> * End:</span>
159
<a name="l00291"></a>00291 <span class="comment"> */</span>
160
</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Mon Jan 21 00:37:45 2008 for sbuild by
169
161
<a href="http://www.doxygen.org/index.html">
170
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
162
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.4 </small></address>