MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / loadConfiguration

Method loadConfiguration

base/poco/Util/src/Application.cpp:203–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201
202
203int Application::loadConfiguration(int priority)
204{
205 int n = 0;
206 Path appPath;
207 getApplicationPath(appPath);
208 Path confPath;
209 if (findAppConfigFile(appPath.getBaseName(), "properties", confPath))
210 {
211 _pConfig->add(new PropertyFileConfiguration(confPath.toString()), priority, false, false);
212 ++n;
213 }
214#ifndef POCO_UTIL_NO_INIFILECONFIGURATION
215 if (findAppConfigFile(appPath.getBaseName(), "ini", confPath))
216 {
217 _pConfig->add(new IniFileConfiguration(confPath.toString()), priority, false, false);
218 ++n;
219 }
220#endif
221#ifndef POCO_UTIL_NO_JSONCONFIGURATION
222 if (findAppConfigFile(appPath.getBaseName(), "json", confPath))
223 {
224 _pConfig->add(new JSONConfiguration(confPath.toString()), priority, false, false);
225 ++n;
226 }
227#endif
228#ifndef POCO_UTIL_NO_XMLCONFIGURATION
229 if (findAppConfigFile(appPath.getBaseName(), "xml", confPath))
230 {
231 _pConfig->add(new XMLConfiguration(confPath.toString()), priority, false, false);
232 ++n;
233 }
234#endif
235 if (n > 0)
236 {
237 if (!confPath.isAbsolute())
238 _pConfig->setString("application.configDir", confPath.absolute().parent().toString());
239 else
240 _pConfig->setString("application.configDir", confPath.parent().toString());
241 }
242 return n;
243}
244
245
246void Application::loadConfiguration(const std::string& path, int priority)

Callers

nothing calls this directly

Calls 10

isAbsoluteMethod · 0.80
absoluteMethod · 0.80
icompareFunction · 0.50
getBaseNameMethod · 0.45
addMethod · 0.45
toStringMethod · 0.45
setStringMethod · 0.45
parentMethod · 0.45
getExtensionMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected