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:
authorAlex Zolotarev <alex@maps.me>2015-01-17 18:29:18 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:36:28 +0300
commit95a7a725f8c16728bbe2c3b2db3a464a89ef27e7 (patch)
treeca184016c3786b84fd4baa031f1ab38950c9c9ea /storage
parentebaa92ef65f3a7fc16584eee95928befdeca117b (diff)
[downloader] Fixed duplicate countries bug in Downloaded section.
Diffstat (limited to 'storage')
-rw-r--r--storage/storage.cpp8
-rw-r--r--storage/storage.hpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp
index e14dcfb4df..aee7f9f6d6 100644
--- a/storage/storage.cpp
+++ b/storage/storage.cpp
@@ -236,6 +236,14 @@ namespace storage
return CountryByIndex(index).GetFile().GetFileWithoutExt();
}
+ string Storage::MapWithoutExt(string mapFile)
+ {
+ string::size_type const pos = mapFile.rfind(DATA_FILE_EXTENSION);
+ if (pos != string::npos)
+ mapFile.resize(pos);
+ return std::move(mapFile);
+ }
+
LocalAndRemoteSizeT Storage::CountrySizeInBytes(TIndex const & index, TMapOptions opt) const
{
LocalAndRemoteSizeT sizes(0, 0);
diff --git a/storage/storage.hpp b/storage/storage.hpp
index 258faba238..de1a25566d 100644
--- a/storage/storage.hpp
+++ b/storage/storage.hpp
@@ -123,6 +123,8 @@ namespace storage
string CountryFileName(TIndex const & index, TMapOptions opt) const;
string const & CountryFileNameWithoutExt(TIndex const & index) const;
+ /// Removes map file extension.
+ static string MapWithoutExt(string mapFile);
LocalAndRemoteSizeT CountrySizeInBytes(TIndex const & index, TMapOptions opt) const;
/// Fast version, doesn't check if country is out of date