MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / initialize

Method initialize

src/common/config/dir_list.cpp:159–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void DirectoryList::initialize(bool simple_mode)
160{
161 if (mode != NotInitialized)
162 return;
163
164 clear();
165
166 PathName val = getConfigString();
167
168 if (simple_mode) {
169 mode = SimpleList;
170 }
171 else
172 {
173 if (keyword(None, val, "None", "") || keyword(Full, val, "Full", "")) {
174 return;
175 }
176 if (! keyword(Restrict, val, "Restrict", " \t"))
177 {
178 gds__log("DirectoryList: unknown parameter '%s', defaulting to None", val.c_str());
179 mode = None;
180 return;
181 }
182 }
183
184 PathName root = Config::getRootDirectory();
185
186 while (val.hasData())
187 {
188 string::size_type sep = val.find(';');
189 if (sep == string::npos)
190 sep = val.length();
191
192 PathName dir(val.c_str(), sep);
193 dir.alltrim(" \t\r");
194
195 val.erase(0, sep + 1);
196
197 if (PathUtils::isRelative(dir))
198 {
199 PathName fullPath;
200 PathUtils::concatPath(fullPath, root, dir);
201 dir = fullPath;
202 }
203
204 add(ParsedPath(dir));
205 }
206}
207
208bool DirectoryList::isPathInList(const PathName& path) const
209{

Callers

nothing calls this directly

Calls 10

ParsedPathClass · 0.85
alltrimMethod · 0.80
clearClass · 0.50
keywordFunction · 0.50
addFunction · 0.50
c_strMethod · 0.45
hasDataMethod · 0.45
findMethod · 0.45
lengthMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected