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

Method initialize

src/jrd/IntlManager.cpp:417–598  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

415
416
417bool IntlManager::initialize()
418{
419 bool ok = true;
420 ObjectsArray<ConfigFile::String> conflicts;
421 string builtinConfig;
422
423 PathName intlPath = fb_utils::getPrefix(Firebird::IConfigManager::DIR_INTL, "");
424
425 ScanDir dir(intlPath.c_str(), "*.conf");
426
427 try
428 {
429 while (dir.next())
430 {
431 ConfigFile configFile(dir.getFilePath(), ConfigFile::HAS_SUB_CONF);
432
433 const ConfigFile::Parameter* builtinModule = configFile.findParameter(
434 "intl_module", "builtin");
435 string s = getConfigInfo(builtinModule);
436 if (s.hasData())
437 builtinConfig = s;
438
439 const ConfigFile::Parameters& params = configFile.getParameters();
440 for (FB_SIZE_T n = 0; n < params.getCount(); ++n)
441 {
442 const ConfigFile::Parameter* ch = &params[n];
443 if (ch->name != "charset")
444 {
445 continue;
446 }
447 if (!ch->sub)
448 {
449 continue;
450 }
451
452 const ConfigFile::String charSetName = ch->value;
453 PathName filename;
454 string configInfo;
455
456 const ConfigFile::Parameter* module = ch->sub->findParameter("intl_module");
457 const ConfigFile::Parameter* objModule;
458 if (module &&
459 (objModule = configFile.findParameter("intl_module", module->value.c_str())))
460 {
461 if (!objModule->sub)
462 {
463 fatal_exception::raiseFmt("Missing parameters for intl_module %s\n", module->value.c_str());
464 }
465
466 const ConfigFile::Parameter* fname = objModule->sub->findParameter("filename");
467 if (!fname)
468 {
469 fatal_exception::raiseFmt("Missing parameter 'filename' for intl_module %s\n", module->value.c_str());
470 }
471
472 filename = fname->value.ToPathName();
473 configInfo = getConfigInfo(objModule);
474

Callers

nothing calls this directly

Calls 15

getPrefixFunction · 0.85
iscLogStatusFunction · 0.85
iscLogExceptionFunction · 0.85
getFilePathMethod · 0.80
findParameterMethod · 0.80
ToPathNameMethod · 0.80
ltrimMethod · 0.80
c_strMethod · 0.45
nextMethod · 0.45
hasDataMethod · 0.45
getCountMethod · 0.45
existMethod · 0.45

Tested by

no test coverage detected