| 201 | |
| 202 | |
| 203 | int 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 | |
| 246 | void Application::loadConfiguration(const std::string& path, int priority) |
nothing calls this directly
no test coverage detected