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:
-rw-r--r--android/jni/com/mapswithme/country/ActiveCountryTree.cpp6
-rw-r--r--android/jni/com/mapswithme/country/CountryTree.cpp4
-rw-r--r--android/jni/com/mapswithme/maps/Framework.cpp4
-rw-r--r--android/jni/com/mapswithme/maps/MapStorage.cpp8
-rw-r--r--generator/routing_generator.cpp6
-rw-r--r--generator/update_generator.cpp8
-rw-r--r--indexer/features_offsets_table.cpp2
-rw-r--r--indexer/index.cpp2
-rw-r--r--iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm6
-rw-r--r--iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm2
-rw-r--r--iphone/Maps/Classes/LocalNotificationManager.mm2
-rw-r--r--iphone/Maps/Classes/MapCell.mm2
-rw-r--r--iphone/Maps/Classes/MapViewController.mm2
-rw-r--r--iphone/Maps/DownloaderParentVC.mm40
-rw-r--r--map/active_maps_layout.cpp12
-rw-r--r--map/country_status_display.cpp4
-rw-r--r--map/framework.cpp10
-rw-r--r--map/mwm_tests/mwm_foreach_test.cpp2
-rw-r--r--platform/country_defines.cpp8
-rw-r--r--platform/country_defines.hpp8
-rw-r--r--platform/country_file.cpp8
-rw-r--r--platform/local_country_file.cpp20
-rw-r--r--platform/local_country_file_utils.cpp4
-rw-r--r--platform/platform_tests/country_file_tests.cpp20
-rw-r--r--platform/platform_tests/local_country_file_tests.cpp78
-rw-r--r--qt/update_dialog.cpp12
-rw-r--r--routing/online_absent_fetcher.cpp2
-rw-r--r--routing/routing_mapping.cpp8
-rw-r--r--routing/routing_tests/routing_mapping_test.cpp10
-rw-r--r--search/integration_tests/smoke_test.cpp6
-rw-r--r--search/integration_tests/test_mwm_builder.cpp8
-rw-r--r--storage/country.cpp4
-rw-r--r--storage/queued_country.cpp10
-rw-r--r--storage/storage.cpp50
-rw-r--r--storage/storage_tests/queued_country_tests.cpp108
-rw-r--r--storage/storage_tests/storage_tests.cpp106
36 files changed, 296 insertions, 296 deletions
diff --git a/android/jni/com/mapswithme/country/ActiveCountryTree.cpp b/android/jni/com/mapswithme/country/ActiveCountryTree.cpp
index 420179efa0..b30bd93ad3 100644
--- a/android/jni/com/mapswithme/country/ActiveCountryTree.cpp
+++ b/android/jni/com/mapswithme/country/ActiveCountryTree.cpp
@@ -61,9 +61,9 @@ extern "C"
LocalAndRemoteSizeT sizes = layout.GetRemoteCountrySizes(coreGroup, pos);
switch (opt)
{
- case TMapOptions::EMap:
+ case TMapOptions::Map:
return sizes.first;
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
return sizes.second;
default:
return sizes.first + sizes.second;
@@ -143,4 +143,4 @@ extern "C"
{
GetMapLayout().DownloadMap(storage::ToNative(index), ToOptions(options));
}
-} \ No newline at end of file
+}
diff --git a/android/jni/com/mapswithme/country/CountryTree.cpp b/android/jni/com/mapswithme/country/CountryTree.cpp
index c3fba38de7..240c994430 100644
--- a/android/jni/com/mapswithme/country/CountryTree.cpp
+++ b/android/jni/com/mapswithme/country/CountryTree.cpp
@@ -113,9 +113,9 @@ extern "C"
LocalAndRemoteSizeT sizes = tree.GetRemoteLeafSizes(pos);
switch (opt)
{
- case TMapOptions::EMap:
+ case TMapOptions::Map:
return sizes.first;
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
return sizes.second;
default:
return sizes.first + sizes.second;
diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp
index 3c051f49f3..75b2b92f72 100644
--- a/android/jni/com/mapswithme/maps/Framework.cpp
+++ b/android/jni/com/mapswithme/maps/Framework.cpp
@@ -580,7 +580,7 @@ namespace android
}
try
{
- FilesContainerR cont(platform::GetCountryReader(localFile, TMapOptions::EMap));
+ FilesContainerR cont(platform::GetCountryReader(localFile, TMapOptions::Map));
if (!cont.IsExist(SEARCH_INDEX_FILE_TAG))
out.push_back(countryFile.GetNameWithoutExt());
}
@@ -1446,7 +1446,7 @@ extern "C"
JNIEXPORT void JNICALL
Java_com_mapswithme_maps_Framework_downloadCountry(JNIEnv * env, jobject thiz, jobject idx)
{
- storage_utils::GetMapLayout().DownloadMap(storage::ToNative(idx), TMapOptions::EMap);
+ storage_utils::GetMapLayout().DownloadMap(storage::ToNative(idx), TMapOptions::Map);
}
JNIEXPORT void JNICALL
diff --git a/android/jni/com/mapswithme/maps/MapStorage.cpp b/android/jni/com/mapswithme/maps/MapStorage.cpp
index 68bd67bdf6..85b5737aeb 100644
--- a/android/jni/com/mapswithme/maps/MapStorage.cpp
+++ b/android/jni/com/mapswithme/maps/MapStorage.cpp
@@ -79,13 +79,13 @@ extern "C"
LocalAndRemoteSizeT const sizes = layout.GetRemoteCountrySizes(ToNative(idx));
switch (storage_utils::ToOptions(options))
{
- case TMapOptions::EMap:
+ case TMapOptions::Map:
return sizes.first;
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
return sizes.second;
- case TMapOptions::EMapWithCarRouting:
+ case TMapOptions::MapWithCarRouting:
return sizes.first + sizes.second;
- case TMapOptions::ENothing:
+ case TMapOptions::Nothing:
return 0;
}
}
diff --git a/generator/routing_generator.cpp b/generator/routing_generator.cpp
index bcf5aeb0c2..f98b501f1c 100644
--- a/generator/routing_generator.cpp
+++ b/generator/routing_generator.cpp
@@ -243,7 +243,7 @@ void BuildRoutingIndex(string const & baseDir, string const & countryName, strin
osrm::NodeDataVectorT nodeData;
gen::OsmID2FeatureID osm2ft;
- if (!LoadIndexes(localFile.GetPath(TMapOptions::EMap), osrmFile, nodeData, osm2ft))
+ if (!LoadIndexes(localFile.GetPath(TMapOptions::Map), osrmFile, nodeData, osm2ft))
return;
OsrmFtSegMappingBuilder mapping;
@@ -390,13 +390,13 @@ void BuildRoutingIndex(string const & baseDir, string const & countryName, strin
"Multiple:", multiple, "Equal:", equal));
LOG(LINFO, ("Collect all data into one file..."));
- string const fPath = localFile.GetPath(TMapOptions::ECarRouting);
+ string const fPath = localFile.GetPath(TMapOptions::CarRouting);
FilesContainerW routingCont(fPath /*, FileWriter::OP_APPEND*/);
{
// Write version for routing file that is equal to correspondent mwm file.
- FilesContainerR mwmCont(localFile.GetPath(TMapOptions::EMap));
+ FilesContainerR mwmCont(localFile.GetPath(TMapOptions::Map));
FileWriter w = routingCont.GetWriter(VERSION_FILE_TAG);
ReaderSource<ModelReaderPtr> src(mwmCont.GetReader(VERSION_FILE_TAG));
diff --git a/generator/update_generator.cpp b/generator/update_generator.cpp
index e40aff3620..8811dc1cf5 100644
--- a/generator/update_generator.cpp
+++ b/generator/update_generator.cpp
@@ -49,7 +49,7 @@ namespace update
string const fName = cnt.GetNameWithExt(opt);
if (!GetPlatform().GetFileSizeByFullPath(m_dataDir + fName, sz))
{
- LOG(opt == TMapOptions::EMap ? LCRITICAL : LWARNING, ("File was not found:", fName));
+ LOG(opt == TMapOptions::Map ? LCRITICAL : LWARNING, ("File was not found:", fName));
return 0;
}
@@ -78,10 +78,10 @@ namespace update
++m_processedFiles;
- cnt.SetRemoteSizes(GetFileSize(cnt, TMapOptions::EMap),
- GetFileSize(cnt, TMapOptions::ECarRouting));
+ cnt.SetRemoteSizes(GetFileSize(cnt, TMapOptions::Map),
+ GetFileSize(cnt, TMapOptions::CarRouting));
- string const fName = cnt.GetNameWithExt(TMapOptions::EMap);
+ string const fName = cnt.GetNameWithExt(TMapOptions::Map);
auto found = find(m_files.begin(), m_files.end(), fName);
if (found != m_files.end())
m_files.erase(found);
diff --git a/indexer/features_offsets_table.cpp b/indexer/features_offsets_table.cpp
index f06c4d75d7..3beaa3a184 100644
--- a/indexer/features_offsets_table.cpp
+++ b/indexer/features_offsets_table.cpp
@@ -76,7 +76,7 @@ namespace feature
VERIFY(CountryIndexes::PreparePlaceOnDisk(localFile), ());
- FilesContainerR cont(localFile.GetPath(TMapOptions::EMap));
+ FilesContainerR cont(localFile.GetPath(TMapOptions::Map));
Builder builder;
FeaturesVector::ForEachOffset(cont.GetReader(DATA_FILE_TAG), [&builder] (uint32_t offset)
diff --git a/indexer/index.cpp b/indexer/index.cpp
index 3425b8699c..3a5351f77d 100644
--- a/indexer/index.cpp
+++ b/indexer/index.cpp
@@ -15,7 +15,7 @@ using platform::LocalCountryFile;
//////////////////////////////////////////////////////////////////////////////////
MwmValue::MwmValue(LocalCountryFile const & localFile)
- : m_cont(platform::GetCountryReader(localFile, TMapOptions::EMap)),
+ : m_cont(platform::GetCountryReader(localFile, TMapOptions::Map)),
m_countryFile(localFile.GetCountryFile()),
m_table(0)
{
diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
index 0edbfefee5..62295bb548 100644
--- a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
+++ b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
@@ -39,7 +39,7 @@
for (auto const & i : indexes)
{
[titles addObject:[NSString stringWithUTF8String:a.GetCountryName(i).c_str()]];
- totalRoutingSize += a.GetCountrySize(i, isMaps ? TMapOptions::EMapWithCarRouting : TMapOptions::ECarRouting).second;
+ totalRoutingSize += a.GetCountrySize(i, isMaps ? TMapOptions::MapWithCarRouting : TMapOptions::CarRouting).second;
}
self.isMapsFiles = isMaps;
self.titles = titles;
@@ -130,9 +130,9 @@ static CGFloat const kMinimumOffset = 20.;
__strong MWMDownloadTransitMapAlert * alert = wAlert;
auto & a = GetFramework().GetCountryTree().GetActiveMapLayout();
for (auto const & index : alert->maps)
- a.DownloadMap(index, TMapOptions::EMapWithCarRouting);
+ a.DownloadMap(index, TMapOptions::MapWithCarRouting);
for (auto const & index : alert->routes)
- a.DownloadMap(index, TMapOptions::ECarRouting);
+ a.DownloadMap(index, TMapOptions::CarRouting);
};
[alert configure];
return alert;
diff --git a/iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm b/iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm
index 7325379418..6eb767cee8 100644
--- a/iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm
+++ b/iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm
@@ -121,7 +121,7 @@
- (IBAction)downloadMapTouchUpInside:(nonnull UIButton *)sender
{
- auto const mapType = self.downloadRoutesButton.selected ? TMapOptions::EMapWithCarRouting : TMapOptions::EMap;
+ auto const mapType = self.downloadRoutesButton.selected ? TMapOptions::MapWithCarRouting : TMapOptions::Map;
GetFramework().GetCountryTree().GetActiveMapLayout().DownloadMap(self.currentCountryIndex, mapType);
[self showRequest];
}
diff --git a/iphone/Maps/Classes/LocalNotificationManager.mm b/iphone/Maps/Classes/LocalNotificationManager.mm
index 3e86d9d620..9486ccdb91 100644
--- a/iphone/Maps/Classes/LocalNotificationManager.mm
+++ b/iphone/Maps/Classes/LocalNotificationManager.mm
@@ -280,7 +280,7 @@ typedef void (^CompletionHandler)(UIBackgroundFetchResult);
/// Call download via Framework.
Framework & f = GetFramework();
- f.GetCountryTree().GetActiveMapLayout().DownloadMap(index, TMapOptions::EMap);
+ f.GetCountryTree().GetActiveMapLayout().DownloadMap(index, TMapOptions::Map);
m2::RectD const rect = f.GetCountryBounds(index);
double const lon = MercatorBounds::XToLon(rect.Center().x);
double const lat = MercatorBounds::YToLat(rect.Center().y);
diff --git a/iphone/Maps/Classes/MapCell.mm b/iphone/Maps/Classes/MapCell.mm
index 5c33e11396..bb52a30565 100644
--- a/iphone/Maps/Classes/MapCell.mm
+++ b/iphone/Maps/Classes/MapCell.mm
@@ -43,7 +43,7 @@
self.progressView.failedMode = NO;
- if (options == TMapOptions::EMap)
+ if (options == TMapOptions::Map)
self.routingImageView.image = [UIImage imageNamed:@"DownloadRoutingButton"];
else
self.routingImageView.image = [UIImage imageNamed:@"RoutingDownloadedButton"];
diff --git a/iphone/Maps/Classes/MapViewController.mm b/iphone/Maps/Classes/MapViewController.mm
index 8b53200a91..041de24a78 100644
--- a/iphone/Maps/Classes/MapViewController.mm
+++ b/iphone/Maps/Classes/MapViewController.mm
@@ -691,7 +691,7 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView)
LocalAndRemoteSizeT sizes = layout.GetRemoteCountrySizes(idx);
uint64_t sizeToDownload = sizes.first;
TMapOptions options = static_cast<TMapOptions>(opt);
- if(HasOptions(options, TMapOptions::ECarRouting))
+ if(HasOptions(options, TMapOptions::CarRouting))
sizeToDownload += sizes.second;
NSString * name = [NSString stringWithUTF8String:layout.GetCountryName(idx).c_str()];
diff --git a/iphone/Maps/DownloaderParentVC.mm b/iphone/Maps/DownloaderParentVC.mm
index 387fce3ae7..f2480e47c1 100644
--- a/iphone/Maps/DownloaderParentVC.mm
+++ b/iphone/Maps/DownloaderParentVC.mm
@@ -30,22 +30,22 @@
{
if (buttonIndex != alertView.cancelButtonIndex)
{
- if (self.selectedInActionSheetOptions == TMapOptions::EMap)
+ if (self.selectedInActionSheetOptions == TMapOptions::Map)
[self performAction:DownloaderActionDownloadMap withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::ECarRouting)
+ else if (self.selectedInActionSheetOptions == TMapOptions::CarRouting)
[self performAction:DownloaderActionDownloadCarRouting withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::EMapWithCarRouting)
+ else if (self.selectedInActionSheetOptions == TMapOptions::MapWithCarRouting)
[self performAction:DownloaderActionDownloadAll withSizeCheck:NO];
}
}
- (void)download
{
- if (self.selectedInActionSheetOptions == TMapOptions::EMap)
+ if (self.selectedInActionSheetOptions == TMapOptions::Map)
[self performAction:DownloaderActionDownloadMap withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::ECarRouting)
+ else if (self.selectedInActionSheetOptions == TMapOptions::CarRouting)
[self performAction:DownloaderActionDownloadCarRouting withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::EMapWithCarRouting)
+ else if (self.selectedInActionSheetOptions == TMapOptions::MapWithCarRouting)
[self performAction:DownloaderActionDownloadAll withSizeCheck:NO];
}
@@ -56,7 +56,7 @@
- (NSString *)selectedMapName { return nil; }
- (uint64_t)selectedMapSizeWithOptions:(TMapOptions)options { return 0; }
- (TStatus)selectedMapStatus { return TStatus::EUnknown; }
-- (TMapOptions)selectedMapOptions { return TMapOptions::EMap; }
+- (TMapOptions)selectedMapOptions { return TMapOptions::Map; }
#pragma mark - Virtual table view methods
@@ -97,38 +97,38 @@
if (status == TStatus::ENotDownloaded || status == TStatus::EOutOfMemFailed || status == TStatus::EDownloadFailed)
{
- NSString * fullSize = formattedSize([self selectedMapSizeWithOptions:TMapOptions::EMapWithCarRouting]);
- NSString * onlyMapSize = formattedSize([self selectedMapSizeWithOptions:TMapOptions::EMap]);
+ NSString * fullSize = formattedSize([self selectedMapSizeWithOptions:TMapOptions::MapWithCarRouting]);
+ NSString * onlyMapSize = formattedSize([self selectedMapSizeWithOptions:TMapOptions::Map]);
[self addButtonWithTitle:[NSString stringWithFormat:@"%@, %@", L(@"downloader_download_map"), fullSize] action:DownloaderActionDownloadAll toActionSheet:actionSheet];
[self addButtonWithTitle:[NSString stringWithFormat:@"%@, %@", L(@"downloader_download_map_no_routing"), onlyMapSize] action:DownloaderActionDownloadMap toActionSheet:actionSheet];
}
- if (status == TStatus::EOnDiskOutOfDate && options == TMapOptions::EMapWithCarRouting)
+ if (status == TStatus::EOnDiskOutOfDate && options == TMapOptions::MapWithCarRouting)
{
- NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::EMapWithCarRouting]);
+ NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::MapWithCarRouting]);
[self addButtonWithTitle:[NSString stringWithFormat:@"%@, %@", L(@"downloader_update_map_and_routing"), size] action:DownloaderActionDownloadAll toActionSheet:actionSheet];
}
- if (status == TStatus::EOnDisk && options == TMapOptions::EMap)
+ if (status == TStatus::EOnDisk && options == TMapOptions::Map)
{
- NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::ECarRouting]);
+ NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::CarRouting]);
NSString * title = [NSString stringWithFormat:@"%@, %@", L(@"downloader_download_routing"), size];
[self addButtonWithTitle:title action:DownloaderActionDownloadCarRouting toActionSheet:actionSheet];
}
- if (status == TStatus::EOnDiskOutOfDate && options == TMapOptions::EMap)
+ if (status == TStatus::EOnDiskOutOfDate && options == TMapOptions::Map)
{
- NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::EMap]);
+ NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::Map]);
NSString * title = [NSString stringWithFormat:@"%@, %@", L(@"downloader_update_map"), size];
[self addButtonWithTitle:title action:DownloaderActionDownloadMap toActionSheet:actionSheet];
- size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::EMapWithCarRouting]);
+ size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::MapWithCarRouting]);
title = [NSString stringWithFormat:@"%@, %@", L(@"downloader_update_map_and_routing"), size];
[self addButtonWithTitle:title action:DownloaderActionDownloadAll toActionSheet:actionSheet];
}
if (status == TStatus::EOnDisk || status == TStatus::EOnDiskOutOfDate)
{
- if (options == TMapOptions::EMapWithCarRouting)
+ if (options == TMapOptions::MapWithCarRouting)
[self addButtonWithTitle:L(@"downloader_delete_routing") action:DownloaderActionDeleteCarRouting toActionSheet:actionSheet];
[self addButtonWithTitle:L(@"downloader_delete_map") action:DownloaderActionDeleteMap toActionSheet:actionSheet];
@@ -183,17 +183,17 @@
{
case DownloaderActionDownloadAll:
case DownloaderActionDeleteAll:
- self.selectedInActionSheetOptions = TMapOptions::EMapWithCarRouting;
+ self.selectedInActionSheetOptions = TMapOptions::MapWithCarRouting;
break;
case DownloaderActionDownloadMap:
case DownloaderActionDeleteMap:
- self.selectedInActionSheetOptions = TMapOptions::EMap;
+ self.selectedInActionSheetOptions = TMapOptions::Map;
break;
case DownloaderActionDownloadCarRouting:
case DownloaderActionDeleteCarRouting:
- self.selectedInActionSheetOptions = TMapOptions::ECarRouting;
+ self.selectedInActionSheetOptions = TMapOptions::CarRouting;
break;
default:
diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp
index 5a02f6cf5b..83618bdc48 100644
--- a/map/active_maps_layout.cpp
+++ b/map/active_maps_layout.cpp
@@ -240,8 +240,8 @@ LocalAndRemoteSizeT const ActiveMapsLayout::GetRemoteCountrySizes(TGroup const &
LocalAndRemoteSizeT const ActiveMapsLayout::GetRemoteCountrySizes(TIndex const & index) const
{
platform::CountryFile const & c = GetStorage().CountryByIndex(index).GetFile();
- size_t const mapSize = c.GetRemoteSize(TMapOptions::EMap);
- return { mapSize, c.GetRemoteSize(TMapOptions::ECarRouting) };
+ size_t const mapSize = c.GetRemoteSize(TMapOptions::Map);
+ return { mapSize, c.GetRemoteSize(TMapOptions::CarRouting) };
}
int ActiveMapsLayout::AddListener(ActiveMapsListener * listener)
@@ -378,7 +378,7 @@ Storage & ActiveMapsLayout::GetStorage()
void ActiveMapsLayout::StatusChangedCallback(TIndex const & index)
{
TStatus newStatus = TStatus::EUnknown;
- TMapOptions options = TMapOptions::EMap;
+ TMapOptions options = TMapOptions::Map;
GetStorage().CountryStatusEx(index, newStatus, options);
TGroup group = TGroup::ENewMap;
@@ -662,13 +662,13 @@ void ActiveMapsLayout::NotifyOptionsChanged(TGroup const & group, int position,
TMapOptions ActiveMapsLayout::ValidOptionsForDownload(TMapOptions const & options)
{
- return SetOptions(options, TMapOptions::EMap);
+ return SetOptions(options, TMapOptions::Map);
}
TMapOptions ActiveMapsLayout::ValidOptionsForDelete(TMapOptions const & options)
{
- if (HasOptions(options, TMapOptions::EMap))
- return SetOptions(options, TMapOptions::ECarRouting);
+ if (HasOptions(options, TMapOptions::Map))
+ return SetOptions(options, TMapOptions::CarRouting);
return options;
}
diff --git a/map/country_status_display.cpp b/map/country_status_display.cpp
index 47f7418a92..086d4bcb95 100644
--- a/map/country_status_display.cpp
+++ b/map/country_status_display.cpp
@@ -454,9 +454,9 @@ void CountryStatusDisplay::OnButtonClicked(gui::Element const * button)
{
ASSERT(m_countryIdx.IsValid(), ());
- TMapOptions options = TMapOptions::EMap;
+ TMapOptions options = TMapOptions::Map;
if (button == m_primaryButton.get())
- options = SetOptions(options, TMapOptions::ECarRouting);
+ options = SetOptions(options, TMapOptions::CarRouting);
ASSERT(m_downloadCallback, ());
int opt = static_cast<int>(options);
diff --git a/map/framework.cpp b/map/framework.cpp
index 6b46706eb1..e6cb2cdd36 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -359,10 +359,10 @@ void Framework::DeleteCountry(storage::TIndex const & index, TMapOptions opt)
{
switch (opt)
{
- case TMapOptions::ENothing:
+ case TMapOptions::Nothing:
return;
- case TMapOptions::EMap: // fall through
- case TMapOptions::EMapWithCarRouting:
+ case TMapOptions::Map: // fall through
+ case TMapOptions::MapWithCarRouting:
{
CountryFile const & countryFile = m_storage.GetCountryFile(index);
// m_model will notify us when latest map file will be deleted via
@@ -376,7 +376,7 @@ void Framework::DeleteCountry(storage::TIndex const & index, TMapOptions opt)
m_routingSession.Reset();
return;
}
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
m_routingSession.Reset();
m_storage.DeleteCountry(index, opt);
return;
@@ -426,7 +426,7 @@ void Framework::UpdateLatestCountryFile(LocalCountryFile const & localFile)
// it won' be needed to reset it after maps update.
m_routingSession.Reset();
- if (!HasOptions(localFile.GetFiles(), TMapOptions::EMap))
+ if (!HasOptions(localFile.GetFiles(), TMapOptions::Map))
return;
// Add downloaded map.
diff --git a/map/mwm_tests/mwm_foreach_test.cpp b/map/mwm_tests/mwm_foreach_test.cpp
index 72cc83ba85..b3ed7ab0b5 100644
--- a/map/mwm_tests/mwm_foreach_test.cpp
+++ b/map/mwm_tests/mwm_foreach_test.cpp
@@ -258,7 +258,7 @@ void RunTest(string const & countryFileName)
vector<m2::RectD> rects;
rects.push_back(src1.GetWorldRect());
- ModelReaderPtr reader = platform::GetCountryReader(localFile, TMapOptions::EMap);
+ ModelReaderPtr reader = platform::GetCountryReader(localFile, TMapOptions::Map);
while (!rects.empty())
{
diff --git a/platform/country_defines.cpp b/platform/country_defines.cpp
index 8ee9691ae5..05605e7ee0 100644
--- a/platform/country_defines.cpp
+++ b/platform/country_defines.cpp
@@ -32,13 +32,13 @@ string DebugPrint(TMapOptions options)
{
switch (options)
{
- case TMapOptions::ENothing:
+ case TMapOptions::Nothing:
return "Nothing";
- case TMapOptions::EMap:
+ case TMapOptions::Map:
return "MapOnly";
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
return "CarRouting";
- case TMapOptions::EMapWithCarRouting:
+ case TMapOptions::MapWithCarRouting:
return "MapWithCarRouting";
}
}
diff --git a/platform/country_defines.hpp b/platform/country_defines.hpp
index 1273b8e04c..7ba1428fa8 100644
--- a/platform/country_defines.hpp
+++ b/platform/country_defines.hpp
@@ -4,10 +4,10 @@
enum class TMapOptions : uint8_t
{
- ENothing = 0x0,
- EMap = 0x1,
- ECarRouting = 0x2,
- EMapWithCarRouting = 0x3
+ Nothing = 0x0,
+ Map = 0x1,
+ CarRouting = 0x2,
+ MapWithCarRouting = 0x3
};
bool HasOptions(TMapOptions mask, TMapOptions options);
diff --git a/platform/country_file.cpp b/platform/country_file.cpp
index b7f4210e8b..c030f4759c 100644
--- a/platform/country_file.cpp
+++ b/platform/country_file.cpp
@@ -16,9 +16,9 @@ string CountryFile::GetNameWithExt(TMapOptions file) const
{
switch (file)
{
- case TMapOptions::EMap:
+ case TMapOptions::Map:
return m_name + DATA_FILE_EXTENSION;
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
return m_name + DATA_FILE_EXTENSION + ROUTING_FILE_EXTENSION;
default:
ASSERT(false, ("Can't get name for:", file));
@@ -35,9 +35,9 @@ void CountryFile::SetRemoteSizes(uint32_t mapSize, uint32_t routingSize)
uint32_t CountryFile::GetRemoteSize(TMapOptions filesMask) const
{
uint32_t size = 0;
- if (HasOptions(filesMask, TMapOptions::EMap))
+ if (HasOptions(filesMask, TMapOptions::Map))
size += m_mapSize;
- if (HasOptions(filesMask, TMapOptions::ECarRouting))
+ if (HasOptions(filesMask, TMapOptions::CarRouting))
size += m_routingSize;
return size;
}
diff --git a/platform/local_country_file.cpp b/platform/local_country_file.cpp
index 3b700b9a7a..da171ebaf8 100644
--- a/platform/local_country_file.cpp
+++ b/platform/local_country_file.cpp
@@ -12,7 +12,7 @@
namespace platform
{
LocalCountryFile::LocalCountryFile()
- : m_version(0), m_files(TMapOptions::ENothing), m_mapSize(0), m_routingSize()
+ : m_version(0), m_files(TMapOptions::Nothing), m_mapSize(0), m_routingSize()
{
}
@@ -21,7 +21,7 @@ LocalCountryFile::LocalCountryFile(string const & directory, CountryFile const &
: m_directory(directory),
m_countryFile(countryFile),
m_version(version),
- m_files(TMapOptions::ENothing),
+ m_files(TMapOptions::Nothing),
m_mapSize(0),
m_routingSize(0)
{
@@ -29,23 +29,23 @@ LocalCountryFile::LocalCountryFile(string const & directory, CountryFile const &
void LocalCountryFile::SyncWithDisk()
{
- m_files = TMapOptions::ENothing;
+ m_files = TMapOptions::Nothing;
m_mapSize = 0;
m_routingSize = 0;
Platform & platform = GetPlatform();
- if (platform.GetFileSizeByFullPath(GetPath(TMapOptions::EMap), m_mapSize))
- m_files = SetOptions(m_files, TMapOptions::EMap);
+ if (platform.GetFileSizeByFullPath(GetPath(TMapOptions::Map), m_mapSize))
+ m_files = SetOptions(m_files, TMapOptions::Map);
- string const routingPath = GetPath(TMapOptions::ECarRouting);
+ string const routingPath = GetPath(TMapOptions::CarRouting);
if (platform.GetFileSizeByFullPath(routingPath, m_routingSize))
- m_files = SetOptions(m_files, TMapOptions::ECarRouting);
+ m_files = SetOptions(m_files, TMapOptions::CarRouting);
}
void LocalCountryFile::DeleteFromDisk(TMapOptions files) const
{
- for (TMapOptions file : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
{
if (OnDisk(file) && HasOptions(files, file))
{
@@ -63,9 +63,9 @@ string LocalCountryFile::GetPath(TMapOptions file) const
uint32_t LocalCountryFile::GetSize(TMapOptions filesMask) const
{
uint64_t size64 = 0;
- if (HasOptions(filesMask, TMapOptions::EMap))
+ if (HasOptions(filesMask, TMapOptions::Map))
size64 += m_mapSize;
- if (HasOptions(filesMask, TMapOptions::ECarRouting))
+ if (HasOptions(filesMask, TMapOptions::CarRouting))
size64 += m_routingSize;
uint32_t const size32 = static_cast<uint32_t>(size64);
ASSERT_EQUAL(size32, size64, ());
diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp
index cdb7530392..2f9bf2fdf4 100644
--- a/platform/local_country_file_utils.cpp
+++ b/platform/local_country_file_utils.cpp
@@ -96,7 +96,7 @@ void CleanupMapsDirectory()
if (countryName == "Japan" || countryName == "Brazil")
{
localFile.SyncWithDisk();
- localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting);
+ localFile.DeleteFromDisk(TMapOptions::MapWithCarRouting);
}
}
}
@@ -176,7 +176,7 @@ void FindAllLocalMaps(vector<LocalCountryFile> & localFiles)
// Assume that empty path means the resource file.
LocalCountryFile worldFile(string(), CountryFile(file), 0 /* version */);
- worldFile.m_files = TMapOptions::EMap;
+ worldFile.m_files = TMapOptions::Map;
if (i != localFiles.end())
{
// Always use resource World files instead of local on disk.
diff --git a/platform/platform_tests/country_file_tests.cpp b/platform/platform_tests/country_file_tests.cpp
index 136aceede6..e12d8d5298 100644
--- a/platform/platform_tests/country_file_tests.cpp
+++ b/platform/platform_tests/country_file_tests.cpp
@@ -9,20 +9,20 @@ UNIT_TEST(CountryFile_Smoke)
{
CountryFile countryFile("TestCountry");
TEST_EQUAL("TestCountry", countryFile.GetNameWithoutExt(), ());
- TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION, countryFile.GetNameWithExt(TMapOptions::EMap), ());
+ TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION, countryFile.GetNameWithExt(TMapOptions::Map), ());
TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION,
- countryFile.GetNameWithExt(TMapOptions::ECarRouting), ());
+ countryFile.GetNameWithExt(TMapOptions::CarRouting), ());
- TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::ENothing), ());
- TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::EMap), ());
- TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::ECarRouting), ());
- TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::EMapWithCarRouting), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::Nothing), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::Map), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::CarRouting), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::MapWithCarRouting), ());
countryFile.SetRemoteSizes(1 /* mapSize */, 2 /* routingSize */);
- TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::ENothing), ());
- TEST_EQUAL(1, countryFile.GetRemoteSize(TMapOptions::EMap), ());
- TEST_EQUAL(2, countryFile.GetRemoteSize(TMapOptions::ECarRouting), ());
- TEST_EQUAL(3, countryFile.GetRemoteSize(TMapOptions::EMapWithCarRouting), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(TMapOptions::Nothing), ());
+ TEST_EQUAL(1, countryFile.GetRemoteSize(TMapOptions::Map), ());
+ TEST_EQUAL(2, countryFile.GetRemoteSize(TMapOptions::CarRouting), ());
+ TEST_EQUAL(3, countryFile.GetRemoteSize(TMapOptions::MapWithCarRouting), ());
}
} // namespace platform
diff --git a/platform/platform_tests/local_country_file_tests.cpp b/platform/platform_tests/local_country_file_tests.cpp
index 945ad96fde..148fb03a02 100644
--- a/platform/platform_tests/local_country_file_tests.cpp
+++ b/platform/platform_tests/local_country_file_tests.cpp
@@ -68,26 +68,26 @@ UNIT_TEST(LocalCountryFile_Smoke)
LocalCountryFile localFile("/test-dir", countryFile, 150309);
- TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION, localFile.GetPath(TMapOptions::EMap), ());
+ TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION, localFile.GetPath(TMapOptions::Map), ());
TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION,
- localFile.GetPath(TMapOptions::ECarRouting), ());
+ localFile.GetPath(TMapOptions::CarRouting), ());
// Not synced with disk yet.
- TEST_EQUAL(TMapOptions::ENothing, localFile.GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Nothing, localFile.GetFiles(), ());
// Any statement is true about elements of an empty set.
- TEST(localFile.OnDisk(TMapOptions::ENothing), ());
+ TEST(localFile.OnDisk(TMapOptions::Nothing), ());
- TEST(!localFile.OnDisk(TMapOptions::EMap), ());
- TEST(!localFile.OnDisk(TMapOptions::ECarRouting), ());
- TEST(!localFile.OnDisk(TMapOptions::EMapWithCarRouting), ());
+ TEST(!localFile.OnDisk(TMapOptions::Map), ());
+ TEST(!localFile.OnDisk(TMapOptions::CarRouting), ());
+ TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
TEST_EQUAL("/test-dir", localFile.GetDirectory(), ());
- TEST_EQUAL(0, localFile.GetSize(TMapOptions::ENothing), ());
- TEST_EQUAL(0, localFile.GetSize(TMapOptions::EMap), ());
- TEST_EQUAL(0, localFile.GetSize(TMapOptions::ECarRouting), ());
- TEST_EQUAL(0, localFile.GetSize(TMapOptions::EMapWithCarRouting), ());
+ TEST_EQUAL(0, localFile.GetSize(TMapOptions::Nothing), ());
+ TEST_EQUAL(0, localFile.GetSize(TMapOptions::Map), ());
+ TEST_EQUAL(0, localFile.GetSize(TMapOptions::CarRouting), ());
+ TEST_EQUAL(0, localFile.GetSize(TMapOptions::MapWithCarRouting), ());
TEST_EQUAL(150309, localFile.GetVersion(), ());
}
@@ -102,29 +102,29 @@ UNIT_TEST(LocalCountryFile_DiskFiles)
countryFile.SetRemoteSizes(1 /* mapSize */, 2 /* routingSize */);
LocalCountryFile localFile(platform.WritableDir(), countryFile, 0 /* version */);
- TEST(!localFile.OnDisk(TMapOptions::EMap), ());
- TEST(!localFile.OnDisk(TMapOptions::ECarRouting), ());
- TEST(!localFile.OnDisk(TMapOptions::EMapWithCarRouting), ());
+ TEST(!localFile.OnDisk(TMapOptions::Map), ());
+ TEST(!localFile.OnDisk(TMapOptions::CarRouting), ());
+ TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
- ScopedFile testMapFile(countryFile.GetNameWithExt(TMapOptions::EMap), "map");
+ ScopedFile testMapFile(countryFile.GetNameWithExt(TMapOptions::Map), "map");
localFile.SyncWithDisk();
- TEST(localFile.OnDisk(TMapOptions::EMap), ());
- TEST(!localFile.OnDisk(TMapOptions::ECarRouting), ());
- TEST(!localFile.OnDisk(TMapOptions::EMapWithCarRouting), ());
- TEST_EQUAL(3, localFile.GetSize(TMapOptions::EMap), ());
+ TEST(localFile.OnDisk(TMapOptions::Map), ());
+ TEST(!localFile.OnDisk(TMapOptions::CarRouting), ());
+ TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
+ TEST_EQUAL(3, localFile.GetSize(TMapOptions::Map), ());
- ScopedFile testRoutingFile(countryFile.GetNameWithExt(TMapOptions::ECarRouting), "routing");
+ ScopedFile testRoutingFile(countryFile.GetNameWithExt(TMapOptions::CarRouting), "routing");
localFile.SyncWithDisk();
- TEST(localFile.OnDisk(TMapOptions::EMap), ());
- TEST(localFile.OnDisk(TMapOptions::ECarRouting), ());
- TEST(localFile.OnDisk(TMapOptions::EMapWithCarRouting), ());
- TEST_EQUAL(3, localFile.GetSize(TMapOptions::EMap), ());
- TEST_EQUAL(7, localFile.GetSize(TMapOptions::ECarRouting), ());
- TEST_EQUAL(10, localFile.GetSize(TMapOptions::EMapWithCarRouting), ());
-
- localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting);
+ TEST(localFile.OnDisk(TMapOptions::Map), ());
+ TEST(localFile.OnDisk(TMapOptions::CarRouting), ());
+ TEST(localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
+ TEST_EQUAL(3, localFile.GetSize(TMapOptions::Map), ());
+ TEST_EQUAL(7, localFile.GetSize(TMapOptions::CarRouting), ());
+ TEST_EQUAL(10, localFile.GetSize(TMapOptions::MapWithCarRouting), ());
+
+ localFile.DeleteFromDisk(TMapOptions::MapWithCarRouting);
TEST(!testMapFile.Exists(), (testMapFile, "wasn't deleted by LocalCountryFile."));
testMapFile.Reset();
@@ -162,18 +162,18 @@ UNIT_TEST(LocalCountryFile_CleanupMapFiles)
CleanupMapsDirectory();
japanLocalFile.SyncWithDisk();
- TEST_EQUAL(TMapOptions::ENothing, japanLocalFile.GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Nothing, japanLocalFile.GetFiles(), ());
TEST(!japanMapFile.Exists(), (japanMapFile));
japanMapFile.Reset();
brazilLocalFile.SyncWithDisk();
- TEST_EQUAL(TMapOptions::ENothing, brazilLocalFile.GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Nothing, brazilLocalFile.GetFiles(), ());
TEST(!brazilMapFile.Exists(), (brazilMapFile));
brazilMapFile.Reset();
irelandLocalFile.SyncWithDisk();
- TEST_EQUAL(TMapOptions::EMap, irelandLocalFile.GetFiles(), ());
- irelandLocalFile.DeleteFromDisk(TMapOptions::EMap);
+ TEST_EQUAL(TMapOptions::Map, irelandLocalFile.GetFiles(), ());
+ irelandLocalFile.DeleteFromDisk(TMapOptions::Map);
TEST(!irelandMapFile.Exists(), (irelandMapFile));
irelandMapFile.Reset();
@@ -216,9 +216,9 @@ UNIT_TEST(LocalCountryFile_DirectoryLookup)
ScopedDir testDir("test-dir");
- ScopedFile testIrelandMapFile(testDir, irelandFile, TMapOptions::EMap, "Ireland-map");
- ScopedFile testNetherlandsMapFile(testDir, netherlandsFile, TMapOptions::EMap, "Netherlands-map");
- ScopedFile testNetherlandsRoutingFile(testDir, netherlandsFile, TMapOptions::ECarRouting,
+ ScopedFile testIrelandMapFile(testDir, irelandFile, TMapOptions::Map, "Ireland-map");
+ ScopedFile testNetherlandsMapFile(testDir, netherlandsFile, TMapOptions::Map, "Netherlands-map");
+ ScopedFile testNetherlandsRoutingFile(testDir, netherlandsFile, TMapOptions::CarRouting,
"Netherlands-routing");
vector<LocalCountryFile> localFiles;
@@ -228,10 +228,10 @@ UNIT_TEST(LocalCountryFile_DirectoryLookup)
localFile.SyncWithDisk();
LocalCountryFile expectedIrelandFile(testDir.GetFullPath(), irelandFile, 150309);
- expectedIrelandFile.m_files = TMapOptions::EMap;
+ expectedIrelandFile.m_files = TMapOptions::Map;
LocalCountryFile expectedNetherlandsFile(testDir.GetFullPath(), netherlandsFile, 150309);
- expectedNetherlandsFile.m_files = TMapOptions::EMapWithCarRouting;
+ expectedNetherlandsFile.m_files = TMapOptions::MapWithCarRouting;
vector<LocalCountryFile> expectedLocalFiles = {expectedIrelandFile, expectedNetherlandsFile};
sort(expectedLocalFiles.begin(), expectedLocalFiles.end());
@@ -247,7 +247,7 @@ UNIT_TEST(LocalCountryFile_AllLocalFilesLookup)
CountryFile const italyFile("Italy");
ScopedDir testDir("010101");
- ScopedFile testItalyMapFile(testDir, italyFile, TMapOptions::EMap, "Italy-map");
+ ScopedFile testItalyMapFile(testDir, italyFile, TMapOptions::Map, "Italy-map");
vector<LocalCountryFile> localFiles;
FindAllLocalMaps(localFiles);
@@ -365,7 +365,7 @@ UNIT_TEST(LocalCountryFile_MakeTemporary)
{
string const path = GetPlatform().WritablePathForFile("minsk-pass" DATA_FILE_EXTENSION);
LocalCountryFile file = LocalCountryFile::MakeTemporary(path);
- TEST_EQUAL(file.GetPath(TMapOptions::EMap), path, ());
+ TEST_EQUAL(file.GetPath(TMapOptions::Map), path, ());
}
} // namespace platform
diff --git a/qt/update_dialog.cpp b/qt/update_dialog.cpp
index e94964a90c..3131e2a9ee 100644
--- a/qt/update_dialog.cpp
+++ b/qt/update_dialog.cpp
@@ -150,10 +150,10 @@ namespace qt
QAbstractButton * res = ask.clickedButton();
if (res == btns[0])
- m_framework.DownloadCountry(countryIndex, TMapOptions::EMapWithCarRouting);
+ m_framework.DownloadCountry(countryIndex, TMapOptions::MapWithCarRouting);
if (res == btns[1])
- m_framework.DeleteCountry(countryIndex, TMapOptions::EMapWithCarRouting);
+ m_framework.DeleteCountry(countryIndex, TMapOptions::MapWithCarRouting);
}
break;
@@ -167,18 +167,18 @@ namespace qt
ask.setDefaultButton(QMessageBox::No);
if (ask.exec() == QMessageBox::Yes)
- m_framework.DeleteCountry(countryIndex, TMapOptions::EMapWithCarRouting);
+ m_framework.DeleteCountry(countryIndex, TMapOptions::MapWithCarRouting);
}
break;
case TStatus::ENotDownloaded:
case TStatus::EDownloadFailed:
- m_framework.DownloadCountry(countryIndex, TMapOptions::EMapWithCarRouting);
+ m_framework.DownloadCountry(countryIndex, TMapOptions::MapWithCarRouting);
break;
case TStatus::EInQueue:
case TStatus::EDownloading:
- m_framework.DeleteCountry(countryIndex, TMapOptions::EMapWithCarRouting);
+ m_framework.DeleteCountry(countryIndex, TMapOptions::MapWithCarRouting);
break;
default:
@@ -247,7 +247,7 @@ namespace qt
QString statusString;
LocalAndRemoteSizeT size(0, 0);
- TMapOptions const options = TMapOptions::EMapWithCarRouting;
+ TMapOptions const options = TMapOptions::MapWithCarRouting;
Storage const & st = GetStorage();
switch (m_framework.GetCountryStatus(index))
diff --git a/routing/online_absent_fetcher.cpp b/routing/online_absent_fetcher.cpp
index 77496f5bfa..0d931629e1 100644
--- a/routing/online_absent_fetcher.cpp
+++ b/routing/online_absent_fetcher.cpp
@@ -39,7 +39,7 @@ void OnlineAbsentCountriesFetcher::GetAbsentCountries(vector<string> & countries
{
string name = m_countryFileFn(point);
auto localFile = m_countryLocalFileFn(name);
- if (localFile && HasOptions(localFile->GetFiles(), TMapOptions::EMapWithCarRouting))
+ if (localFile && HasOptions(localFile->GetFiles(), TMapOptions::MapWithCarRouting))
continue;
LOG(LINFO, ("Needs: ", name));
diff --git a/routing/routing_mapping.cpp b/routing/routing_mapping.cpp
index bed5d60193..a5924cfde9 100644
--- a/routing/routing_mapping.cpp
+++ b/routing/routing_mapping.cpp
@@ -26,10 +26,10 @@ namespace {
*/
bool CheckMwmConsistency(platform::LocalCountryFile const & localFile)
{
- ModelReaderPtr r1 = FilesContainerR(localFile.GetPath(TMapOptions::ECarRouting))
+ ModelReaderPtr r1 = FilesContainerR(localFile.GetPath(TMapOptions::CarRouting))
.GetReader(VERSION_FILE_TAG);
ReaderSrc src1(r1.GetPtr());
- ModelReaderPtr r2 = FilesContainerR(localFile.GetPath(TMapOptions::EMap))
+ ModelReaderPtr r2 = FilesContainerR(localFile.GetPath(TMapOptions::Map))
.GetReader(VERSION_FILE_TAG);
ReaderSrc src2(r2.GetPtr());
@@ -66,13 +66,13 @@ RoutingMapping::RoutingMapping(CountryFile const & countryFile, MwmSet * pIndex)
if (!m_handle.IsAlive())
return;
LocalCountryFile const & localFile = m_handle.GetInfo()->GetLocalFile();
- if (!HasOptions(localFile.GetFiles(), TMapOptions::EMapWithCarRouting))
+ if (!HasOptions(localFile.GetFiles(), TMapOptions::MapWithCarRouting))
{
m_handle = MwmSet::MwmHandle();
return;
}
- m_container.Open(localFile.GetPath(TMapOptions::ECarRouting));
+ m_container.Open(localFile.GetPath(TMapOptions::CarRouting));
if (!CheckMwmConsistency(localFile))
{
m_error = IRouter::ResultCode::InconsistentMWMandRoute;
diff --git a/routing/routing_tests/routing_mapping_test.cpp b/routing/routing_tests/routing_mapping_test.cpp
index 1578bf3279..af8011dfc6 100644
--- a/routing/routing_tests/routing_mapping_test.cpp
+++ b/routing/routing_tests/routing_mapping_test.cpp
@@ -26,12 +26,12 @@ class LocalFileGenerator
public:
LocalFileGenerator(string const & fileName)
: m_countryFile(fileName),
- m_testMapFile(m_countryFile.GetNameWithExt(TMapOptions::EMap), "map"),
- m_testRoutingFile(m_countryFile.GetNameWithExt(TMapOptions::ECarRouting), "routing"),
+ m_testMapFile(m_countryFile.GetNameWithExt(TMapOptions::Map), "map"),
+ m_testRoutingFile(m_countryFile.GetNameWithExt(TMapOptions::CarRouting), "routing"),
m_localFile(GetPlatform().WritableDir(), m_countryFile, 0 /* version */)
{
m_localFile.SyncWithDisk();
- TEST(m_localFile.OnDisk(TMapOptions::EMapWithCarRouting), ());
+ TEST(m_localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
GenerateVersionSections(m_localFile);
m_result = m_testSet.Register(m_localFile);
@@ -48,9 +48,9 @@ public:
private:
void GenerateVersionSections(LocalCountryFile const & localFile)
{
- FilesContainerW routingCont(localFile.GetPath(TMapOptions::ECarRouting));
+ FilesContainerW routingCont(localFile.GetPath(TMapOptions::CarRouting));
// Write version for routing file that is equal to correspondent mwm file.
- FilesContainerW mwmCont(localFile.GetPath(TMapOptions::EMap));
+ FilesContainerW mwmCont(localFile.GetPath(TMapOptions::Map));
FileWriter w1 = routingCont.GetWriter(VERSION_FILE_TAG);
FileWriter w2 = mwmCont.GetWriter(VERSION_FILE_TAG);
diff --git a/search/integration_tests/smoke_test.cpp b/search/integration_tests/smoke_test.cpp
index 6cbcae2739..5649670021 100644
--- a/search/integration_tests/smoke_test.cpp
+++ b/search/integration_tests/smoke_test.cpp
@@ -27,7 +27,7 @@ public:
~ScopedMapFile()
{
platform::CountryIndexes::DeleteFromDisk(m_file);
- m_file.DeleteFromDisk(TMapOptions::EMap);
+ m_file.DeleteFromDisk(TMapOptions::Map);
}
inline platform::LocalCountryFile & GetFile() { return m_file; }
@@ -62,7 +62,7 @@ UNIT_TEST(GenerateTestMwm_Smoke)
builder.AddPOI(m2::PointD(0, 1), "Brandy shop", "en");
builder.AddPOI(m2::PointD(1, 1), "Russian vodka shop", "en");
}
- TEST_EQUAL(TMapOptions::EMap, file.GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, file.GetFiles(), ());
TestSearchEngine engine("en" /* locale */);
auto ret = engine.RegisterMap(file);
@@ -102,7 +102,7 @@ UNIT_TEST(GenerateTestMwm_NotPrefixFreeNames)
builder.AddPOI(m2::PointD(2, 0), "aaa", "en");
builder.AddPOI(m2::PointD(2, 1), "aaa", "en");
}
- TEST_EQUAL(TMapOptions::EMap, file.GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, file.GetFiles(), ());
TestSearchEngine engine("en" /* locale */);
auto ret = engine.RegisterMap(file);
diff --git a/search/integration_tests/test_mwm_builder.cpp b/search/integration_tests/test_mwm_builder.cpp
index 16a88a5600..1b1a6eb47b 100644
--- a/search/integration_tests/test_mwm_builder.cpp
+++ b/search/integration_tests/test_mwm_builder.cpp
@@ -18,7 +18,7 @@
TestMwmBuilder::TestMwmBuilder(platform::LocalCountryFile & file)
: m_file(file),
m_collector(
- make_unique<feature::FeaturesCollector>(file.GetPath(TMapOptions::EMap) + EXTENSION_TMP)),
+ make_unique<feature::FeaturesCollector>(file.GetPath(TMapOptions::Map) + EXTENSION_TMP)),
m_classificator(classif())
{
}
@@ -50,10 +50,10 @@ void TestMwmBuilder::Finish()
CHECK(GenerateFinalFeatures(info, m_file.GetCountryFile().GetNameWithoutExt(),
feature::DataHeader::country),
("Can't sort features."));
- CHECK(indexer::BuildIndexFromDatFile(m_file.GetPath(TMapOptions::EMap),
- m_file.GetPath(TMapOptions::EMap)),
+ CHECK(indexer::BuildIndexFromDatFile(m_file.GetPath(TMapOptions::Map),
+ m_file.GetPath(TMapOptions::Map)),
("Can't build geometry index."));
- CHECK(indexer::BuildSearchIndexFromDatFile(m_file.GetPath(TMapOptions::EMap),
+ CHECK(indexer::BuildSearchIndexFromDatFile(m_file.GetPath(TMapOptions::Map),
true /* forceRebuild */),
("Can't build search index."));
m_file.SyncWithDisk();
diff --git a/storage/country.cpp b/storage/country.cpp
index d2be152219..f9094f023b 100644
--- a/storage/country.cpp
+++ b/storage/country.cpp
@@ -211,9 +211,9 @@ void SaveImpl(T const & v, json_t * jParent)
string const & strFile = file.GetNameWithoutExt();
if (strFile != strName)
json_object_set_new(jCountry.get(), "f", json_string(strFile.c_str()));
- json_object_set_new(jCountry.get(), "s", json_integer(file.GetRemoteSize(TMapOptions::EMap)));
+ json_object_set_new(jCountry.get(), "s", json_integer(file.GetRemoteSize(TMapOptions::Map)));
json_object_set_new(jCountry.get(), "rs",
- json_integer(file.GetRemoteSize(TMapOptions::ECarRouting)));
+ json_integer(file.GetRemoteSize(TMapOptions::CarRouting)));
}
if (v[i].SiblingsCount())
diff --git a/storage/queued_country.cpp b/storage/queued_country.cpp
index 9034370e77..38210de001 100644
--- a/storage/queued_country.cpp
+++ b/storage/queued_country.cpp
@@ -5,16 +5,16 @@
namespace storage
{
QueuedCountry::QueuedCountry(TIndex const & index, TMapOptions opt)
- : m_index(index), m_init(opt), m_left(opt), m_current(TMapOptions::ENothing)
+ : m_index(index), m_init(opt), m_left(opt), m_current(TMapOptions::Nothing)
{
ASSERT(GetIndex().IsValid(), ("Only valid countries may be downloaded."));
- ASSERT(m_left != TMapOptions::ENothing, ("Empty file set was requested for downloading."));
+ ASSERT(m_left != TMapOptions::Nothing, ("Empty file set was requested for downloading."));
SwitchToNextFile();
}
void QueuedCountry::AddOptions(TMapOptions opt)
{
- for (TMapOptions file : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
{
if (HasOptions(opt, file) && !HasOptions(m_init, file))
{
@@ -26,7 +26,7 @@ void QueuedCountry::AddOptions(TMapOptions opt)
void QueuedCountry::RemoveOptions(TMapOptions opt)
{
- for (TMapOptions file : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
{
if (HasOptions(opt, file) && HasOptions(m_init, file))
{
@@ -47,6 +47,6 @@ bool QueuedCountry::SwitchToNextFile()
("Current file (", m_current, ") is not specified in left files (", m_left, ")."));
m_left = UnsetOptions(m_left, m_current);
m_current = LeastSignificantOption(m_left);
- return m_current != TMapOptions::ENothing;
+ return m_current != TMapOptions::Nothing;
}
} // namespace storage
diff --git a/storage/storage.cpp b/storage/storage.cpp
index 9258f212cb..2fbf50d73a 100644
--- a/storage/storage.cpp
+++ b/storage/storage.cpp
@@ -42,7 +42,7 @@ uint64_t GetLocalSize(shared_ptr<LocalCountryFile> file, TMapOptions opt)
if (!file)
return 0;
uint64_t size = 0;
- for (TMapOptions bit : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions bit : {TMapOptions::Map, TMapOptions::CarRouting})
{
if (HasOptions(opt, bit))
size += file->GetSize(bit);
@@ -53,7 +53,7 @@ uint64_t GetLocalSize(shared_ptr<LocalCountryFile> file, TMapOptions opt)
uint64_t GetRemoteSize(CountryFile const & file, TMapOptions opt)
{
uint64_t size = 0;
- for (TMapOptions bit : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions bit : {TMapOptions::Map, TMapOptions::CarRouting})
{
if (HasOptions(opt, bit))
size += file.GetRemoteSize(bit);
@@ -130,7 +130,7 @@ void Storage::RegisterAllLocalMaps()
LocalCountryFile & localFile = *j;
LOG(LINFO, ("Removing obsolete", localFile));
localFile.SyncWithDisk();
- localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting);
+ localFile.DeleteFromDisk(TMapOptions::MapWithCarRouting);
++j;
}
@@ -288,19 +288,19 @@ void Storage::CountryStatusEx(TIndex const & index, TStatus & status, TMapOption
if (status == TStatus::EOnDisk || status == TStatus::EOnDiskOutOfDate)
{
- options = TMapOptions::EMap;
+ options = TMapOptions::Map;
shared_ptr<LocalCountryFile> localFile = GetLatestLocalFile(index);
ASSERT(localFile, ("Invariant violation: local file out of sync with disk."));
- if (localFile->OnDisk(TMapOptions::ECarRouting))
- options = SetOptions(options, TMapOptions::ECarRouting);
+ if (localFile->OnDisk(TMapOptions::CarRouting))
+ options = SetOptions(options, TMapOptions::CarRouting);
}
}
void Storage::DownloadCountry(TIndex const & index, TMapOptions opt)
{
opt = NormalizeDownloadFileSet(index, opt);
- if (opt == TMapOptions::ENothing)
+ if (opt == TMapOptions::Nothing)
return;
if (QueuedCountry * queuedCountry = FindCountryInQueue(index))
@@ -333,7 +333,7 @@ void Storage::DeleteCountry(TIndex const & index, TMapOptions opt)
void Storage::DeleteCustomCountryVersion(LocalCountryFile const & localFile)
{
CountryFile const countryFile = localFile.GetCountryFile();
- localFile.DeleteFromDisk(TMapOptions::EMapWithCarRouting);
+ localFile.DeleteFromDisk(TMapOptions::MapWithCarRouting);
{
auto it = m_localFilesForFakeCountries.find(countryFile);
@@ -356,7 +356,7 @@ void Storage::DeleteCustomCountryVersion(LocalCountryFile const & localFile)
// If file version equals to current data version, delete from downloader all pending requests for
// the country.
if (localFile.GetVersion() == GetCurrentDataVersion())
- DeleteCountryFilesFromDownloader(index, TMapOptions::EMapWithCarRouting);
+ DeleteCountryFilesFromDownloader(index, TMapOptions::MapWithCarRouting);
auto countryFilesIt = m_localFiles.find(index);
if (countryFilesIt == m_localFiles.end())
{
@@ -400,7 +400,7 @@ void Storage::DownloadNextFile(QueuedCountry const & country)
bool Storage::DeleteFromDownloader(TIndex const & index)
{
- if (!DeleteCountryFilesFromDownloader(index, TMapOptions::EMapWithCarRouting))
+ if (!DeleteCountryFilesFromDownloader(index, TMapOptions::MapWithCarRouting))
return false;
NotifyStatusChanged(index);
return true;
@@ -532,7 +532,7 @@ bool Storage::RegisterDownloadedFiles(TIndex const & index, TMapOptions files)
}
bool ok = true;
- for (TMapOptions file : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
{
if (!HasOptions(files, file))
continue;
@@ -555,22 +555,22 @@ bool Storage::RegisterDownloadedFiles(TIndex const & index, TMapOptions files)
void Storage::OnMapDownloadFinished(TIndex const & index, bool success, TMapOptions files)
{
- ASSERT_NOT_EQUAL(TMapOptions::ENothing, files,
+ ASSERT_NOT_EQUAL(TMapOptions::Nothing, files,
("This method should not be called for empty files set."));
{
string optionsName;
switch (files)
{
- case TMapOptions::ENothing:
+ case TMapOptions::Nothing:
optionsName = "Nothing";
break;
- case TMapOptions::EMap:
+ case TMapOptions::Map:
optionsName = "Map";
break;
- case TMapOptions::ECarRouting:
+ case TMapOptions::CarRouting:
optionsName = "CarRouting";
break;
- case TMapOptions::EMapWithCarRouting:
+ case TMapOptions::MapWithCarRouting:
optionsName = "MapWithCarRouting";
break;
}
@@ -689,11 +689,11 @@ TStatus Storage::CountryStatusFull(TIndex const & index, TStatus const status) c
return status;
shared_ptr<LocalCountryFile> localFile = GetLatestLocalFile(index);
- if (!localFile || !localFile->OnDisk(TMapOptions::EMap))
+ if (!localFile || !localFile->OnDisk(TMapOptions::Map))
return TStatus::ENotDownloaded;
CountryFile const & countryFile = GetCountryFile(index);
- if (GetRemoteSize(countryFile, TMapOptions::EMap) == 0)
+ if (GetRemoteSize(countryFile, TMapOptions::Map) == 0)
return TStatus::EUnknown;
if (localFile->GetVersion() != GetCurrentDataVersion())
@@ -704,11 +704,11 @@ TStatus Storage::CountryStatusFull(TIndex const & index, TStatus const status) c
TMapOptions Storage::NormalizeDownloadFileSet(TIndex const & index, TMapOptions opt) const
{
// Car routing files are useless without map files.
- if (HasOptions(opt, TMapOptions::ECarRouting))
- opt = SetOptions(opt, TMapOptions::EMap);
+ if (HasOptions(opt, TMapOptions::CarRouting))
+ opt = SetOptions(opt, TMapOptions::Map);
shared_ptr<LocalCountryFile> localCountryFile = GetLatestLocalFile(index);
- for (TMapOptions file : {TMapOptions::EMap, TMapOptions::ECarRouting})
+ for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
{
// Check whether requested files are on disk and up-to-date.
if (HasOptions(opt, file) && localCountryFile && localCountryFile->OnDisk(file) &&
@@ -723,8 +723,8 @@ TMapOptions Storage::NormalizeDownloadFileSet(TIndex const & index, TMapOptions
TMapOptions Storage::NormalizeDeleteFileSet(TMapOptions opt) const
{
// Car routing files are useless without map files.
- if (HasOptions(opt, TMapOptions::EMap))
- opt = SetOptions(opt, TMapOptions::ECarRouting);
+ if (HasOptions(opt, TMapOptions::Map))
+ opt = SetOptions(opt, TMapOptions::CarRouting);
return opt;
}
@@ -812,7 +812,7 @@ void Storage::DeleteCountryFiles(TIndex const & index, TMapOptions opt)
localFile->DeleteFromDisk(opt);
localFile->SyncWithDisk();
DeleteCountryIndexes(*localFile);
- if (localFile->GetFiles() == TMapOptions::ENothing)
+ if (localFile->GetFiles() == TMapOptions::Nothing)
localFile.reset();
}
auto isNull = [](shared_ptr<LocalCountryFile> const & localFile)
@@ -842,7 +842,7 @@ bool Storage::DeleteCountryFilesFromDownloader(TIndex const & index, TMapOptions
queuedCountry->RemoveOptions(opt);
// Remove country from the queue if there's nothing to download.
- if (queuedCountry->GetInitOptions() == TMapOptions::ENothing)
+ if (queuedCountry->GetInitOptions() == TMapOptions::Nothing)
m_queue.erase(find(m_queue.begin(), m_queue.end(), index));
if (!m_queue.empty() && m_downloader->IsIdle())
diff --git a/storage/storage_tests/queued_country_tests.cpp b/storage/storage_tests/queued_country_tests.cpp
index 01634a6bcf..33d5940a90 100644
--- a/storage/storage_tests/queued_country_tests.cpp
+++ b/storage/storage_tests/queued_country_tests.cpp
@@ -9,23 +9,23 @@ UNIT_TEST(QueuedCountry_AddOptions)
{
Storage storage;
TIndex const index = storage.FindIndexByFile("USA_Georgia");
- QueuedCountry country(index, TMapOptions::ECarRouting);
+ QueuedCountry country(index, TMapOptions::CarRouting);
TEST_EQUAL(index, country.GetIndex(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
- country.AddOptions(TMapOptions::EMap);
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetCurrentFile(), ());
+ country.AddOptions(TMapOptions::Map);
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
TEST(country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetCurrentFile(), ());
TEST(!country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetCurrentFile(), ());
}
UNIT_TEST(QueuedCountry_RemoveOptions)
@@ -34,59 +34,59 @@ UNIT_TEST(QueuedCountry_RemoveOptions)
TIndex const index = storage.FindIndexByFile("USA_Georgia");
{
- QueuedCountry country(index, TMapOptions::EMapWithCarRouting);
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
-
- country.RemoveOptions(TMapOptions::EMap);
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
-
- country.RemoveOptions(TMapOptions::ECarRouting);
- TEST_EQUAL(TMapOptions::ENothing, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
+ QueuedCountry country(index, TMapOptions::MapWithCarRouting);
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
+
+ country.RemoveOptions(TMapOptions::Map);
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
+
+ country.RemoveOptions(TMapOptions::CarRouting);
+ TEST_EQUAL(TMapOptions::Nothing, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
}
{
- QueuedCountry country(index, TMapOptions::EMapWithCarRouting);
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
+ QueuedCountry country(index, TMapOptions::MapWithCarRouting);
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
country.SwitchToNextFile();
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetDownloadedFiles(), ());
-
- country.RemoveOptions(TMapOptions::ECarRouting);
- TEST_EQUAL(TMapOptions::EMap, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetDownloadedFiles(), ());
+
+ country.RemoveOptions(TMapOptions::CarRouting);
+ TEST_EQUAL(TMapOptions::Map, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetDownloadedFiles(), ());
}
{
- QueuedCountry country(index, TMapOptions::EMapWithCarRouting);
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
+ QueuedCountry country(index, TMapOptions::MapWithCarRouting);
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
country.SwitchToNextFile();
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetDownloadedFiles(), ());
- country.RemoveOptions(TMapOptions::EMap);
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
+ country.RemoveOptions(TMapOptions::Map);
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
country.SwitchToNextFile();
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::ENothing, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::ECarRouting, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(TMapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(TMapOptions::CarRouting, country.GetDownloadedFiles(), ());
}
}
@@ -94,13 +94,13 @@ UNIT_TEST(QueuedCountry_Bits)
{
Storage storage;
TIndex const index = storage.FindIndexByFile("USA_Georgia");
- QueuedCountry country(index, TMapOptions::EMapWithCarRouting);
- TEST_EQUAL(TMapOptions::ENothing, country.GetDownloadedFiles(), ());
+ QueuedCountry country(index, TMapOptions::MapWithCarRouting);
+ TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
TEST(country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::EMap, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, country.GetDownloadedFiles(), ());
TEST(!country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetDownloadedFiles(), ());
}
} // namespace storage
diff --git a/storage/storage_tests/storage_tests.cpp b/storage/storage_tests/storage_tests.cpp
index 096e1befb4..99806dfb82 100644
--- a/storage/storage_tests/storage_tests.cpp
+++ b/storage/storage_tests/storage_tests.cpp
@@ -120,7 +120,7 @@ class CancelDownloadingWhenAlmostDoneChecker : public CountryDownloaderChecker
public:
CancelDownloadingWhenAlmostDoneChecker(Storage & storage, TIndex const & index,
TaskRunner & runner)
- : CountryDownloaderChecker(storage, index, TMapOptions::EMapWithCarRouting,
+ : CountryDownloaderChecker(storage, index, TMapOptions::MapWithCarRouting,
vector<TStatus>{TStatus::ENotDownloaded, TStatus::EDownloading,
TStatus::ENotDownloaded}),
m_runner(runner)
@@ -204,12 +204,12 @@ shared_ptr<LocalCountryFile> CreateDummyMapFile(CountryFile const & countryFile,
TEST(localFile.get(), ("Can't prepare place for", countryFile, "(version ", version, ")"));
{
string const zeroes(size, '\0');
- FileWriter writer(localFile->GetPath(TMapOptions::EMap));
+ FileWriter writer(localFile->GetPath(TMapOptions::Map));
writer.Write(zeroes.data(), zeroes.size());
}
localFile->SyncWithDisk();
- TEST_EQUAL(TMapOptions::EMap, localFile->GetFiles(), ());
- TEST_EQUAL(size, localFile->GetSize(TMapOptions::EMap), ());
+ TEST_EQUAL(TMapOptions::Map, localFile->GetFiles(), ());
+ TEST_EQUAL(size, localFile->GetSize(TMapOptions::Map), ());
return localFile;
}
@@ -270,13 +270,13 @@ UNIT_TEST(StorageTest_Smoke)
TIndex const usaGeorgiaIndex = storage.FindIndexByFile("USA_Georgia");
TEST(usaGeorgiaIndex.IsValid(), ());
CountryFile usaGeorgiaFile = storage.GetCountryFile(usaGeorgiaIndex);
- TEST_EQUAL(usaGeorgiaFile.GetNameWithExt(TMapOptions::EMap), "USA_Georgia" DATA_FILE_EXTENSION,
+ TEST_EQUAL(usaGeorgiaFile.GetNameWithExt(TMapOptions::Map), "USA_Georgia" DATA_FILE_EXTENSION,
());
TIndex const georgiaIndex = storage.FindIndexByFile("Georgia");
TEST(georgiaIndex.IsValid(), ());
CountryFile georgiaFile = storage.GetCountryFile(georgiaIndex);
- TEST_EQUAL(georgiaFile.GetNameWithExt(TMapOptions::ECarRouting),
+ TEST_EQUAL(georgiaFile.GetNameWithExt(TMapOptions::CarRouting),
"Georgia" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION, ());
TEST_NOT_EQUAL(usaGeorgiaIndex, georgiaIndex, ());
@@ -292,22 +292,22 @@ UNIT_TEST(StorageTest_SingleCountryDownloading)
TEST(azerbaijanIndex.IsValid(), ());
CountryFile azerbaijanFile = storage.GetCountryFile(azerbaijanIndex);
- storage.DeleteCountry(azerbaijanIndex, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(azerbaijanIndex, TMapOptions::MapWithCarRouting);
{
MY_SCOPE_GUARD(cleanupCountryFiles,
- bind(&Storage::DeleteCountry, &storage, azerbaijanIndex, TMapOptions::EMap));
+ bind(&Storage::DeleteCountry, &storage, azerbaijanIndex, TMapOptions::Map));
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, azerbaijanIndex, TMapOptions::EMapWithCarRouting);
+ AbsentCountryDownloaderChecker(storage, azerbaijanIndex, TMapOptions::MapWithCarRouting);
checker->StartDownload();
runner.Run();
}
{
MY_SCOPE_GUARD(cleanupCountryFiles, bind(&Storage::DeleteCountry, &storage, azerbaijanIndex,
- TMapOptions::EMapWithCarRouting));
+ TMapOptions::MapWithCarRouting));
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, azerbaijanIndex, TMapOptions::EMapWithCarRouting);
+ AbsentCountryDownloaderChecker(storage, azerbaijanIndex, TMapOptions::MapWithCarRouting);
checker->StartDownload();
runner.Run();
}
@@ -321,20 +321,20 @@ UNIT_TEST(StorageTest_TwoCountriesDownloading)
TIndex const uruguayIndex = storage.FindIndexByFile("Uruguay");
TEST(uruguayIndex.IsValid(), ());
- storage.DeleteCountry(uruguayIndex, TMapOptions::EMap);
+ storage.DeleteCountry(uruguayIndex, TMapOptions::Map);
MY_SCOPE_GUARD(cleanupUruguayFiles,
- bind(&Storage::DeleteCountry, &storage, uruguayIndex, TMapOptions::EMap));
+ bind(&Storage::DeleteCountry, &storage, uruguayIndex, TMapOptions::Map));
TIndex const venezuelaIndex = storage.FindIndexByFile("Venezuela");
TEST(venezuelaIndex.IsValid(), ());
- storage.DeleteCountry(venezuelaIndex, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(venezuelaIndex, TMapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupVenezuelaFiles, bind(&Storage::DeleteCountry, &storage, venezuelaIndex,
- TMapOptions::EMapWithCarRouting));
+ TMapOptions::MapWithCarRouting));
unique_ptr<CountryDownloaderChecker> uruguayChecker =
- AbsentCountryDownloaderChecker(storage, uruguayIndex, TMapOptions::EMap);
+ AbsentCountryDownloaderChecker(storage, uruguayIndex, TMapOptions::Map);
unique_ptr<CountryDownloaderChecker> venezuelaChecker =
- QueuedCountryDownloaderChecker(storage, venezuelaIndex, TMapOptions::EMapWithCarRouting);
+ QueuedCountryDownloaderChecker(storage, venezuelaIndex, TMapOptions::MapWithCarRouting);
uruguayChecker->StartDownload();
venezuelaChecker->StartDownload();
runner.Run();
@@ -350,7 +350,7 @@ UNIT_TEST(StorageTest_DeleteTwoVersionsOfTheSameCountry)
TEST(index.IsValid(), ());
CountryFile const countryFile = storage.GetCountryFile(index);
- storage.DeleteCountry(index, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
shared_ptr<LocalCountryFile> latestLocalFile = storage.GetLatestLocalFile(index);
TEST(!latestLocalFile.get(), ("Country wasn't deleted from disk."));
TEST_EQUAL(TStatus::ENotDownloaded, storage.CountryStatusEx(index), ());
@@ -371,13 +371,13 @@ UNIT_TEST(StorageTest_DeleteTwoVersionsOfTheSameCountry)
TEST_EQUAL(latestLocalFile->GetVersion(), localFileV2->GetVersion(), ());
TEST_EQUAL(TStatus::EOnDiskOutOfDate, storage.CountryStatusEx(index), ());
- storage.DeleteCountry(index, TMapOptions::EMap);
+ storage.DeleteCountry(index, TMapOptions::Map);
localFileV1->SyncWithDisk();
- TEST_EQUAL(TMapOptions::ENothing, localFileV1->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Nothing, localFileV1->GetFiles(), ());
localFileV2->SyncWithDisk();
- TEST_EQUAL(TMapOptions::ENothing, localFileV2->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Nothing, localFileV2->GetFiles(), ());
TEST_EQUAL(TStatus::ENotDownloaded, storage.CountryStatusEx(index), ());
}
@@ -390,11 +390,11 @@ UNIT_TEST(StorageTest_DownloadCountryAndDeleteRoutingOnly)
TIndex const index = storage.FindIndexByFile("Azerbaijan");
TEST(index.IsValid(), ());
- storage.DeleteCountry(index, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
{
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, index, TMapOptions::EMapWithCarRouting);
+ AbsentCountryDownloaderChecker(storage, index, TMapOptions::MapWithCarRouting);
checker->StartDownload();
runner.Run();
}
@@ -402,16 +402,16 @@ UNIT_TEST(StorageTest_DownloadCountryAndDeleteRoutingOnly)
// Delete routing file only and check that latest local file wasn't changed.
shared_ptr<LocalCountryFile> localFileA = storage.GetLatestLocalFile(index);
TEST(localFileA.get(), ());
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, localFileA->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, localFileA->GetFiles(), ());
- storage.DeleteCountry(index, TMapOptions::ECarRouting);
+ storage.DeleteCountry(index, TMapOptions::CarRouting);
shared_ptr<LocalCountryFile> localFileB = storage.GetLatestLocalFile(index);
TEST(localFileB.get(), ());
TEST_EQUAL(localFileA.get(), localFileB.get(), (*localFileA, *localFileB));
- TEST_EQUAL(TMapOptions::EMap, localFileB->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, localFileB->GetFiles(), ());
- storage.DeleteCountry(index, TMapOptions::EMap);
+ storage.DeleteCountry(index, TMapOptions::Map);
shared_ptr<LocalCountryFile> localFileC = storage.GetLatestLocalFile(index);
TEST(!localFileC.get(), (*localFileC));
}
@@ -438,28 +438,28 @@ UNIT_TEST(StorageTest_DownloadMapAndRoutingSeparately)
TEST(index.IsValid(), ());
CountryFile const countryFile = storage.GetCountryFile(index);
- storage.DeleteCountry(index, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
// Download map file only.
{
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, index, TMapOptions::EMap);
+ AbsentCountryDownloaderChecker(storage, index, TMapOptions::Map);
checker->StartDownload();
runner.Run();
}
shared_ptr<LocalCountryFile> localFileA = storage.GetLatestLocalFile(index);
TEST(localFileA.get(), ());
- TEST_EQUAL(TMapOptions::EMap, localFileA->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, localFileA->GetFiles(), ());
MwmSet::MwmId id = mwmSet.GetMwmIdByCountryFile(countryFile);
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::EMap, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
// Download routing file in addition to exising map file.
{
unique_ptr<CountryDownloaderChecker> checker =
- PresentCountryDownloaderChecker(storage, index, TMapOptions::ECarRouting);
+ PresentCountryDownloaderChecker(storage, index, TMapOptions::CarRouting);
checker->StartDownload();
runner.Run();
}
@@ -467,34 +467,34 @@ UNIT_TEST(StorageTest_DownloadMapAndRoutingSeparately)
shared_ptr<LocalCountryFile> localFileB = storage.GetLatestLocalFile(index);
TEST(localFileB.get(), ());
TEST_EQUAL(localFileA.get(), localFileB.get(), (*localFileA, *localFileB));
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, localFileB->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, localFileB->GetFiles(), ());
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::EMapWithCarRouting, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(TMapOptions::MapWithCarRouting, id.GetInfo()->GetLocalFile().GetFiles(), ());
// Delete routing file and check status update.
{
CountryStatusChecker checker(storage, index, TStatus::EOnDisk);
- storage.DeleteCountry(index, TMapOptions::ECarRouting);
+ storage.DeleteCountry(index, TMapOptions::CarRouting);
}
shared_ptr<LocalCountryFile> localFileC = storage.GetLatestLocalFile(index);
TEST(localFileC.get(), ());
TEST_EQUAL(localFileB.get(), localFileC.get(), (*localFileB, *localFileC));
- TEST_EQUAL(TMapOptions::EMap, localFileC->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, localFileC->GetFiles(), ());
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::EMap, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
// Delete map file and check status update.
{
CountryStatusChecker checker(storage, index, TStatus::ENotDownloaded);
- storage.DeleteCountry(index, TMapOptions::EMap);
+ storage.DeleteCountry(index, TMapOptions::Map);
}
// Framework should notify MwmSet about deletion of a map file.
// As there're no framework, there should not be any changes in MwmInfo.
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::EMap, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
}
UNIT_TEST(StorageTest_DeletePendingCountry)
@@ -505,13 +505,13 @@ UNIT_TEST(StorageTest_DeletePendingCountry)
TIndex const index = storage.FindIndexByFile("Azerbaijan");
TEST(index.IsValid(), ());
- storage.DeleteCountry(index, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
{
unique_ptr<CountryDownloaderChecker> checker =
- CancelledCountryDownloaderChecker(storage, index, TMapOptions::EMap);
+ CancelledCountryDownloaderChecker(storage, index, TMapOptions::Map);
checker->StartDownload();
- storage.DeleteCountry(index, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
runner.Run();
}
}
@@ -524,21 +524,21 @@ UNIT_TEST(StorageTest_DownloadTwoCountriesAndDelete)
TIndex const uruguayIndex = storage.FindIndexByFile("Uruguay");
TEST(uruguayIndex.IsValid(), ());
- storage.DeleteCountry(uruguayIndex, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(uruguayIndex, TMapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupUruguayFiles, bind(&Storage::DeleteCountry, &storage, uruguayIndex,
- TMapOptions::EMapWithCarRouting));
+ TMapOptions::MapWithCarRouting));
TIndex const venezuelaIndex = storage.FindIndexByFile("Venezuela");
TEST(venezuelaIndex.IsValid(), ());
- storage.DeleteCountry(venezuelaIndex, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(venezuelaIndex, TMapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupVenezuelaFiles, bind(&Storage::DeleteCountry, &storage, venezuelaIndex,
- TMapOptions::EMapWithCarRouting));
+ TMapOptions::MapWithCarRouting));
{
// Map file will be deleted for Uruguay, thus, routing file should also be deleted. Therefore,
// Uruguay should pass through following states: NotDownloaded -> Downloading -> NotDownloaded.
unique_ptr<CountryDownloaderChecker> uruguayChecker = make_unique<CountryDownloaderChecker>(
- storage, uruguayIndex, TMapOptions::EMapWithCarRouting,
+ storage, uruguayIndex, TMapOptions::MapWithCarRouting,
vector<TStatus>{TStatus::ENotDownloaded, TStatus::EDownloading, TStatus::ENotDownloaded});
// Only routing file will be deleted for Venezuela, thus, Venezuela should pass through
// following
@@ -546,13 +546,13 @@ UNIT_TEST(StorageTest_DownloadTwoCountriesAndDelete)
// NotDownloaded -> InQueue (Venezuela is added after Uruguay) -> Downloading -> Downloading
// (second notification will be sent after deletion of a routing file) -> OnDisk.
unique_ptr<CountryDownloaderChecker> venezuelaChecker = make_unique<CountryDownloaderChecker>(
- storage, venezuelaIndex, TMapOptions::EMapWithCarRouting,
+ storage, venezuelaIndex, TMapOptions::MapWithCarRouting,
vector<TStatus>{TStatus::ENotDownloaded, TStatus::EInQueue, TStatus::EDownloading,
TStatus::EDownloading, TStatus::EOnDisk});
uruguayChecker->StartDownload();
venezuelaChecker->StartDownload();
- storage.DeleteCountry(uruguayIndex, TMapOptions::EMap);
- storage.DeleteCountry(venezuelaIndex, TMapOptions::ECarRouting);
+ storage.DeleteCountry(uruguayIndex, TMapOptions::Map);
+ storage.DeleteCountry(venezuelaIndex, TMapOptions::CarRouting);
runner.Run();
}
shared_ptr<LocalCountryFile> uruguayFile = storage.GetLatestLocalFile(uruguayIndex);
@@ -560,7 +560,7 @@ UNIT_TEST(StorageTest_DownloadTwoCountriesAndDelete)
shared_ptr<LocalCountryFile> venezuelaFile = storage.GetLatestLocalFile(venezuelaIndex);
TEST(venezuelaFile.get(), ());
- TEST_EQUAL(TMapOptions::EMap, venezuelaFile->GetFiles(), ());
+ TEST_EQUAL(TMapOptions::Map, venezuelaFile->GetFiles(), ());
}
UNIT_TEST(StorageTest_CancelDownloadingWhenAlmostDone)
@@ -571,9 +571,9 @@ UNIT_TEST(StorageTest_CancelDownloadingWhenAlmostDone)
TIndex const index = storage.FindIndexByFile("Uruguay");
TEST(index.IsValid(), ());
- storage.DeleteCountry(index, TMapOptions::EMapWithCarRouting);
+ storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupFiles,
- bind(&Storage::DeleteCountry, &storage, index, TMapOptions::EMapWithCarRouting));
+ bind(&Storage::DeleteCountry, &storage, index, TMapOptions::MapWithCarRouting));
{
CancelDownloadingWhenAlmostDoneChecker checker(storage, index, runner);