diff --git a/indexer/indexer_tests/features_offsets_table_test.cpp b/indexer/indexer_tests/features_offsets_table_test.cpp index 5fe762717a..5e4125cf94 100644 --- a/indexer/indexer_tests/features_offsets_table_test.cpp +++ b/indexer/indexer_tests/features_offsets_table_test.cpp @@ -93,8 +93,11 @@ namespace feature { string const testFileName = "test_file"; Platform & p = GetPlatform(); + platform::CountryFile country("minsk-pass"); + platform::LocalCountryFile localFile(p.WritableDir(), country, 0 /* version */); + localFile.SyncWithDisk(); FilesContainerR baseContainer(p.GetReader("minsk-pass" DATA_FILE_EXTENSION)); - const string indexFile = p.GetIndexFileName(testFileName, FEATURES_OFFSETS_TABLE_FILE_EXT); + const string indexFile = CountryIndexes::GetPath(localFile, CountryIndexes::Index::Offsets); feature::DataHeader header; header.Load(baseContainer.GetReader(HEADER_FILE_TAG)); diff --git a/platform/platform.cpp b/platform/platform.cpp index 194ba444ca..d9253df5d4 100644 --- a/platform/platform.cpp +++ b/platform/platform.cpp @@ -133,22 +133,6 @@ string Platform::DeviceName() const return OMIM_OS_NAME; } -string Platform::WritablePathForCountryIndexes(string const & mwmName) const -{ - string const dir = WritableDir() + mwmName + my::GetNativeSeparator(); - if (!IsFileExistsByFullPath(dir)) - { - if (MkDir(dir) != Platform::ERR_OK) - MYTHROW(Writer::CreateDirException, ("Can't create directory:", dir)); - } - return dir; -} - -string Platform::GetIndexFileName(string const & mwmName, string const & extension) const -{ - return GetPlatform().WritablePathForCountryIndexes(mwmName) + mwmName + extension; -} - void Platform::SetWritableDirForTests(string const & path) { m_writableDir = my::AddSlashIfNeeded(path); diff --git a/platform/platform.hpp b/platform/platform.hpp index f224a6b68d..95e1eb7587 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -91,11 +91,6 @@ public: void SetWritableDirForTests(string const & path); /// @return full path to file in user's writable directory string WritablePathForFile(string const & file) const { return WritableDir() + file; } - /// @return full path to indexes directory for country file. - /// Creates directory if it's not exists. Throw Writer::CreateDirException if can't create. - string WritablePathForCountryIndexes(string const & mwmName) const; - /// @return generate full path to index based on mwmName and index extension - string GetIndexFileName(string const & mwmName, string const & extension) const; /// @return resource dir (on some platforms it's differ from Writable dir) string ResourcesDir() const { return m_resourcesDir; }