RegionsHierarchies add missed ctor for tests

This commit is contained in:
Pavel Kartavyy 2017-02-07 15:25:18 +03:00
parent 6d48eacbff
commit fb5ff00c4a
2 changed files with 7 additions and 2 deletions

View File

@ -25,6 +25,7 @@ public:
* то будет также загружен файл /opt/geo/regions_hierarchy_ua.txt, если такой есть - он будет доступен по ключу ua.
*/
RegionsHierarchies();
explicit RegionsHierarchies(const std::string & path_to_regions_hierarchy_file);
/// Has corresponding section in configuration file.
static bool isConfigured();

View File

@ -9,11 +9,15 @@ static constexpr auto config_key = "path_to_regions_hierarchy_file";
RegionsHierarchies::RegionsHierarchies()
: RegionsHierarchies(Poco::Util::Application::instance().config().getString(config_key))
{
}
RegionsHierarchies::RegionsHierarchies(const std::string & path)
{
Logger * log = &Logger::get("RegionsHierarchies");
std::string path = Poco::Util::Application::instance().config().getString(config_key);
LOG_DEBUG(log, "Adding default regions hierarchy from " << path);
data.emplace(std::piecewise_construct,