Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'platform/local_country_file_utils.cpp')
-rw-r--r--platform/local_country_file_utils.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp
index 6519274861..19bcc28718 100644
--- a/platform/local_country_file_utils.cpp
+++ b/platform/local_country_file_utils.cpp
@@ -239,9 +239,11 @@ ModelReader * GetCountryReader(platform::LocalCountryFile const & file, MapOptio
}
// static
-bool CountryIndexes::PreparePlaceOnDisk(LocalCountryFile const & localFile)
+void CountryIndexes::PreparePlaceOnDisk(LocalCountryFile const & localFile)
{
- return MkDirChecked(IndexesDir(localFile));
+ string const dir = IndexesDir(localFile);
+ if (!MkDirChecked(dir))
+ MYTHROW(FileSystemException, ("Can't create directory", dir));
}
// static
@@ -302,6 +304,8 @@ string CountryIndexes::IndexesDir(LocalCountryFile const & localFile)
string dir = localFile.GetDirectory();
CountryFile const & file = localFile.GetCountryFile();
+ /// @todo It's a temporary code until we will put fIndex->fOffset into mwm container.
+ /// IndexesDir should not throw any exceptions.
if (dir.empty())
{
// Local file is stored in resources. Need to prepare index folder in the writable directory.
@@ -309,7 +313,8 @@ string CountryIndexes::IndexesDir(LocalCountryFile const & localFile)
ASSERT_GREATER(version, 0, ());
dir = my::JoinFoldersToPath(GetPlatform().WritableDir(), strings::to_string(version));
- VERIFY(MkDirChecked(dir), ());
+ if (!MkDirChecked(dir))
+ MYTHROW(FileSystemException, ("Can't create directory", dir));
}
return my::JoinFoldersToPath(dir, file.GetNameWithoutExt());