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:
authorYuri Gorshenin <y@maps.me>2015-07-27 13:25:24 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:57:40 +0300
commit04142e39cffd676d234f2a3b39de774500c6a66e (patch)
tree4cc8006430e0a9f2b31a472d6f338ad2dcb43174
parentacb80ad11be5e7431cf31fac57bbe104886e3ef6 (diff)
Removed T-letter from TMapOptions.
-rw-r--r--android/jni/com/mapswithme/country/ActiveCountryTree.cpp6
-rw-r--r--android/jni/com/mapswithme/country/CountryTree.cpp6
-rw-r--r--android/jni/com/mapswithme/country/country_helper.cpp2
-rw-r--r--android/jni/com/mapswithme/country/country_helper.hpp2
-rw-r--r--android/jni/com/mapswithme/maps/Framework.cpp6
-rw-r--r--android/jni/com/mapswithme/maps/Framework.hpp4
-rw-r--r--android/jni/com/mapswithme/maps/MapStorage.cpp8
-rw-r--r--generator/routing_generator.cpp6
-rw-r--r--generator/update_generator.cpp10
-rw-r--r--indexer/features_offsets_table.cpp2
-rw-r--r--indexer/index.cpp2
-rw-r--r--iphone/Maps/ActiveMapsVC.mm14
-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.h4
-rw-r--r--iphone/Maps/Classes/MapCell.mm4
-rw-r--r--iphone/Maps/Classes/MapViewController.mm8
-rw-r--r--iphone/Maps/Classes/MapsObservers.h2
-rw-r--r--iphone/Maps/Classes/MapsObservers.mm4
-rw-r--r--iphone/Maps/CountryTreeVC.mm10
-rw-r--r--iphone/Maps/DownloaderParentVC.h6
-rw-r--r--iphone/Maps/DownloaderParentVC.mm44
-rw-r--r--map/active_maps_layout.cpp44
-rw-r--r--map/active_maps_layout.hpp32
-rw-r--r--map/country_status_display.cpp4
-rw-r--r--map/country_status_display.hpp2
-rw-r--r--map/country_tree.cpp10
-rw-r--r--map/country_tree.hpp8
-rw-r--r--map/framework.cpp14
-rw-r--r--map/framework.hpp4
-rw-r--r--map/mwm_tests/mwm_foreach_test.cpp2
-rw-r--r--platform/country_defines.cpp28
-rw-r--r--platform/country_defines.hpp14
-rw-r--r--platform/country_file.cpp12
-rw-r--r--platform/country_file.hpp4
-rw-r--r--platform/local_country_file.cpp26
-rw-r--r--platform/local_country_file.hpp12
-rw-r--r--platform/local_country_file_utils.cpp6
-rw-r--r--platform/local_country_file_utils.hpp2
-rw-r--r--platform/platform_tests/country_file_tests.cpp20
-rw-r--r--platform/platform_tests/local_country_file_tests.cpp78
-rw-r--r--platform/platform_tests_support/scoped_file.cpp2
-rw-r--r--platform/platform_tests_support/scoped_file.hpp2
-rw-r--r--qt/draw_widget.cpp2
-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.cpp6
-rw-r--r--storage/country.hpp2
-rw-r--r--storage/queued_country.cpp18
-rw-r--r--storage/queued_country.hpp18
-rw-r--r--storage/storage.cpp80
-rw-r--r--storage/storage.hpp24
-rw-r--r--storage/storage_tests/queued_country_tests.cpp108
-rw-r--r--storage/storage_tests/storage_tests.cpp118
59 files changed, 454 insertions, 454 deletions
diff --git a/android/jni/com/mapswithme/country/ActiveCountryTree.cpp b/android/jni/com/mapswithme/country/ActiveCountryTree.cpp
index b30bd93ad3..3434a6585f 100644
--- a/android/jni/com/mapswithme/country/ActiveCountryTree.cpp
+++ b/android/jni/com/mapswithme/country/ActiveCountryTree.cpp
@@ -49,7 +49,7 @@ extern "C"
ActiveMapsLayout::TGroup coreGroup = ToGroup(group);
int pos = static_cast<int>(position);
bool const local = isLocal == JNI_TRUE;
- TMapOptions opt = ToOptions(options);
+ MapOptions opt = ToOptions(options);
if (options == -1 || local)
{
@@ -61,9 +61,9 @@ extern "C"
LocalAndRemoteSizeT sizes = layout.GetRemoteCountrySizes(coreGroup, pos);
switch (opt)
{
- case TMapOptions::Map:
+ case MapOptions::Map:
return sizes.first;
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
return sizes.second;
default:
return sizes.first + sizes.second;
diff --git a/android/jni/com/mapswithme/country/CountryTree.cpp b/android/jni/com/mapswithme/country/CountryTree.cpp
index 240c994430..e78cad39b1 100644
--- a/android/jni/com/mapswithme/country/CountryTree.cpp
+++ b/android/jni/com/mapswithme/country/CountryTree.cpp
@@ -102,7 +102,7 @@ extern "C"
CountryTree & tree = GetTree();
int pos = static_cast<int>(position);
bool const local = (isLocal == JNI_TRUE) ? true : false;
- TMapOptions opt = ToOptions(options);
+ MapOptions opt = ToOptions(options);
if (options == -1 || local)
{
@@ -113,9 +113,9 @@ extern "C"
LocalAndRemoteSizeT sizes = tree.GetRemoteLeafSizes(pos);
switch (opt)
{
- case TMapOptions::Map:
+ case MapOptions::Map:
return sizes.first;
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
return sizes.second;
default:
return sizes.first + sizes.second;
diff --git a/android/jni/com/mapswithme/country/country_helper.cpp b/android/jni/com/mapswithme/country/country_helper.cpp
index 248fc86244..1988d29789 100644
--- a/android/jni/com/mapswithme/country/country_helper.cpp
+++ b/android/jni/com/mapswithme/country/country_helper.cpp
@@ -8,7 +8,7 @@ namespace storage_utils
storage::CountryTree & GetTree() { return frm()->GetCountryTree(); }
storage::ActiveMapsLayout::TGroup ToGroup(int group) { return static_cast<storage::ActiveMapsLayout::TGroup>(group); }
- TMapOptions ToOptions(int options) { return static_cast<TMapOptions>(options); }
+ MapOptions ToOptions(int options) { return static_cast<MapOptions>(options); }
jlongArray ToArray(JNIEnv * env, storage::LocalAndRemoteSizeT const & size)
{
jlongArray result = env->NewLongArray(2);
diff --git a/android/jni/com/mapswithme/country/country_helper.hpp b/android/jni/com/mapswithme/country/country_helper.hpp
index 6820c9c545..85c5c09b27 100644
--- a/android/jni/com/mapswithme/country/country_helper.hpp
+++ b/android/jni/com/mapswithme/country/country_helper.hpp
@@ -14,6 +14,6 @@ namespace storage_utils
storage::CountryTree & GetTree();
storage::ActiveMapsLayout::TGroup ToGroup(int group);
- TMapOptions ToOptions(int options);
+ MapOptions ToOptions(int options);
jlongArray ToArray(JNIEnv * env, storage::LocalAndRemoteSizeT const & sizes);
}
diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp
index 75b2b92f72..dec827e736 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::Map));
+ FilesContainerR cont(platform::GetCountryReader(localFile, MapOptions::Map));
if (!cont.IsExist(SEARCH_INDEX_FILE_TAG))
out.push_back(countryFile.GetNameWithoutExt());
}
@@ -778,7 +778,7 @@ namespace android
}
void Framework::CountryOptionsChanged(ActiveMapsLayout::TGroup const & group, int position,
- TMapOptions const & oldOpt, TMapOptions const & newOpt)
+ MapOptions const & oldOpt, MapOptions const & newOpt)
{
JNIEnv * env = jni::GetEnv();
for (TListenerMap::const_iterator it = m_javaActiveMapListeners.begin(); it != m_javaActiveMapListeners.end(); ++it)
@@ -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::Map);
+ storage_utils::GetMapLayout().DownloadMap(storage::ToNative(idx), MapOptions::Map);
}
JNIEXPORT void JNICALL
diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp
index 64f345fd1a..f17622c424 100644
--- a/android/jni/com/mapswithme/maps/Framework.hpp
+++ b/android/jni/com/mapswithme/maps/Framework.hpp
@@ -180,8 +180,8 @@ namespace android
virtual void CountryStatusChanged(storage::ActiveMapsLayout::TGroup const & group, int position,
storage::TStatus const & oldStatus, storage::TStatus const & newStatus);
virtual void CountryOptionsChanged(storage::ActiveMapsLayout::TGroup const & group,
- int position, TMapOptions const & oldOpt,
- TMapOptions const & newOpt);
+ int position, MapOptions const & oldOpt,
+ MapOptions const & newOpt);
virtual void DownloadingProgressUpdate(storage::ActiveMapsLayout::TGroup const & group, int position,
storage::LocalAndRemoteSizeT const & progress);
};
diff --git a/android/jni/com/mapswithme/maps/MapStorage.cpp b/android/jni/com/mapswithme/maps/MapStorage.cpp
index 85b5737aeb..97afe451f2 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::Map:
+ case MapOptions::Map:
return sizes.first;
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
return sizes.second;
- case TMapOptions::MapWithCarRouting:
+ case MapOptions::MapWithCarRouting:
return sizes.first + sizes.second;
- case TMapOptions::Nothing:
+ case MapOptions::Nothing:
return 0;
}
}
diff --git a/generator/routing_generator.cpp b/generator/routing_generator.cpp
index f98b501f1c..9e37d23ad6 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::Map), osrmFile, nodeData, osm2ft))
+ if (!LoadIndexes(localFile.GetPath(MapOptions::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::CarRouting);
+ string const fPath = localFile.GetPath(MapOptions::CarRouting);
FilesContainerW routingCont(fPath /*, FileWriter::OP_APPEND*/);
{
// Write version for routing file that is equal to correspondent mwm file.
- FilesContainerR mwmCont(localFile.GetPath(TMapOptions::Map));
+ FilesContainerR mwmCont(localFile.GetPath(MapOptions::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 8811dc1cf5..bbbac39d59 100644
--- a/generator/update_generator.cpp
+++ b/generator/update_generator.cpp
@@ -43,13 +43,13 @@ namespace update
string m_dataDir;
Platform::FilesList & m_files;
- uint64_t GetFileSize(platform::CountryFile const & cnt, TMapOptions opt) const
+ uint64_t GetFileSize(platform::CountryFile const & cnt, MapOptions opt) const
{
uint64_t sz = 0;
string const fName = cnt.GetNameWithExt(opt);
if (!GetPlatform().GetFileSizeByFullPath(m_dataDir + fName, sz))
{
- LOG(opt == TMapOptions::Map ? LCRITICAL : LWARNING, ("File was not found:", fName));
+ LOG(opt == MapOptions::Map ? LCRITICAL : LWARNING, ("File was not found:", fName));
return 0;
}
@@ -78,10 +78,10 @@ namespace update
++m_processedFiles;
- cnt.SetRemoteSizes(GetFileSize(cnt, TMapOptions::Map),
- GetFileSize(cnt, TMapOptions::CarRouting));
+ cnt.SetRemoteSizes(GetFileSize(cnt, MapOptions::Map),
+ GetFileSize(cnt, MapOptions::CarRouting));
- string const fName = cnt.GetNameWithExt(TMapOptions::Map);
+ string const fName = cnt.GetNameWithExt(MapOptions::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 3beaa3a184..fdd4f87481 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::Map));
+ FilesContainerR cont(localFile.GetPath(MapOptions::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 3a5351f77d..d08767e1c2 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::Map)),
+ : m_cont(platform::GetCountryReader(localFile, MapOptions::Map)),
m_countryFile(localFile.GetCountryFile()),
m_table(0)
{
diff --git a/iphone/Maps/ActiveMapsVC.mm b/iphone/Maps/ActiveMapsVC.mm
index 2567b59729..69fbdbc6a1 100644
--- a/iphone/Maps/ActiveMapsVC.mm
+++ b/iphone/Maps/ActiveMapsVC.mm
@@ -103,7 +103,7 @@ extern NSString * const MapsStatusChangedNotification;
self.selectedGroup = [self groupWithSection:indexPath.section];
}
-- (void)configureSizeLabelOfMapCell:(MapCell *)cell position:(int)position group:(ActiveMapsLayout::TGroup const &)group status:(TStatus const &)status options:(TMapOptions const &)options
+- (void)configureSizeLabelOfMapCell:(MapCell *)cell position:(int)position group:(ActiveMapsLayout::TGroup const &)group status:(TStatus const &)status options:(MapOptions const &)options
{
if (status == TStatus::ENotDownloaded)
{
@@ -129,7 +129,7 @@ extern NSString * const MapsStatusChangedNotification;
return [NSString stringWithUTF8String:self.mapsLayout.GetCountryName(self.selectedGroup, self.selectedPosition).c_str()];
}
-- (uint64_t)selectedMapSizeWithOptions:(TMapOptions)options
+- (uint64_t)selectedMapSizeWithOptions:(MapOptions)options
{
return self.mapsLayout.GetCountrySize(self.selectedGroup, self.selectedPosition, options).second;
}
@@ -139,7 +139,7 @@ extern NSString * const MapsStatusChangedNotification;
return self.mapsLayout.GetCountryStatus(self.selectedGroup, self.selectedPosition);
}
-- (TMapOptions)selectedMapOptions
+- (MapOptions)selectedMapOptions
{
return self.mapsLayout.GetCountryOptions(self.selectedGroup, self.selectedPosition);
}
@@ -241,7 +241,7 @@ extern NSString * const MapsStatusChangedNotification;
int const position = static_cast<int const>(indexPath.row);
ActiveMapsLayout::TGroup const group = [self groupWithSection:indexPath.section];
TStatus const status = self.mapsLayout.GetCountryStatus(group, position);
- TMapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
+ MapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
NSInteger const numberOfRows = [self tableView:tableView numberOfRowsInSection:indexPath.section];
BOOL const isLast = (indexPath.row == numberOfRows - 1);
@@ -304,7 +304,7 @@ extern NSString * const MapsStatusChangedNotification;
{
int const position = static_cast<int const>(indexPath.row);
ActiveMapsLayout::TGroup const group = [self groupWithSection:indexPath.section];
- TMapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
+ MapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
self.mapsLayout.DeleteMap(group, position, options);
[tableView setEditing:NO animated:YES];
[self updateAllCellsSeprators];
@@ -356,7 +356,7 @@ extern NSString * const MapsStatusChangedNotification;
MapCell * cell = [self cellAtPosition:position inGroup:group];
TStatus const status = self.mapsLayout.GetCountryStatus(group, position);
- TMapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
+ MapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
[self configureSizeLabelOfMapCell:cell position:position group:group status:status options:options];
[cell setStatus:self.mapsLayout.GetCountryStatus(group, position) options:self.mapsLayout.GetCountryOptions(group, position) animated:YES];
@@ -368,7 +368,7 @@ extern NSString * const MapsStatusChangedNotification;
MapCell * cell = [self cellAtPosition:position inGroup:group];
TStatus const status = self.mapsLayout.GetCountryStatus(group, position);
- TMapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
+ MapOptions const options = self.mapsLayout.GetCountryOptions(group, position);
[self configureSizeLabelOfMapCell:cell position:position group:group status:status options:options];
[cell setStatus:self.mapsLayout.GetCountryStatus(group, position) options:self.mapsLayout.GetCountryOptions(group, position) animated:YES];
}
diff --git a/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm b/iphone/Maps/Classes/CustomAlert/DownloadTransitMapsAlert/MWMDownloadTransitMapAlert.mm
index 62295bb548..6c859ee524 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::MapWithCarRouting : TMapOptions::CarRouting).second;
+ totalRoutingSize += a.GetCountrySize(i, isMaps ? MapOptions::MapWithCarRouting : MapOptions::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::MapWithCarRouting);
+ a.DownloadMap(index, MapOptions::MapWithCarRouting);
for (auto const & index : alert->routes)
- a.DownloadMap(index, TMapOptions::CarRouting);
+ a.DownloadMap(index, MapOptions::CarRouting);
};
[alert configure];
return alert;
diff --git a/iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm b/iphone/Maps/Classes/CustomViews/DownloadMapRequest/MWMDownloadMapRequest.mm
index 6eb767cee8..cde86cfb0b 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::MapWithCarRouting : TMapOptions::Map;
+ auto const mapType = self.downloadRoutesButton.selected ? MapOptions::MapWithCarRouting : MapOptions::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 9486ccdb91..5eefef9dd1 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::Map);
+ f.GetCountryTree().GetActiveMapLayout().DownloadMap(index, MapOptions::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.h b/iphone/Maps/Classes/MapCell.h
index 5630cb06f3..74cf6443f5 100644
--- a/iphone/Maps/Classes/MapCell.h
+++ b/iphone/Maps/Classes/MapCell.h
@@ -31,12 +31,12 @@ using namespace storage;
@property (nonatomic) BOOL parentMode;
@property (nonatomic) TStatus status;
-@property (nonatomic) TMapOptions options;
+@property (nonatomic) MapOptions options;
@property (nonatomic) double downloadProgress;
@property (nonatomic, weak) id <MapCellDelegate> delegate;
-- (void)setStatus:(TStatus)status options:(TMapOptions)options animated:(BOOL)animated;
+- (void)setStatus:(TStatus)status options:(MapOptions)options animated:(BOOL)animated;
- (void)setDownloadProgress:(double)downloadProgress animated:(BOOL)animated;
+ (CGFloat)cellHeight;
diff --git a/iphone/Maps/Classes/MapCell.mm b/iphone/Maps/Classes/MapCell.mm
index bb52a30565..6877c2c6ab 100644
--- a/iphone/Maps/Classes/MapCell.mm
+++ b/iphone/Maps/Classes/MapCell.mm
@@ -36,14 +36,14 @@
return self;
}
-- (void)setStatus:(TStatus)status options:(TMapOptions)options animated:(BOOL)animated
+- (void)setStatus:(TStatus)status options:(MapOptions)options animated:(BOOL)animated
{
self.status = status;
self.options = options;
self.progressView.failedMode = NO;
- if (options == TMapOptions::Map)
+ if (options == MapOptions::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 041de24a78..13dfb3a177 100644
--- a/iphone/Maps/Classes/MapViewController.mm
+++ b/iphone/Maps/Classes/MapViewController.mm
@@ -690,8 +690,8 @@ 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::CarRouting))
+ MapOptions options = static_cast<MapOptions>(opt);
+ if(HasOptions(options, MapOptions::CarRouting))
sizeToDownload += sizes.second;
NSString * name = [NSString stringWithUTF8String:layout.GetCountryName(idx).c_str()];
@@ -701,7 +701,7 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView)
if (connection == Platform::EConnectionType::CONNECTION_WWAN && sizeToDownload > 50 * MB)
{
NSString * title = [NSString stringWithFormat:L(@"no_wifi_ask_cellular_download"), name];
- [self.alertController presentnoWiFiAlertWithName:title downloadBlock:^{layout.DownloadMap(idx, static_cast<TMapOptions>(opt));}];
+ [self.alertController presentnoWiFiAlertWithName:title downloadBlock:^{layout.DownloadMap(idx, static_cast<MapOptions>(opt));}];
return;
}
}
@@ -711,7 +711,7 @@ typedef NS_OPTIONS(NSUInteger, MapInfoView)
return;
}
- layout.DownloadMap(idx, static_cast<TMapOptions>(opt));
+ layout.DownloadMap(idx, static_cast<MapOptions>(opt));
}
});
diff --git a/iphone/Maps/Classes/MapsObservers.h b/iphone/Maps/Classes/MapsObservers.h
index 59d4465acc..6b16be5478 100644
--- a/iphone/Maps/Classes/MapsObservers.h
+++ b/iphone/Maps/Classes/MapsObservers.h
@@ -35,7 +35,7 @@ public:
virtual void CountryStatusChanged(ActiveMapsLayout::TGroup const & group, int position,
TStatus const & oldStatus, TStatus const & newStatus);
virtual void CountryOptionsChanged(ActiveMapsLayout::TGroup const & group, int position,
- TMapOptions const & oldOpt, TMapOptions const & newOpt);
+ MapOptions const & oldOpt, MapOptions const & newOpt);
virtual void DownloadingProgressUpdate(ActiveMapsLayout::TGroup const & group, int position, LocalAndRemoteSizeT const & progress);
private:
diff --git a/iphone/Maps/Classes/MapsObservers.mm b/iphone/Maps/Classes/MapsObservers.mm
index 5994e870c6..e01a273789 100644
--- a/iphone/Maps/Classes/MapsObservers.mm
+++ b/iphone/Maps/Classes/MapsObservers.mm
@@ -30,7 +30,7 @@ void ActiveMapsObserver::CountryStatusChanged(ActiveMapsLayout::TGroup const & g
[m_delegateObject countryStatusChangedAtPosition:position inGroup:group];
}
-void ActiveMapsObserver::CountryOptionsChanged(ActiveMapsLayout::TGroup const & group, int position, TMapOptions const & oldOpt, TMapOptions const & newOpt)
+void ActiveMapsObserver::CountryOptionsChanged(ActiveMapsLayout::TGroup const & group, int position, MapOptions const & oldOpt, MapOptions const & newOpt)
{
if ([m_delegateObject respondsToSelector:@selector(countryOptionsChangedAtPosition:inGroup:)])
[m_delegateObject countryOptionsChangedAtPosition:position inGroup:group];
@@ -59,4 +59,4 @@ void CountryTreeObserver::ItemProgressChanged(int childPosition, storage::LocalA
{
if ([m_delegateObject respondsToSelector:@selector(countryDownloadingProgressChanged:atPositionInNode:)])
[m_delegateObject countryDownloadingProgressChanged:sizes atPositionInNode:childPosition];
-} \ No newline at end of file
+}
diff --git a/iphone/Maps/CountryTreeVC.mm b/iphone/Maps/CountryTreeVC.mm
index 0f59ea6033..7a6293fa0a 100644
--- a/iphone/Maps/CountryTreeVC.mm
+++ b/iphone/Maps/CountryTreeVC.mm
@@ -107,7 +107,7 @@ extern NSString * const MapsStatusChangedNotification;
return [self activeMapsRowIsVisible] && [indexPath isEqual:[self downloadedCountriesIndexPath]];
}
-- (void)configureSizeLabelOfMapCell:(MapCell *)cell position:(int)position status:(TStatus const &)status options:(TMapOptions const &)options
+- (void)configureSizeLabelOfMapCell:(MapCell *)cell position:(int)position status:(TStatus const &)status options:(MapOptions const &)options
{
if (self.tree.IsLeaf(position))
{
@@ -135,7 +135,7 @@ extern NSString * const MapsStatusChangedNotification;
return [NSString stringWithUTF8String:self.tree.GetChildName(self.selectedPosition).c_str()];
}
-- (uint64_t)selectedMapSizeWithOptions:(TMapOptions)options
+- (uint64_t)selectedMapSizeWithOptions:(MapOptions)options
{
return self.tree.GetLeafSize(self.selectedPosition, options).second;
}
@@ -145,7 +145,7 @@ extern NSString * const MapsStatusChangedNotification;
return self.tree.GetLeafStatus(self.selectedPosition);
}
-- (TMapOptions)selectedMapOptions
+- (MapOptions)selectedMapOptions
{
return self.tree.GetLeafOptions(self.selectedPosition);
}
@@ -238,7 +238,7 @@ extern NSString * const MapsStatusChangedNotification;
cell.separator.hidden = isLast;
if (isLeaf)
{
- TMapOptions const options = self.tree.GetLeafOptions(position);
+ MapOptions const options = self.tree.GetLeafOptions(position);
TStatus const status = self.tree.GetLeafStatus(position);
if (status == TStatus::EOutOfMemFailed || status == TStatus::EDownloadFailed || status == TStatus::EDownloading || status == TStatus::EInQueue)
{
@@ -335,7 +335,7 @@ extern NSString * const MapsStatusChangedNotification;
{
MapCell * cell = [self cellAtPositionInNode:position];
TStatus const status = self.tree.GetLeafStatus(position);
- TMapOptions const options = self.tree.GetLeafOptions(position);
+ MapOptions const options = self.tree.GetLeafOptions(position);
[self configureSizeLabelOfMapCell:cell position:position status:status options:options];
[cell setStatus:self.tree.GetLeafStatus(position) options:options animated:YES];
}
diff --git a/iphone/Maps/DownloaderParentVC.h b/iphone/Maps/DownloaderParentVC.h
index 1a3c5dc970..9bff8bf0a1 100644
--- a/iphone/Maps/DownloaderParentVC.h
+++ b/iphone/Maps/DownloaderParentVC.h
@@ -34,15 +34,15 @@ using namespace storage;
// CountryTree methods accept int. It should be enough to store all countries.
@property (nonatomic) int selectedPosition;
-@property (nonatomic) TMapOptions selectedInActionSheetOptions;
+@property (nonatomic) MapOptions selectedInActionSheetOptions;
@property (nonatomic) NSMutableDictionary * actionSheetActions;
// virtual
- (NSString *)parentTitle;
- (NSString *)selectedMapName;
-- (uint64_t)selectedMapSizeWithOptions:(TMapOptions)options;
+- (uint64_t)selectedMapSizeWithOptions:(MapOptions)options;
- (TStatus)selectedMapStatus;
-- (TMapOptions)selectedMapOptions;
+- (MapOptions)selectedMapOptions;
- (void)performAction:(DownloaderAction)action withSizeCheck:(BOOL)check;
@end
diff --git a/iphone/Maps/DownloaderParentVC.mm b/iphone/Maps/DownloaderParentVC.mm
index f2480e47c1..272c153438 100644
--- a/iphone/Maps/DownloaderParentVC.mm
+++ b/iphone/Maps/DownloaderParentVC.mm
@@ -30,22 +30,22 @@
{
if (buttonIndex != alertView.cancelButtonIndex)
{
- if (self.selectedInActionSheetOptions == TMapOptions::Map)
+ if (self.selectedInActionSheetOptions == MapOptions::Map)
[self performAction:DownloaderActionDownloadMap withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::CarRouting)
+ else if (self.selectedInActionSheetOptions == MapOptions::CarRouting)
[self performAction:DownloaderActionDownloadCarRouting withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::MapWithCarRouting)
+ else if (self.selectedInActionSheetOptions == MapOptions::MapWithCarRouting)
[self performAction:DownloaderActionDownloadAll withSizeCheck:NO];
}
}
- (void)download
{
- if (self.selectedInActionSheetOptions == TMapOptions::Map)
+ if (self.selectedInActionSheetOptions == MapOptions::Map)
[self performAction:DownloaderActionDownloadMap withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::CarRouting)
+ else if (self.selectedInActionSheetOptions == MapOptions::CarRouting)
[self performAction:DownloaderActionDownloadCarRouting withSizeCheck:NO];
- else if (self.selectedInActionSheetOptions == TMapOptions::MapWithCarRouting)
+ else if (self.selectedInActionSheetOptions == MapOptions::MapWithCarRouting)
[self performAction:DownloaderActionDownloadAll withSizeCheck:NO];
}
@@ -54,9 +54,9 @@
- (void)performAction:(DownloaderAction)action withSizeCheck:(BOOL)check {}
- (NSString *)parentTitle { return nil; }
- (NSString *)selectedMapName { return nil; }
-- (uint64_t)selectedMapSizeWithOptions:(TMapOptions)options { return 0; }
+- (uint64_t)selectedMapSizeWithOptions:(MapOptions)options { return 0; }
- (TStatus)selectedMapStatus { return TStatus::EUnknown; }
-- (TMapOptions)selectedMapOptions { return TMapOptions::Map; }
+- (MapOptions)selectedMapOptions { return MapOptions::Map; }
#pragma mark - Virtual table view methods
@@ -89,7 +89,7 @@
- (UIActionSheet *)actionSheetToPerformActionOnSelectedMap
{
TStatus const status = [self selectedMapStatus];
- TMapOptions const options = [self selectedMapOptions];
+ MapOptions const options = [self selectedMapOptions];
[self.actionSheetActions removeAllObjects];
UIActionSheet * actionSheet = [[UIActionSheet alloc] initWithTitle:self.actionSheetTitle delegate:self cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
if (status == TStatus::EOnDisk || status == TStatus::EOnDiskOutOfDate)
@@ -97,38 +97,38 @@
if (status == TStatus::ENotDownloaded || status == TStatus::EOutOfMemFailed || status == TStatus::EDownloadFailed)
{
- NSString * fullSize = formattedSize([self selectedMapSizeWithOptions:TMapOptions::MapWithCarRouting]);
- NSString * onlyMapSize = formattedSize([self selectedMapSizeWithOptions:TMapOptions::Map]);
+ NSString * fullSize = formattedSize([self selectedMapSizeWithOptions:MapOptions::MapWithCarRouting]);
+ NSString * onlyMapSize = formattedSize([self selectedMapSizeWithOptions:MapOptions::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::MapWithCarRouting)
+ if (status == TStatus::EOnDiskOutOfDate && options == MapOptions::MapWithCarRouting)
{
- NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::MapWithCarRouting]);
+ NSString * size = formattedSize([self selectedMapSizeWithOptions:MapOptions::MapWithCarRouting]);
[self addButtonWithTitle:[NSString stringWithFormat:@"%@, %@", L(@"downloader_update_map_and_routing"), size] action:DownloaderActionDownloadAll toActionSheet:actionSheet];
}
- if (status == TStatus::EOnDisk && options == TMapOptions::Map)
+ if (status == TStatus::EOnDisk && options == MapOptions::Map)
{
- NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::CarRouting]);
+ NSString * size = formattedSize([self selectedMapSizeWithOptions:MapOptions::CarRouting]);
NSString * title = [NSString stringWithFormat:@"%@, %@", L(@"downloader_download_routing"), size];
[self addButtonWithTitle:title action:DownloaderActionDownloadCarRouting toActionSheet:actionSheet];
}
- if (status == TStatus::EOnDiskOutOfDate && options == TMapOptions::Map)
+ if (status == TStatus::EOnDiskOutOfDate && options == MapOptions::Map)
{
- NSString * size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::Map]);
+ NSString * size = formattedSize([self selectedMapSizeWithOptions:MapOptions::Map]);
NSString * title = [NSString stringWithFormat:@"%@, %@", L(@"downloader_update_map"), size];
[self addButtonWithTitle:title action:DownloaderActionDownloadMap toActionSheet:actionSheet];
- size = formattedSize([self selectedMapSizeWithOptions:TMapOptions::MapWithCarRouting]);
+ size = formattedSize([self selectedMapSizeWithOptions:MapOptions::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::MapWithCarRouting)
+ if (options == MapOptions::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::MapWithCarRouting;
+ self.selectedInActionSheetOptions = MapOptions::MapWithCarRouting;
break;
case DownloaderActionDownloadMap:
case DownloaderActionDeleteMap:
- self.selectedInActionSheetOptions = TMapOptions::Map;
+ self.selectedInActionSheetOptions = MapOptions::Map;
break;
case DownloaderActionDownloadCarRouting:
case DownloaderActionDeleteCarRouting:
- self.selectedInActionSheetOptions = TMapOptions::CarRouting;
+ self.selectedInActionSheetOptions = MapOptions::CarRouting;
break;
default:
diff --git a/map/active_maps_layout.cpp b/map/active_maps_layout.cpp
index 83618bdc48..3755cc3b9d 100644
--- a/map/active_maps_layout.cpp
+++ b/map/active_maps_layout.cpp
@@ -47,7 +47,7 @@ void ActiveMapsLayout::Init(vector<platform::CountryFile> const & files)
if (!arr.empty())
{
TStatus status;
- TMapOptions options;
+ MapOptions options;
storage.CountryStatusEx(arr[0], status, options);
if (status == TStatus::EOnDisk || status == TStatus::EOnDiskOutOfDate)
m_items.push_back({ arr, status, options, options });
@@ -191,19 +191,19 @@ TStatus ActiveMapsLayout::GetCountryStatus(TIndex const & index) const
return GetStorage().CountryStatusEx(index);
}
-TMapOptions ActiveMapsLayout::GetCountryOptions(TGroup const & group, int position) const
+MapOptions ActiveMapsLayout::GetCountryOptions(TGroup const & group, int position) const
{
return GetItemInGroup(group, position).m_options;
}
-TMapOptions ActiveMapsLayout::GetCountryOptions(TIndex const & index) const
+MapOptions ActiveMapsLayout::GetCountryOptions(TIndex const & index) const
{
Item const * item = FindItem(index);
if (item)
return item->m_options;
TStatus status;
- TMapOptions options;
+ MapOptions options;
GetStorage().CountryStatusEx(index, status, options);
return options;
}
@@ -222,12 +222,12 @@ LocalAndRemoteSizeT const ActiveMapsLayout::GetDownloadableCountrySize(TIndex co
}
LocalAndRemoteSizeT const ActiveMapsLayout::GetCountrySize(TGroup const & group, int position,
- TMapOptions const & options) const
+ MapOptions const & options) const
{
return GetCountrySize(GetItemInGroup(group, position).Index(), options);
}
-LocalAndRemoteSizeT const ActiveMapsLayout::GetCountrySize(TIndex const & index, TMapOptions const & options) const
+LocalAndRemoteSizeT const ActiveMapsLayout::GetCountrySize(TIndex const & index, MapOptions const & options) const
{
return GetStorage().CountrySizeInBytes(index, options);
}
@@ -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::Map);
- return { mapSize, c.GetRemoteSize(TMapOptions::CarRouting) };
+ size_t const mapSize = c.GetRemoteSize(MapOptions::Map);
+ return { mapSize, c.GetRemoteSize(MapOptions::CarRouting) };
}
int ActiveMapsLayout::AddListener(ActiveMapsListener * listener)
@@ -255,9 +255,9 @@ void ActiveMapsLayout::RemoveListener(int slotID)
m_listeners.erase(slotID);
}
-void ActiveMapsLayout::DownloadMap(TIndex const & index, TMapOptions const & options)
+void ActiveMapsLayout::DownloadMap(TIndex const & index, MapOptions const & options)
{
- TMapOptions validOptions = ValidOptionsForDownload(options);
+ MapOptions validOptions = ValidOptionsForDownload(options);
Item * item = FindItem(index);
if (item)
{
@@ -275,14 +275,14 @@ void ActiveMapsLayout::DownloadMap(TIndex const & index, TMapOptions const & opt
m_framework.DownloadCountry(index, validOptions);
}
-void ActiveMapsLayout::DownloadMap(TGroup const & group, int position, TMapOptions const & options)
+void ActiveMapsLayout::DownloadMap(TGroup const & group, int position, MapOptions const & options)
{
Item & item = GetItemInGroup(group, position);
item.m_downloadRequest = ValidOptionsForDownload(options);
m_framework.DownloadCountry(item.Index(), item.m_downloadRequest);
}
-void ActiveMapsLayout::DeleteMap(TIndex const & index, const TMapOptions & options)
+void ActiveMapsLayout::DeleteMap(TIndex const & index, const MapOptions & options)
{
TGroup group;
int position;
@@ -290,7 +290,7 @@ void ActiveMapsLayout::DeleteMap(TIndex const & index, const TMapOptions & optio
DeleteMap(group, position, options);
}
-void ActiveMapsLayout::DeleteMap(TGroup const & group, int position, TMapOptions const & options)
+void ActiveMapsLayout::DeleteMap(TGroup const & group, int position, MapOptions const & options)
{
TIndex indexCopy = GetItemInGroup(group, position).Index();
m_framework.DeleteCountry(indexCopy, ValidOptionsForDelete(options));
@@ -378,7 +378,7 @@ Storage & ActiveMapsLayout::GetStorage()
void ActiveMapsLayout::StatusChangedCallback(TIndex const & index)
{
TStatus newStatus = TStatus::EUnknown;
- TMapOptions options = TMapOptions::Map;
+ MapOptions options = MapOptions::Map;
GetStorage().CountryStatusEx(index, newStatus, options);
TGroup group = TGroup::ENewMap;
@@ -403,7 +403,7 @@ void ActiveMapsLayout::StatusChangedCallback(TIndex const & index)
// but we must notify that options changed because for "NewMaps" m_options is virtual state
if (item.m_options != options || group == TGroup::ENewMap)
{
- TMapOptions requestOptions = options;
+ MapOptions requestOptions = options;
item.m_downloadRequest = item.m_options = options;
NotifyOptionsChanged(group, position, item.m_options, requestOptions);
}
@@ -418,7 +418,7 @@ void ActiveMapsLayout::StatusChangedCallback(TIndex const & index)
// Here we handle
// "Actual map without routing" -> "Actual map with routing"
// "Actual map with routing" -> "Actual map without routing"
- TMapOptions requestOpt = item.m_downloadRequest;
+ MapOptions requestOpt = item.m_downloadRequest;
item.m_options = item.m_downloadRequest = options;
NotifyOptionsChanged(group, position, item.m_options, requestOpt);
}
@@ -654,21 +654,21 @@ void ActiveMapsLayout::NotifyStatusChanged(TGroup const & group, int position,
}
void ActiveMapsLayout::NotifyOptionsChanged(TGroup const & group, int position,
- TMapOptions const & oldOpt, TMapOptions const & newOpt)
+ MapOptions const & oldOpt, MapOptions const & newOpt)
{
for (TListenerNode listener : m_listeners)
listener.second->CountryOptionsChanged(group, position, oldOpt, newOpt);
}
-TMapOptions ActiveMapsLayout::ValidOptionsForDownload(TMapOptions const & options)
+MapOptions ActiveMapsLayout::ValidOptionsForDownload(MapOptions const & options)
{
- return SetOptions(options, TMapOptions::Map);
+ return SetOptions(options, MapOptions::Map);
}
-TMapOptions ActiveMapsLayout::ValidOptionsForDelete(TMapOptions const & options)
+MapOptions ActiveMapsLayout::ValidOptionsForDelete(MapOptions const & options)
{
- if (HasOptions(options, TMapOptions::Map))
- return SetOptions(options, TMapOptions::CarRouting);
+ if (HasOptions(options, MapOptions::Map))
+ return SetOptions(options, MapOptions::CarRouting);
return options;
}
diff --git a/map/active_maps_layout.hpp b/map/active_maps_layout.hpp
index 0002fafd02..81367527ae 100644
--- a/map/active_maps_layout.hpp
+++ b/map/active_maps_layout.hpp
@@ -42,7 +42,7 @@ public:
virtual void CountryStatusChanged(TGroup const & group, int position,
TStatus const & oldStatus, TStatus const & newStatus) = 0;
virtual void CountryOptionsChanged(TGroup const & group, int position,
- TMapOptions const & oldOpt, TMapOptions const & newOpt) = 0;
+ MapOptions const & oldOpt, MapOptions const & newOpt) = 0;
virtual void DownloadingProgressUpdate(TGroup const & group, int position,
LocalAndRemoteSizeT const & progress) = 0;
};
@@ -62,22 +62,22 @@ public:
string const & GetCountryName(storage::TIndex const & index) const;
TStatus GetCountryStatus(TGroup const & group, int position) const;
TStatus GetCountryStatus(storage::TIndex const & index) const;
- TMapOptions GetCountryOptions(TGroup const & group, int position) const;
- TMapOptions GetCountryOptions(storage::TIndex const & index) const;
+ MapOptions GetCountryOptions(TGroup const & group, int position) const;
+ MapOptions GetCountryOptions(storage::TIndex const & index) const;
LocalAndRemoteSizeT const GetDownloadableCountrySize(TGroup const & group, int position) const;
LocalAndRemoteSizeT const GetDownloadableCountrySize(TIndex const & index) const;
- LocalAndRemoteSizeT const GetCountrySize(TGroup const & group, int position, TMapOptions const & options) const;
- LocalAndRemoteSizeT const GetCountrySize(TIndex const & index, TMapOptions const & options) const;
+ LocalAndRemoteSizeT const GetCountrySize(TGroup const & group, int position, MapOptions const & options) const;
+ LocalAndRemoteSizeT const GetCountrySize(TIndex const & index, MapOptions const & options) const;
LocalAndRemoteSizeT const GetRemoteCountrySizes(TGroup const & group, int position) const;
LocalAndRemoteSizeT const GetRemoteCountrySizes(TIndex const & index) const;
int AddListener(ActiveMapsListener * listener);
void RemoveListener(int slotID);
- void DownloadMap(TIndex const & index, TMapOptions const & options);
- void DownloadMap(TGroup const & group, int position, TMapOptions const & options);
- void DeleteMap(TIndex const & index, TMapOptions const & options);
- void DeleteMap(TGroup const & group, int position, TMapOptions const & options);
+ void DownloadMap(TIndex const & index, MapOptions const & options);
+ void DownloadMap(TGroup const & group, int position, MapOptions const & options);
+ void DeleteMap(TIndex const & index, MapOptions const & options);
+ void DeleteMap(TGroup const & group, int position, MapOptions const & options);
void RetryDownloading(TGroup const & group, int position);
void RetryDownloading(TIndex const & index);
@@ -115,8 +115,8 @@ private:
public:
template <class TCont> Item(TCont const & cont,
TStatus status,
- TMapOptions options,
- TMapOptions downloadRequest)
+ MapOptions options,
+ MapOptions downloadRequest)
: m_indexes(cont.begin(), cont.end()), m_status(status),
m_options(options), m_downloadRequest(downloadRequest)
{
@@ -133,8 +133,8 @@ private:
TIndex const & Index() const { return m_indexes[0]; }
TStatus m_status;
- TMapOptions m_options;
- TMapOptions m_downloadRequest;
+ MapOptions m_options;
+ MapOptions m_downloadRequest;
};
Item const & GetItemInGroup(TGroup const & group, int position) const;
@@ -156,10 +156,10 @@ private:
void NotifyStatusChanged(TGroup const & group, int position,
TStatus const & oldStatus, TStatus const & newStatus);
void NotifyOptionsChanged(TGroup const & group, int position,
- TMapOptions const & oldOpt, TMapOptions const & newOpt);
+ MapOptions const & oldOpt, MapOptions const & newOpt);
- TMapOptions ValidOptionsForDownload(TMapOptions const & options);
- TMapOptions ValidOptionsForDelete(TMapOptions const & options);
+ MapOptions ValidOptionsForDownload(MapOptions const & options);
+ MapOptions ValidOptionsForDelete(MapOptions const & options);
private:
Framework & m_framework;
diff --git a/map/country_status_display.cpp b/map/country_status_display.cpp
index 086d4bcb95..d7357a3f93 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::Map;
+ MapOptions options = MapOptions::Map;
if (button == m_primaryButton.get())
- options = SetOptions(options, TMapOptions::CarRouting);
+ options = SetOptions(options, MapOptions::CarRouting);
ASSERT(m_downloadCallback, ());
int opt = static_cast<int>(options);
diff --git a/map/country_status_display.hpp b/map/country_status_display.hpp
index c9ab39e62a..4047e9cc89 100644
--- a/map/country_status_display.hpp
+++ b/map/country_status_display.hpp
@@ -70,7 +70,7 @@ private:
virtual void CountryStatusChanged(storage::ActiveMapsLayout::TGroup const & group, int position,
storage::TStatus const & oldStatus, storage::TStatus const & newStatus);
virtual void CountryOptionsChanged(storage::ActiveMapsLayout::TGroup const & group, int position,
- TMapOptions const & oldOpt, TMapOptions const & newOpt)
+ MapOptions const & oldOpt, MapOptions const & newOpt)
{
}
virtual void DownloadingProgressUpdate(storage::ActiveMapsLayout::TGroup const & group, int position,
diff --git a/map/country_tree.cpp b/map/country_tree.cpp
index 4d62070703..0af4952864 100644
--- a/map/country_tree.cpp
+++ b/map/country_tree.cpp
@@ -148,10 +148,10 @@ TStatus CountryTree::GetLeafStatus(int position) const
return GetStorage().CountryStatusEx(GetChild(position));
}
-TMapOptions CountryTree::GetLeafOptions(int position) const
+MapOptions CountryTree::GetLeafOptions(int position) const
{
TStatus status;
- TMapOptions options;
+ MapOptions options;
GetStorage().CountryStatusEx(GetChild(position), status, options);
return options;
}
@@ -161,7 +161,7 @@ LocalAndRemoteSizeT const CountryTree::GetDownloadableLeafSize(int position) con
return GetActiveMapLayout().GetDownloadableCountrySize(GetChild(position));
}
-LocalAndRemoteSizeT const CountryTree::GetLeafSize(int position, TMapOptions const & options) const
+LocalAndRemoteSizeT const CountryTree::GetLeafSize(int position, MapOptions const & options) const
{
return GetActiveMapLayout().GetCountrySize(GetChild(position), options);
}
@@ -186,13 +186,13 @@ string const & CountryTree::GetRootName() const
return GetStorage().CountryName(GetCurrentRoot());
}
-void CountryTree::DownloadCountry(int childPosition, TMapOptions const & options)
+void CountryTree::DownloadCountry(int childPosition, MapOptions const & options)
{
ASSERT(IsLeaf(childPosition), ());
GetActiveMapLayout().DownloadMap(GetChild(childPosition), options);
}
-void CountryTree::DeleteCountry(int childPosition, TMapOptions const & options)
+void CountryTree::DeleteCountry(int childPosition, MapOptions const & options)
{
ASSERT(IsLeaf(childPosition), ());
GetActiveMapLayout().DeleteMap(GetChild(childPosition), options);
diff --git a/map/country_tree.hpp b/map/country_tree.hpp
index 2a28dce7a3..54d0259486 100644
--- a/map/country_tree.hpp
+++ b/map/country_tree.hpp
@@ -59,16 +59,16 @@ public:
string const & GetChildName(int position) const;
/// call this only if child IsLeaf == true
TStatus GetLeafStatus(int position) const;
- TMapOptions GetLeafOptions(int position) const;
+ MapOptions GetLeafOptions(int position) const;
LocalAndRemoteSizeT const GetDownloadableLeafSize(int position) const;
- LocalAndRemoteSizeT const GetLeafSize(int position, TMapOptions const & options) const;
+ LocalAndRemoteSizeT const GetLeafSize(int position, MapOptions const & options) const;
LocalAndRemoteSizeT const GetRemoteLeafSizes(int position) const;
bool IsCountryRoot() const;
string const & GetRootName() const;
///@{
- void DownloadCountry(int childPosition, TMapOptions const & options);
- void DeleteCountry(int childPosition, TMapOptions const & options);
+ void DownloadCountry(int childPosition, MapOptions const & options);
+ void DeleteCountry(int childPosition, MapOptions const & options);
void RetryDownloading(int childPosition);
///@}
void CancelDownloading(int childPosition);
diff --git a/map/framework.cpp b/map/framework.cpp
index e6cb2cdd36..696155f5ad 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -355,14 +355,14 @@ double Framework::GetVisualScale() const
return m_scales.GetVisualScale();
}
-void Framework::DeleteCountry(storage::TIndex const & index, TMapOptions opt)
+void Framework::DeleteCountry(storage::TIndex const & index, MapOptions opt)
{
switch (opt)
{
- case TMapOptions::Nothing:
+ case MapOptions::Nothing:
return;
- case TMapOptions::Map: // fall through
- case TMapOptions::MapWithCarRouting:
+ case MapOptions::Map: // fall through
+ case MapOptions::MapWithCarRouting:
{
CountryFile const & countryFile = m_storage.GetCountryFile(index);
// m_model will notify us when latest map file will be deleted via
@@ -376,14 +376,14 @@ void Framework::DeleteCountry(storage::TIndex const & index, TMapOptions opt)
m_routingSession.Reset();
return;
}
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
m_routingSession.Reset();
m_storage.DeleteCountry(index, opt);
return;
}
}
-void Framework::DownloadCountry(TIndex const & index, TMapOptions opt)
+void Framework::DownloadCountry(TIndex const & index, MapOptions opt)
{
m_storage.DownloadCountry(index, opt);
}
@@ -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::Map))
+ if (!HasOptions(localFile.GetFiles(), MapOptions::Map))
return;
// Add downloaded map.
diff --git a/map/framework.hpp b/map/framework.hpp
index 617c4b3366..5150898850 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -205,9 +205,9 @@ public:
/// @name This functions is used by Downloader UI.
//@{
/// options - flags that signal about parts of map that must be deleted
- void DeleteCountry(storage::TIndex const & index, TMapOptions opt);
+ void DeleteCountry(storage::TIndex const & index, MapOptions opt);
/// options - flags that signal about parts of map that must be downloaded
- void DownloadCountry(storage::TIndex const & index, TMapOptions opt);
+ void DownloadCountry(storage::TIndex const & index, MapOptions opt);
storage::TStatus GetCountryStatus(storage::TIndex const & index) const;
string GetCountryName(storage::TIndex const & index) const;
diff --git a/map/mwm_tests/mwm_foreach_test.cpp b/map/mwm_tests/mwm_foreach_test.cpp
index b3ed7ab0b5..f9bf63dfa4 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::Map);
+ ModelReaderPtr reader = platform::GetCountryReader(localFile, MapOptions::Map);
while (!rects.empty())
{
diff --git a/platform/country_defines.cpp b/platform/country_defines.cpp
index 05605e7ee0..bbbf933a2a 100644
--- a/platform/country_defines.cpp
+++ b/platform/country_defines.cpp
@@ -2,43 +2,43 @@
#include "base/assert.hpp"
-bool HasOptions(TMapOptions mask, TMapOptions options)
+bool HasOptions(MapOptions mask, MapOptions options)
{
return (static_cast<uint8_t>(mask) & static_cast<uint8_t>(options)) ==
static_cast<uint8_t>(options);
}
-TMapOptions IntersectOptions(TMapOptions lhs, TMapOptions rhs)
+MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs)
{
- return static_cast<TMapOptions>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
+ return static_cast<MapOptions>(static_cast<uint8_t>(lhs) & static_cast<uint8_t>(rhs));
}
-TMapOptions SetOptions(TMapOptions mask, TMapOptions options)
+MapOptions SetOptions(MapOptions mask, MapOptions options)
{
- return static_cast<TMapOptions>(static_cast<uint8_t>(mask) | static_cast<uint8_t>(options));
+ return static_cast<MapOptions>(static_cast<uint8_t>(mask) | static_cast<uint8_t>(options));
}
-TMapOptions UnsetOptions(TMapOptions mask, TMapOptions options)
+MapOptions UnsetOptions(MapOptions mask, MapOptions options)
{
- return static_cast<TMapOptions>(static_cast<uint8_t>(mask) & ~static_cast<uint8_t>(options));
+ return static_cast<MapOptions>(static_cast<uint8_t>(mask) & ~static_cast<uint8_t>(options));
}
-TMapOptions LeastSignificantOption(TMapOptions mask)
+MapOptions LeastSignificantOption(MapOptions mask)
{
- return static_cast<TMapOptions>(static_cast<uint8_t>(mask) & -static_cast<uint8_t>(mask));
+ return static_cast<MapOptions>(static_cast<uint8_t>(mask) & -static_cast<uint8_t>(mask));
}
-string DebugPrint(TMapOptions options)
+string DebugPrint(MapOptions options)
{
switch (options)
{
- case TMapOptions::Nothing:
+ case MapOptions::Nothing:
return "Nothing";
- case TMapOptions::Map:
+ case MapOptions::Map:
return "MapOnly";
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
return "CarRouting";
- case TMapOptions::MapWithCarRouting:
+ case MapOptions::MapWithCarRouting:
return "MapWithCarRouting";
}
}
diff --git a/platform/country_defines.hpp b/platform/country_defines.hpp
index 7ba1428fa8..d2f46dd409 100644
--- a/platform/country_defines.hpp
+++ b/platform/country_defines.hpp
@@ -2,7 +2,7 @@
#include "std/string.hpp"
-enum class TMapOptions : uint8_t
+enum class MapOptions : uint8_t
{
Nothing = 0x0,
Map = 0x1,
@@ -10,14 +10,14 @@ enum class TMapOptions : uint8_t
MapWithCarRouting = 0x3
};
-bool HasOptions(TMapOptions mask, TMapOptions options);
+bool HasOptions(MapOptions mask, MapOptions options);
-TMapOptions IntersectOptions(TMapOptions lhs, TMapOptions rhs);
+MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs);
-TMapOptions SetOptions(TMapOptions mask, TMapOptions options);
+MapOptions SetOptions(MapOptions mask, MapOptions options);
-TMapOptions UnsetOptions(TMapOptions mask, TMapOptions options);
+MapOptions UnsetOptions(MapOptions mask, MapOptions options);
-TMapOptions LeastSignificantOption(TMapOptions mask);
+MapOptions LeastSignificantOption(MapOptions mask);
-string DebugPrint(TMapOptions options);
+string DebugPrint(MapOptions options);
diff --git a/platform/country_file.cpp b/platform/country_file.cpp
index c030f4759c..41ace2a248 100644
--- a/platform/country_file.cpp
+++ b/platform/country_file.cpp
@@ -12,13 +12,13 @@ CountryFile::CountryFile(string const & name) : m_name(name), m_mapSize(0), m_ro
string const & CountryFile::GetNameWithoutExt() const { return m_name; }
-string CountryFile::GetNameWithExt(TMapOptions file) const
+string CountryFile::GetNameWithExt(MapOptions file) const
{
switch (file)
{
- case TMapOptions::Map:
+ case MapOptions::Map:
return m_name + DATA_FILE_EXTENSION;
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
return m_name + DATA_FILE_EXTENSION + ROUTING_FILE_EXTENSION;
default:
ASSERT(false, ("Can't get name for:", file));
@@ -32,12 +32,12 @@ void CountryFile::SetRemoteSizes(uint32_t mapSize, uint32_t routingSize)
m_routingSize = routingSize;
}
-uint32_t CountryFile::GetRemoteSize(TMapOptions filesMask) const
+uint32_t CountryFile::GetRemoteSize(MapOptions filesMask) const
{
uint32_t size = 0;
- if (HasOptions(filesMask, TMapOptions::Map))
+ if (HasOptions(filesMask, MapOptions::Map))
size += m_mapSize;
- if (HasOptions(filesMask, TMapOptions::CarRouting))
+ if (HasOptions(filesMask, MapOptions::CarRouting))
size += m_routingSize;
return size;
}
diff --git a/platform/country_file.hpp b/platform/country_file.hpp
index e23a81e85e..d0fed2bfe7 100644
--- a/platform/country_file.hpp
+++ b/platform/country_file.hpp
@@ -17,10 +17,10 @@ public:
explicit CountryFile(string const & name);
string const & GetNameWithoutExt() const;
- string GetNameWithExt(TMapOptions file) const;
+ string GetNameWithExt(MapOptions file) const;
void SetRemoteSizes(uint32_t mapSize, uint32_t routingSize);
- uint32_t GetRemoteSize(TMapOptions filesMask) const;
+ uint32_t GetRemoteSize(MapOptions filesMask) const;
inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; }
inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; }
diff --git a/platform/local_country_file.cpp b/platform/local_country_file.cpp
index da171ebaf8..bc93513812 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::Nothing), m_mapSize(0), m_routingSize()
+ : m_version(0), m_files(MapOptions::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::Nothing),
+ m_files(MapOptions::Nothing),
m_mapSize(0),
m_routingSize(0)
{
@@ -29,23 +29,23 @@ LocalCountryFile::LocalCountryFile(string const & directory, CountryFile const &
void LocalCountryFile::SyncWithDisk()
{
- m_files = TMapOptions::Nothing;
+ m_files = MapOptions::Nothing;
m_mapSize = 0;
m_routingSize = 0;
Platform & platform = GetPlatform();
- if (platform.GetFileSizeByFullPath(GetPath(TMapOptions::Map), m_mapSize))
- m_files = SetOptions(m_files, TMapOptions::Map);
+ if (platform.GetFileSizeByFullPath(GetPath(MapOptions::Map), m_mapSize))
+ m_files = SetOptions(m_files, MapOptions::Map);
- string const routingPath = GetPath(TMapOptions::CarRouting);
+ string const routingPath = GetPath(MapOptions::CarRouting);
if (platform.GetFileSizeByFullPath(routingPath, m_routingSize))
- m_files = SetOptions(m_files, TMapOptions::CarRouting);
+ m_files = SetOptions(m_files, MapOptions::CarRouting);
}
-void LocalCountryFile::DeleteFromDisk(TMapOptions files) const
+void LocalCountryFile::DeleteFromDisk(MapOptions files) const
{
- for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting})
{
if (OnDisk(file) && HasOptions(files, file))
{
@@ -55,17 +55,17 @@ void LocalCountryFile::DeleteFromDisk(TMapOptions files) const
}
}
-string LocalCountryFile::GetPath(TMapOptions file) const
+string LocalCountryFile::GetPath(MapOptions file) const
{
return my::JoinFoldersToPath(m_directory, m_countryFile.GetNameWithExt(file));
}
-uint32_t LocalCountryFile::GetSize(TMapOptions filesMask) const
+uint32_t LocalCountryFile::GetSize(MapOptions filesMask) const
{
uint64_t size64 = 0;
- if (HasOptions(filesMask, TMapOptions::Map))
+ if (HasOptions(filesMask, MapOptions::Map))
size64 += m_mapSize;
- if (HasOptions(filesMask, TMapOptions::CarRouting))
+ if (HasOptions(filesMask, MapOptions::CarRouting))
size64 += m_routingSize;
uint32_t const size32 = static_cast<uint32_t>(size64);
ASSERT_EQUAL(size32, size64, ());
diff --git a/platform/local_country_file.hpp b/platform/local_country_file.hpp
index b248f0eaf8..9bf7939781 100644
--- a/platform/local_country_file.hpp
+++ b/platform/local_country_file.hpp
@@ -39,23 +39,23 @@ public:
// Removes specified files from disk if they're known for LocalCountryFile, i.e.
// were found by previous SyncWithDisk() call.
- void DeleteFromDisk(TMapOptions files) const;
+ void DeleteFromDisk(MapOptions files) const;
// Returns path to a file. Return value may be empty until
// SyncWithDisk() is called.
- string GetPath(TMapOptions file) const;
+ string GetPath(MapOptions file) const;
// Returns size of a file. Return value may be zero until
// SyncWithDisk() is called.
- uint32_t GetSize(TMapOptions filesMask) const;
+ uint32_t GetSize(MapOptions filesMask) const;
// Returns a mask of all known country files. Return value may be
// empty until SyncWithDisk() is called.
- inline TMapOptions GetFiles() const { return m_files; }
+ inline MapOptions GetFiles() const { return m_files; }
// Checks whether files specified in filesMask are on disk. Return
// value will be false until SyncWithDisk() is called.
- inline bool OnDisk(TMapOptions filesMask) const
+ inline bool OnDisk(MapOptions filesMask) const
{
return (static_cast<unsigned>(m_files) & static_cast<unsigned>(filesMask)) ==
static_cast<unsigned>(filesMask);
@@ -86,7 +86,7 @@ private:
string m_directory;
CountryFile m_countryFile;
int64_t m_version;
- TMapOptions m_files;
+ MapOptions m_files;
uint64_t m_mapSize;
uint64_t m_routingSize;
diff --git a/platform/local_country_file_utils.cpp b/platform/local_country_file_utils.cpp
index 2f9bf2fdf4..963f9bc63a 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::MapWithCarRouting);
+ localFile.DeleteFromDisk(MapOptions::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::Map;
+ worldFile.m_files = MapOptions::Map;
if (i != localFiles.end())
{
// Always use resource World files instead of local on disk.
@@ -222,7 +222,7 @@ shared_ptr<LocalCountryFile> PreparePlaceForCountryFiles(CountryFile const & cou
return make_shared<LocalCountryFile>(directory, countryFile, version);
}
-ModelReader * GetCountryReader(platform::LocalCountryFile const & file, TMapOptions options)
+ModelReader * GetCountryReader(platform::LocalCountryFile const & file, MapOptions options)
{
Platform & platform = GetPlatform();
// See LocalCountryFile comment for explanation.
diff --git a/platform/local_country_file_utils.hpp b/platform/local_country_file_utils.hpp
index 3bfb199a8e..ef81bf2374 100644
--- a/platform/local_country_file_utils.hpp
+++ b/platform/local_country_file_utils.hpp
@@ -49,7 +49,7 @@ bool ParseVersion(string const & s, int64_t & version);
shared_ptr<LocalCountryFile> PreparePlaceForCountryFiles(CountryFile const & countryFile,
int64_t version);
-ModelReader * GetCountryReader(LocalCountryFile const & file, TMapOptions options);
+ModelReader * GetCountryReader(LocalCountryFile const & file, MapOptions options);
// An API for managing country indexes.
class CountryIndexes
diff --git a/platform/platform_tests/country_file_tests.cpp b/platform/platform_tests/country_file_tests.cpp
index e12d8d5298..991aaf65b7 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::Map), ());
+ TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION, countryFile.GetNameWithExt(MapOptions::Map), ());
TEST_EQUAL("TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION,
- countryFile.GetNameWithExt(TMapOptions::CarRouting), ());
+ countryFile.GetNameWithExt(MapOptions::CarRouting), ());
- 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), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Nothing), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Map), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::CarRouting), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::MapWithCarRouting), ());
countryFile.SetRemoteSizes(1 /* mapSize */, 2 /* routingSize */);
- 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), ());
+ TEST_EQUAL(0, countryFile.GetRemoteSize(MapOptions::Nothing), ());
+ TEST_EQUAL(1, countryFile.GetRemoteSize(MapOptions::Map), ());
+ TEST_EQUAL(2, countryFile.GetRemoteSize(MapOptions::CarRouting), ());
+ TEST_EQUAL(3, countryFile.GetRemoteSize(MapOptions::MapWithCarRouting), ());
}
} // namespace platform
diff --git a/platform/platform_tests/local_country_file_tests.cpp b/platform/platform_tests/local_country_file_tests.cpp
index 148fb03a02..d546cfda2c 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::Map), ());
+ TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION, localFile.GetPath(MapOptions::Map), ());
TEST_EQUAL("/test-dir/TestCountry" DATA_FILE_EXTENSION ROUTING_FILE_EXTENSION,
- localFile.GetPath(TMapOptions::CarRouting), ());
+ localFile.GetPath(MapOptions::CarRouting), ());
// Not synced with disk yet.
- TEST_EQUAL(TMapOptions::Nothing, localFile.GetFiles(), ());
+ TEST_EQUAL(MapOptions::Nothing, localFile.GetFiles(), ());
// Any statement is true about elements of an empty set.
- TEST(localFile.OnDisk(TMapOptions::Nothing), ());
+ TEST(localFile.OnDisk(MapOptions::Nothing), ());
- TEST(!localFile.OnDisk(TMapOptions::Map), ());
- TEST(!localFile.OnDisk(TMapOptions::CarRouting), ());
- TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
+ TEST(!localFile.OnDisk(MapOptions::Map), ());
+ TEST(!localFile.OnDisk(MapOptions::CarRouting), ());
+ TEST(!localFile.OnDisk(MapOptions::MapWithCarRouting), ());
TEST_EQUAL("/test-dir", localFile.GetDirectory(), ());
- 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(0, localFile.GetSize(MapOptions::Nothing), ());
+ TEST_EQUAL(0, localFile.GetSize(MapOptions::Map), ());
+ TEST_EQUAL(0, localFile.GetSize(MapOptions::CarRouting), ());
+ TEST_EQUAL(0, localFile.GetSize(MapOptions::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::Map), ());
- TEST(!localFile.OnDisk(TMapOptions::CarRouting), ());
- TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
+ TEST(!localFile.OnDisk(MapOptions::Map), ());
+ TEST(!localFile.OnDisk(MapOptions::CarRouting), ());
+ TEST(!localFile.OnDisk(MapOptions::MapWithCarRouting), ());
- ScopedFile testMapFile(countryFile.GetNameWithExt(TMapOptions::Map), "map");
+ ScopedFile testMapFile(countryFile.GetNameWithExt(MapOptions::Map), "map");
localFile.SyncWithDisk();
- TEST(localFile.OnDisk(TMapOptions::Map), ());
- TEST(!localFile.OnDisk(TMapOptions::CarRouting), ());
- TEST(!localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
- TEST_EQUAL(3, localFile.GetSize(TMapOptions::Map), ());
+ TEST(localFile.OnDisk(MapOptions::Map), ());
+ TEST(!localFile.OnDisk(MapOptions::CarRouting), ());
+ TEST(!localFile.OnDisk(MapOptions::MapWithCarRouting), ());
+ TEST_EQUAL(3, localFile.GetSize(MapOptions::Map), ());
- ScopedFile testRoutingFile(countryFile.GetNameWithExt(TMapOptions::CarRouting), "routing");
+ ScopedFile testRoutingFile(countryFile.GetNameWithExt(MapOptions::CarRouting), "routing");
localFile.SyncWithDisk();
- 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(localFile.OnDisk(MapOptions::Map), ());
+ TEST(localFile.OnDisk(MapOptions::CarRouting), ());
+ TEST(localFile.OnDisk(MapOptions::MapWithCarRouting), ());
+ TEST_EQUAL(3, localFile.GetSize(MapOptions::Map), ());
+ TEST_EQUAL(7, localFile.GetSize(MapOptions::CarRouting), ());
+ TEST_EQUAL(10, localFile.GetSize(MapOptions::MapWithCarRouting), ());
+
+ localFile.DeleteFromDisk(MapOptions::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::Nothing, japanLocalFile.GetFiles(), ());
+ TEST_EQUAL(MapOptions::Nothing, japanLocalFile.GetFiles(), ());
TEST(!japanMapFile.Exists(), (japanMapFile));
japanMapFile.Reset();
brazilLocalFile.SyncWithDisk();
- TEST_EQUAL(TMapOptions::Nothing, brazilLocalFile.GetFiles(), ());
+ TEST_EQUAL(MapOptions::Nothing, brazilLocalFile.GetFiles(), ());
TEST(!brazilMapFile.Exists(), (brazilMapFile));
brazilMapFile.Reset();
irelandLocalFile.SyncWithDisk();
- TEST_EQUAL(TMapOptions::Map, irelandLocalFile.GetFiles(), ());
- irelandLocalFile.DeleteFromDisk(TMapOptions::Map);
+ TEST_EQUAL(MapOptions::Map, irelandLocalFile.GetFiles(), ());
+ irelandLocalFile.DeleteFromDisk(MapOptions::Map);
TEST(!irelandMapFile.Exists(), (irelandMapFile));
irelandMapFile.Reset();
@@ -216,9 +216,9 @@ UNIT_TEST(LocalCountryFile_DirectoryLookup)
ScopedDir testDir("test-dir");
- ScopedFile testIrelandMapFile(testDir, irelandFile, TMapOptions::Map, "Ireland-map");
- ScopedFile testNetherlandsMapFile(testDir, netherlandsFile, TMapOptions::Map, "Netherlands-map");
- ScopedFile testNetherlandsRoutingFile(testDir, netherlandsFile, TMapOptions::CarRouting,
+ ScopedFile testIrelandMapFile(testDir, irelandFile, MapOptions::Map, "Ireland-map");
+ ScopedFile testNetherlandsMapFile(testDir, netherlandsFile, MapOptions::Map, "Netherlands-map");
+ ScopedFile testNetherlandsRoutingFile(testDir, netherlandsFile, MapOptions::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::Map;
+ expectedIrelandFile.m_files = MapOptions::Map;
LocalCountryFile expectedNetherlandsFile(testDir.GetFullPath(), netherlandsFile, 150309);
- expectedNetherlandsFile.m_files = TMapOptions::MapWithCarRouting;
+ expectedNetherlandsFile.m_files = MapOptions::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::Map, "Italy-map");
+ ScopedFile testItalyMapFile(testDir, italyFile, MapOptions::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::Map), path, ());
+ TEST_EQUAL(file.GetPath(MapOptions::Map), path, ());
}
} // namespace platform
diff --git a/platform/platform_tests_support/scoped_file.cpp b/platform/platform_tests_support/scoped_file.cpp
index 420b972b4f..1f8a6e9340 100644
--- a/platform/platform_tests_support/scoped_file.cpp
+++ b/platform/platform_tests_support/scoped_file.cpp
@@ -27,7 +27,7 @@ ScopedFile::ScopedFile(string const & relativePath, string const & contents)
TEST(Exists(), ("Can't create test file", GetFullPath()));
}
-ScopedFile::ScopedFile(ScopedDir const & dir, CountryFile const & countryFile, TMapOptions file,
+ScopedFile::ScopedFile(ScopedDir const & dir, CountryFile const & countryFile, MapOptions file,
string const & contents)
: ScopedFile(my::JoinFoldersToPath(dir.GetRelativePath(), countryFile.GetNameWithExt(file)),
contents)
diff --git a/platform/platform_tests_support/scoped_file.hpp b/platform/platform_tests_support/scoped_file.hpp
index de5bb1d76a..f55e0722c9 100644
--- a/platform/platform_tests_support/scoped_file.hpp
+++ b/platform/platform_tests_support/scoped_file.hpp
@@ -20,7 +20,7 @@ class ScopedFile
public:
ScopedFile(string const & relativePath, string const & contents);
- ScopedFile(ScopedDir const & dir, CountryFile const & countryFile, TMapOptions file,
+ ScopedFile(ScopedDir const & dir, CountryFile const & countryFile, MapOptions file,
string const & contents);
~ScopedFile();
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp
index 054a76193f..bb85dd4af8 100644
--- a/qt/draw_widget.cpp
+++ b/qt/draw_widget.cpp
@@ -99,7 +99,7 @@ namespace qt
if (opt == -1)
layout.RetryDownloading(idx);
else
- layout.DownloadMap(idx, static_cast<TMapOptions>(opt));
+ layout.DownloadMap(idx, static_cast<MapOptions>(opt));
});
m_framework->SetRouteBuildingListener([] (routing::IRouter::ResultCode, vector<storage::TIndex> const &, vector<storage::TIndex> const &)
diff --git a/qt/update_dialog.cpp b/qt/update_dialog.cpp
index 3131e2a9ee..f8bac35320 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::MapWithCarRouting);
+ m_framework.DownloadCountry(countryIndex, MapOptions::MapWithCarRouting);
if (res == btns[1])
- m_framework.DeleteCountry(countryIndex, TMapOptions::MapWithCarRouting);
+ m_framework.DeleteCountry(countryIndex, MapOptions::MapWithCarRouting);
}
break;
@@ -167,18 +167,18 @@ namespace qt
ask.setDefaultButton(QMessageBox::No);
if (ask.exec() == QMessageBox::Yes)
- m_framework.DeleteCountry(countryIndex, TMapOptions::MapWithCarRouting);
+ m_framework.DeleteCountry(countryIndex, MapOptions::MapWithCarRouting);
}
break;
case TStatus::ENotDownloaded:
case TStatus::EDownloadFailed:
- m_framework.DownloadCountry(countryIndex, TMapOptions::MapWithCarRouting);
+ m_framework.DownloadCountry(countryIndex, MapOptions::MapWithCarRouting);
break;
case TStatus::EInQueue:
case TStatus::EDownloading:
- m_framework.DeleteCountry(countryIndex, TMapOptions::MapWithCarRouting);
+ m_framework.DeleteCountry(countryIndex, MapOptions::MapWithCarRouting);
break;
default:
@@ -247,7 +247,7 @@ namespace qt
QString statusString;
LocalAndRemoteSizeT size(0, 0);
- TMapOptions const options = TMapOptions::MapWithCarRouting;
+ MapOptions const options = MapOptions::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 0d931629e1..557d8027e8 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::MapWithCarRouting))
+ if (localFile && HasOptions(localFile->GetFiles(), MapOptions::MapWithCarRouting))
continue;
LOG(LINFO, ("Needs: ", name));
diff --git a/routing/routing_mapping.cpp b/routing/routing_mapping.cpp
index a5924cfde9..8adeb0d66c 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::CarRouting))
+ ModelReaderPtr r1 = FilesContainerR(localFile.GetPath(MapOptions::CarRouting))
.GetReader(VERSION_FILE_TAG);
ReaderSrc src1(r1.GetPtr());
- ModelReaderPtr r2 = FilesContainerR(localFile.GetPath(TMapOptions::Map))
+ ModelReaderPtr r2 = FilesContainerR(localFile.GetPath(MapOptions::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::MapWithCarRouting))
+ if (!HasOptions(localFile.GetFiles(), MapOptions::MapWithCarRouting))
{
m_handle = MwmSet::MwmHandle();
return;
}
- m_container.Open(localFile.GetPath(TMapOptions::CarRouting));
+ m_container.Open(localFile.GetPath(MapOptions::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 af8011dfc6..8a53732534 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::Map), "map"),
- m_testRoutingFile(m_countryFile.GetNameWithExt(TMapOptions::CarRouting), "routing"),
+ m_testMapFile(m_countryFile.GetNameWithExt(MapOptions::Map), "map"),
+ m_testRoutingFile(m_countryFile.GetNameWithExt(MapOptions::CarRouting), "routing"),
m_localFile(GetPlatform().WritableDir(), m_countryFile, 0 /* version */)
{
m_localFile.SyncWithDisk();
- TEST(m_localFile.OnDisk(TMapOptions::MapWithCarRouting), ());
+ TEST(m_localFile.OnDisk(MapOptions::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::CarRouting));
+ FilesContainerW routingCont(localFile.GetPath(MapOptions::CarRouting));
// Write version for routing file that is equal to correspondent mwm file.
- FilesContainerW mwmCont(localFile.GetPath(TMapOptions::Map));
+ FilesContainerW mwmCont(localFile.GetPath(MapOptions::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 5649670021..2abded6134 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::Map);
+ m_file.DeleteFromDisk(MapOptions::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::Map, file.GetFiles(), ());
+ TEST_EQUAL(MapOptions::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::Map, file.GetFiles(), ());
+ TEST_EQUAL(MapOptions::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 1b1a6eb47b..2ce179888e 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::Map) + EXTENSION_TMP)),
+ make_unique<feature::FeaturesCollector>(file.GetPath(MapOptions::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::Map),
- m_file.GetPath(TMapOptions::Map)),
+ CHECK(indexer::BuildIndexFromDatFile(m_file.GetPath(MapOptions::Map),
+ m_file.GetPath(MapOptions::Map)),
("Can't build geometry index."));
- CHECK(indexer::BuildSearchIndexFromDatFile(m_file.GetPath(TMapOptions::Map),
+ CHECK(indexer::BuildSearchIndexFromDatFile(m_file.GetPath(MapOptions::Map),
true /* forceRebuild */),
("Can't build search index."));
m_file.SyncWithDisk();
diff --git a/storage/country.cpp b/storage/country.cpp
index f9094f023b..9cf2fee815 100644
--- a/storage/country.cpp
+++ b/storage/country.cpp
@@ -10,7 +10,7 @@ using platform::CountryFile;
namespace storage
{
-uint64_t Country::Size(TMapOptions opt) const
+uint64_t Country::Size(MapOptions opt) const
{
uint64_t size = 0;
for (CountryFile const & file : m_files)
@@ -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::Map)));
+ json_object_set_new(jCountry.get(), "s", json_integer(file.GetRemoteSize(MapOptions::Map)));
json_object_set_new(jCountry.get(), "rs",
- json_integer(file.GetRemoteSize(TMapOptions::CarRouting)));
+ json_integer(file.GetRemoteSize(MapOptions::CarRouting)));
}
if (v[i].SiblingsCount())
diff --git a/storage/country.hpp b/storage/country.hpp
index a51997be9d..fd22df70bd 100644
--- a/storage/country.hpp
+++ b/storage/country.hpp
@@ -56,7 +56,7 @@ public:
string const & Name() const { return m_name; }
string const & Flag() const { return m_flag; }
- uint64_t Size(TMapOptions opt) const;
+ uint64_t Size(MapOptions opt) const;
};
typedef SimpleTree<Country> CountriesContainerT;
diff --git a/storage/queued_country.cpp b/storage/queued_country.cpp
index 38210de001..cdc3d46563 100644
--- a/storage/queued_country.cpp
+++ b/storage/queued_country.cpp
@@ -4,17 +4,17 @@
namespace storage
{
-QueuedCountry::QueuedCountry(TIndex const & index, TMapOptions opt)
- : m_index(index), m_init(opt), m_left(opt), m_current(TMapOptions::Nothing)
+QueuedCountry::QueuedCountry(TIndex const & index, MapOptions opt)
+ : m_index(index), m_init(opt), m_left(opt), m_current(MapOptions::Nothing)
{
ASSERT(GetIndex().IsValid(), ("Only valid countries may be downloaded."));
- ASSERT(m_left != TMapOptions::Nothing, ("Empty file set was requested for downloading."));
+ ASSERT(m_left != MapOptions::Nothing, ("Empty file set was requested for downloading."));
SwitchToNextFile();
}
-void QueuedCountry::AddOptions(TMapOptions opt)
+void QueuedCountry::AddOptions(MapOptions opt)
{
- for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting})
{
if (HasOptions(opt, file) && !HasOptions(m_init, file))
{
@@ -24,9 +24,9 @@ void QueuedCountry::AddOptions(TMapOptions opt)
}
}
-void QueuedCountry::RemoveOptions(TMapOptions opt)
+void QueuedCountry::RemoveOptions(MapOptions opt)
{
- for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting})
{
if (HasOptions(opt, file) && HasOptions(m_init, file))
{
@@ -40,13 +40,13 @@ void QueuedCountry::RemoveOptions(TMapOptions opt)
bool QueuedCountry::SwitchToNextFile()
{
- // static_casts are needed here because TMapOptions values are
+ // static_casts are needed here because MapOptions values are
// actually enum flags (see 3party/enum_flags.hpp) and bitwise
// operators are overloaded for them.
ASSERT(HasOptions(m_left, m_current),
("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::Nothing;
+ return m_current != MapOptions::Nothing;
}
} // namespace storage
diff --git a/storage/queued_country.hpp b/storage/queued_country.hpp
index de0f070273..1a74cd9133 100644
--- a/storage/queued_country.hpp
+++ b/storage/queued_country.hpp
@@ -9,23 +9,23 @@ namespace storage
class QueuedCountry
{
public:
- QueuedCountry(TIndex const & index, TMapOptions opt);
+ QueuedCountry(TIndex const & index, MapOptions opt);
- void AddOptions(TMapOptions opt);
- void RemoveOptions(TMapOptions opt);
+ void AddOptions(MapOptions opt);
+ void RemoveOptions(MapOptions opt);
bool SwitchToNextFile();
inline TIndex const & GetIndex() const { return m_index; }
- inline TMapOptions GetInitOptions() const { return m_init; }
- inline TMapOptions GetCurrentFile() const { return m_current; }
- inline TMapOptions GetDownloadedFiles() const { return UnsetOptions(m_init, m_left); }
+ inline MapOptions GetInitOptions() const { return m_init; }
+ inline MapOptions GetCurrentFile() const { return m_current; }
+ inline MapOptions GetDownloadedFiles() const { return UnsetOptions(m_init, m_left); }
inline bool operator==(TIndex const & index) const { return m_index == index; }
private:
TIndex m_index;
- TMapOptions m_init;
- TMapOptions m_left;
- TMapOptions m_current;
+ MapOptions m_init;
+ MapOptions m_left;
+ MapOptions m_current;
};
} // namespace storage
diff --git a/storage/storage.cpp b/storage/storage.cpp
index 2fbf50d73a..d120a5743d 100644
--- a/storage/storage.cpp
+++ b/storage/storage.cpp
@@ -37,12 +37,12 @@ void RemoveIf(vector<T> & v, function<bool(T const & t)> const & p)
v.erase(remove_if(v.begin(), v.end(), p), v.end());
}
-uint64_t GetLocalSize(shared_ptr<LocalCountryFile> file, TMapOptions opt)
+uint64_t GetLocalSize(shared_ptr<LocalCountryFile> file, MapOptions opt)
{
if (!file)
return 0;
uint64_t size = 0;
- for (TMapOptions bit : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions bit : {MapOptions::Map, MapOptions::CarRouting})
{
if (HasOptions(opt, bit))
size += file->GetSize(bit);
@@ -50,10 +50,10 @@ uint64_t GetLocalSize(shared_ptr<LocalCountryFile> file, TMapOptions opt)
return size;
}
-uint64_t GetRemoteSize(CountryFile const & file, TMapOptions opt)
+uint64_t GetRemoteSize(CountryFile const & file, MapOptions opt)
{
uint64_t size = 0;
- for (TMapOptions bit : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions bit : {MapOptions::Map, MapOptions::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::MapWithCarRouting);
+ localFile.DeleteFromDisk(MapOptions::MapWithCarRouting);
++j;
}
@@ -204,7 +204,7 @@ string const & Storage::CountryFlag(TIndex const & index) const
return NodeFromIndex(m_countries, index).Value().Flag();
}
-LocalAndRemoteSizeT Storage::CountrySizeInBytes(TIndex const & index, TMapOptions opt) const
+LocalAndRemoteSizeT Storage::CountrySizeInBytes(TIndex const & index, MapOptions opt) const
{
QueuedCountry const * queuedCountry = FindCountryInQueue(index);
shared_ptr<LocalCountryFile> localFile = GetLatestLocalFile(index);
@@ -282,25 +282,25 @@ TStatus Storage::CountryStatusEx(TIndex const & index) const
return CountryStatusFull(index, CountryStatus(index));
}
-void Storage::CountryStatusEx(TIndex const & index, TStatus & status, TMapOptions & options) const
+void Storage::CountryStatusEx(TIndex const & index, TStatus & status, MapOptions & options) const
{
status = CountryStatusEx(index);
if (status == TStatus::EOnDisk || status == TStatus::EOnDiskOutOfDate)
{
- options = TMapOptions::Map;
+ options = MapOptions::Map;
shared_ptr<LocalCountryFile> localFile = GetLatestLocalFile(index);
ASSERT(localFile, ("Invariant violation: local file out of sync with disk."));
- if (localFile->OnDisk(TMapOptions::CarRouting))
- options = SetOptions(options, TMapOptions::CarRouting);
+ if (localFile->OnDisk(MapOptions::CarRouting))
+ options = SetOptions(options, MapOptions::CarRouting);
}
}
-void Storage::DownloadCountry(TIndex const & index, TMapOptions opt)
+void Storage::DownloadCountry(TIndex const & index, MapOptions opt)
{
opt = NormalizeDownloadFileSet(index, opt);
- if (opt == TMapOptions::Nothing)
+ if (opt == MapOptions::Nothing)
return;
if (QueuedCountry * queuedCountry = FindCountryInQueue(index))
@@ -317,7 +317,7 @@ void Storage::DownloadCountry(TIndex const & index, TMapOptions opt)
NotifyStatusChanged(index);
}
-void Storage::DeleteCountry(TIndex const & index, TMapOptions opt)
+void Storage::DeleteCountry(TIndex const & index, MapOptions opt)
{
opt = NormalizeDeleteFileSet(opt);
DeleteCountryFiles(index, opt);
@@ -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::MapWithCarRouting);
+ localFile.DeleteFromDisk(MapOptions::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::MapWithCarRouting);
+ DeleteCountryFilesFromDownloader(index, MapOptions::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::MapWithCarRouting))
+ if (!DeleteCountryFilesFromDownloader(index, MapOptions::MapWithCarRouting))
return false;
NotifyStatusChanged(index);
return true;
@@ -487,7 +487,7 @@ void Storage::OnServerListDownloaded(vector<string> const & urls)
QueuedCountry const & queuedCountry = m_queue.front();
TIndex const & index = queuedCountry.GetIndex();
- TMapOptions const file = queuedCountry.GetCurrentFile();
+ MapOptions const file = queuedCountry.GetCurrentFile();
vector<string> fileUrls;
fileUrls.reserve(urls.size());
@@ -518,7 +518,7 @@ void Storage::OnMapFileDownloadProgress(MapFilesDownloader::TProgress const & pr
}
}
-bool Storage::RegisterDownloadedFiles(TIndex const & index, TMapOptions files)
+bool Storage::RegisterDownloadedFiles(TIndex const & index, MapOptions files)
{
CountryFile const countryFile = GetCountryFile(index);
shared_ptr<LocalCountryFile> localFile = GetLocalFile(index, GetCurrentDataVersion());
@@ -532,7 +532,7 @@ bool Storage::RegisterDownloadedFiles(TIndex const & index, TMapOptions files)
}
bool ok = true;
- for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting})
{
if (!HasOptions(files, file))
continue;
@@ -553,24 +553,24 @@ bool Storage::RegisterDownloadedFiles(TIndex const & index, TMapOptions files)
return true;
}
-void Storage::OnMapDownloadFinished(TIndex const & index, bool success, TMapOptions files)
+void Storage::OnMapDownloadFinished(TIndex const & index, bool success, MapOptions files)
{
- ASSERT_NOT_EQUAL(TMapOptions::Nothing, files,
+ ASSERT_NOT_EQUAL(MapOptions::Nothing, files,
("This method should not be called for empty files set."));
{
string optionsName;
switch (files)
{
- case TMapOptions::Nothing:
+ case MapOptions::Nothing:
optionsName = "Nothing";
break;
- case TMapOptions::Map:
+ case MapOptions::Map:
optionsName = "Map";
break;
- case TMapOptions::CarRouting:
+ case MapOptions::CarRouting:
optionsName = "CarRouting";
break;
- case TMapOptions::MapWithCarRouting:
+ case MapOptions::MapWithCarRouting:
optionsName = "MapWithCarRouting";
break;
}
@@ -597,7 +597,7 @@ void Storage::OnMapDownloadFinished(TIndex const & index, bool success, TMapOpti
}
string Storage::GetFileDownloadUrl(string const & baseUrl, TIndex const & index,
- TMapOptions file) const
+ MapOptions file) const
{
CountryFile const & countryFile = GetCountryFile(index);
return GetFileDownloadUrl(baseUrl, countryFile.GetNameWithExt(file));
@@ -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::Map))
+ if (!localFile || !localFile->OnDisk(MapOptions::Map))
return TStatus::ENotDownloaded;
CountryFile const & countryFile = GetCountryFile(index);
- if (GetRemoteSize(countryFile, TMapOptions::Map) == 0)
+ if (GetRemoteSize(countryFile, MapOptions::Map) == 0)
return TStatus::EUnknown;
if (localFile->GetVersion() != GetCurrentDataVersion())
@@ -701,14 +701,14 @@ TStatus Storage::CountryStatusFull(TIndex const & index, TStatus const status) c
return TStatus::EOnDisk;
}
-TMapOptions Storage::NormalizeDownloadFileSet(TIndex const & index, TMapOptions opt) const
+MapOptions Storage::NormalizeDownloadFileSet(TIndex const & index, MapOptions opt) const
{
// Car routing files are useless without map files.
- if (HasOptions(opt, TMapOptions::CarRouting))
- opt = SetOptions(opt, TMapOptions::Map);
+ if (HasOptions(opt, MapOptions::CarRouting))
+ opt = SetOptions(opt, MapOptions::Map);
shared_ptr<LocalCountryFile> localCountryFile = GetLatestLocalFile(index);
- for (TMapOptions file : {TMapOptions::Map, TMapOptions::CarRouting})
+ for (MapOptions file : {MapOptions::Map, MapOptions::CarRouting})
{
// Check whether requested files are on disk and up-to-date.
if (HasOptions(opt, file) && localCountryFile && localCountryFile->OnDisk(file) &&
@@ -720,11 +720,11 @@ TMapOptions Storage::NormalizeDownloadFileSet(TIndex const & index, TMapOptions
return opt;
}
-TMapOptions Storage::NormalizeDeleteFileSet(TMapOptions opt) const
+MapOptions Storage::NormalizeDeleteFileSet(MapOptions opt) const
{
// Car routing files are useless without map files.
- if (HasOptions(opt, TMapOptions::Map))
- opt = SetOptions(opt, TMapOptions::CarRouting);
+ if (HasOptions(opt, MapOptions::Map))
+ opt = SetOptions(opt, MapOptions::CarRouting);
return opt;
}
@@ -800,7 +800,7 @@ void Storage::RegisterFakeCountryFiles(platform::LocalCountryFile const & localF
m_localFilesForFakeCountries[fakeCountryLocalFile->GetCountryFile()] = fakeCountryLocalFile;
}
-void Storage::DeleteCountryFiles(TIndex const & index, TMapOptions opt)
+void Storage::DeleteCountryFiles(TIndex const & index, MapOptions opt)
{
auto const it = m_localFiles.find(index);
if (it == m_localFiles.end())
@@ -812,7 +812,7 @@ void Storage::DeleteCountryFiles(TIndex const & index, TMapOptions opt)
localFile->DeleteFromDisk(opt);
localFile->SyncWithDisk();
DeleteCountryIndexes(*localFile);
- if (localFile->GetFiles() == TMapOptions::Nothing)
+ if (localFile->GetFiles() == MapOptions::Nothing)
localFile.reset();
}
auto isNull = [](shared_ptr<LocalCountryFile> const & localFile)
@@ -824,7 +824,7 @@ void Storage::DeleteCountryFiles(TIndex const & index, TMapOptions opt)
m_localFiles.erase(index);
}
-bool Storage::DeleteCountryFilesFromDownloader(TIndex const & index, TMapOptions opt)
+bool Storage::DeleteCountryFilesFromDownloader(TIndex const & index, MapOptions opt)
{
QueuedCountry * queuedCountry = FindCountryInQueue(index);
if (!queuedCountry)
@@ -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::Nothing)
+ if (queuedCountry->GetInitOptions() == MapOptions::Nothing)
m_queue.erase(find(m_queue.begin(), m_queue.end(), index));
if (!m_queue.empty() && m_downloader->IsIdle())
@@ -862,7 +862,7 @@ uint64_t Storage::GetDownloadSize(QueuedCountry const & queuedCountry) const
return GetRemoteSize(file, queuedCountry.GetCurrentFile());
}
-string Storage::GetFileDownloadPath(TIndex const & index, TMapOptions file) const
+string Storage::GetFileDownloadPath(TIndex const & index, MapOptions file) const
{
Platform & platform = GetPlatform();
CountryFile const & countryFile = GetCountryFile(index);
diff --git a/storage/storage.hpp b/storage/storage.hpp
index afe69972da..60c02a4c9b 100644
--- a/storage/storage.hpp
+++ b/storage/storage.hpp
@@ -92,8 +92,8 @@ private:
/// during the downloading process.
void OnMapFileDownloadProgress(MapFilesDownloader::TProgress const & progress);
- bool RegisterDownloadedFiles(TIndex const & index, TMapOptions files);
- void OnMapDownloadFinished(TIndex const & index, bool success, TMapOptions files);
+ bool RegisterDownloadedFiles(TIndex const & index, MapOptions files);
+ void OnMapDownloadFinished(TIndex const & index, bool success, MapOptions files);
/// Initiates downloading of the next file from the queue.
void DownloadNextFile(QueuedCountry const & country);
@@ -130,7 +130,7 @@ public:
string const & CountryName(TIndex const & index) const;
string const & CountryFlag(TIndex const & index) const;
- LocalAndRemoteSizeT CountrySizeInBytes(TIndex const & index, TMapOptions opt) const;
+ LocalAndRemoteSizeT CountrySizeInBytes(TIndex const & index, MapOptions opt) const;
platform::CountryFile const & GetCountryFile(TIndex const & index) const;
shared_ptr<platform::LocalCountryFile> GetLatestLocalFile(
platform::CountryFile const & countryFile) const;
@@ -140,16 +140,16 @@ public:
TStatus CountryStatus(TIndex const & index) const;
/// Slow version, but checks if country is out of date
TStatus CountryStatusEx(TIndex const & index) const;
- void CountryStatusEx(TIndex const & index, TStatus & status, TMapOptions & options) const;
+ void CountryStatusEx(TIndex const & index, TStatus & status, MapOptions & options) const;
/// Puts country denoted by index into the downloader's queue.
/// During downloading process notifies observers about downloading
/// progress and status changes.
- void DownloadCountry(TIndex const & index, TMapOptions opt);
+ void DownloadCountry(TIndex const & index, MapOptions opt);
/// Removes country files (for all versions) from the device.
/// Notifies observers about country status change.
- void DeleteCountry(TIndex const & index, TMapOptions opt);
+ void DeleteCountry(TIndex const & index, MapOptions opt);
/// Removes country files of a particular version from the device.
/// Notifies observers about country status change.
@@ -165,7 +165,7 @@ public:
void NotifyStatusChanged(TIndex const & index);
/// get download url by index & options(first search file name by index, then format url)
- string GetFileDownloadUrl(string const & baseUrl, TIndex const & index, TMapOptions file) const;
+ string GetFileDownloadUrl(string const & baseUrl, TIndex const & index, MapOptions file) const;
/// get download url by base url & file name
string GetFileDownloadUrl(string const & baseUrl, string const & fName) const;
@@ -183,11 +183,11 @@ private:
// Modifies file set of requested files - always adds a map file
// when routing file is requested for downloading, but drops all
// already downloaded and up-to-date files.
- TMapOptions NormalizeDownloadFileSet(TIndex const & index, TMapOptions opt) const;
+ MapOptions NormalizeDownloadFileSet(TIndex const & index, MapOptions opt) const;
// Modifies file set of file to deletion - always adds (marks for
// removal) a routing file when map file is marked for deletion.
- TMapOptions NormalizeDeleteFileSet(TMapOptions opt) const;
+ MapOptions NormalizeDeleteFileSet(MapOptions opt) const;
// Returns a pointer to a country in the downloader's queue.
QueuedCountry * FindCountryInQueue(TIndex const & index);
@@ -220,10 +220,10 @@ private:
void RegisterFakeCountryFiles(platform::LocalCountryFile const & localFile);
// Removes disk files for all versions of a country.
- void DeleteCountryFiles(TIndex const & index, TMapOptions opt);
+ void DeleteCountryFiles(TIndex const & index, MapOptions opt);
// Removes country files from downloader.
- bool DeleteCountryFilesFromDownloader(TIndex const & index, TMapOptions opt);
+ bool DeleteCountryFilesFromDownloader(TIndex const & index, MapOptions opt);
// Returns download size of the currently downloading file for the
// queued country.
@@ -231,6 +231,6 @@ private:
// Returns a path to a place on disk downloader can use for
// downloaded files.
- string GetFileDownloadPath(TIndex const & index, TMapOptions file) const;
+ string GetFileDownloadPath(TIndex const & index, MapOptions file) const;
};
} // storage
diff --git a/storage/storage_tests/queued_country_tests.cpp b/storage/storage_tests/queued_country_tests.cpp
index 33d5940a90..3839399e49 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::CarRouting);
+ QueuedCountry country(index, MapOptions::CarRouting);
TEST_EQUAL(index, country.GetIndex(), ());
- TEST_EQUAL(TMapOptions::CarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetCurrentFile(), ());
- country.AddOptions(TMapOptions::Map);
- TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
+ country.AddOptions(MapOptions::Map);
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetCurrentFile(), ());
TEST(country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Map, country.GetCurrentFile(), ());
TEST(!country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::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::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, MapOptions::MapWithCarRouting);
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetDownloadedFiles(), ());
+
+ country.RemoveOptions(MapOptions::Map);
+ TEST_EQUAL(MapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetDownloadedFiles(), ());
+
+ country.RemoveOptions(MapOptions::CarRouting);
+ TEST_EQUAL(MapOptions::Nothing, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Nothing, 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(), ());
+ QueuedCountry country(index, MapOptions::MapWithCarRouting);
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetDownloadedFiles(), ());
country.SwitchToNextFile();
- 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(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Map, country.GetDownloadedFiles(), ());
+
+ country.RemoveOptions(MapOptions::CarRouting);
+ TEST_EQUAL(MapOptions::Map, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Map, 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(), ());
+ QueuedCountry country(index, MapOptions::MapWithCarRouting);
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Map, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetDownloadedFiles(), ());
country.SwitchToNextFile();
- TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::CarRouting, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::Map, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Map, 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(MapOptions::Map);
+ TEST_EQUAL(MapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetDownloadedFiles(), ());
country.SwitchToNextFile();
- TEST_EQUAL(TMapOptions::CarRouting, country.GetInitOptions(), ());
- TEST_EQUAL(TMapOptions::Nothing, country.GetCurrentFile(), ());
- TEST_EQUAL(TMapOptions::CarRouting, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetInitOptions(), ());
+ TEST_EQUAL(MapOptions::Nothing, country.GetCurrentFile(), ());
+ TEST_EQUAL(MapOptions::CarRouting, country.GetDownloadedFiles(), ());
}
}
@@ -94,13 +94,13 @@ UNIT_TEST(QueuedCountry_Bits)
{
Storage storage;
TIndex const index = storage.FindIndexByFile("USA_Georgia");
- QueuedCountry country(index, TMapOptions::MapWithCarRouting);
- TEST_EQUAL(TMapOptions::Nothing, country.GetDownloadedFiles(), ());
+ QueuedCountry country(index, MapOptions::MapWithCarRouting);
+ TEST_EQUAL(MapOptions::Nothing, country.GetDownloadedFiles(), ());
TEST(country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::Map, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(MapOptions::Map, country.GetDownloadedFiles(), ());
TEST(!country.SwitchToNextFile(), ());
- TEST_EQUAL(TMapOptions::MapWithCarRouting, country.GetDownloadedFiles(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, country.GetDownloadedFiles(), ());
}
} // namespace storage
diff --git a/storage/storage_tests/storage_tests.cpp b/storage/storage_tests/storage_tests.cpp
index 99806dfb82..e3be812cf0 100644
--- a/storage/storage_tests/storage_tests.cpp
+++ b/storage/storage_tests/storage_tests.cpp
@@ -35,7 +35,7 @@ namespace
class CountryDownloaderChecker
{
public:
- CountryDownloaderChecker(Storage & storage, TIndex const & index, TMapOptions files,
+ CountryDownloaderChecker(Storage & storage, TIndex const & index, MapOptions files,
vector<TStatus> const & transitionList)
: m_storage(storage),
m_index(index),
@@ -106,7 +106,7 @@ protected:
Storage & m_storage;
TIndex const m_index;
CountryFile const m_countryFile;
- TMapOptions const m_files;
+ MapOptions const m_files;
int64_t m_bytesDownloaded;
int64_t m_totalBytesToDownload;
int m_slot;
@@ -120,7 +120,7 @@ class CancelDownloadingWhenAlmostDoneChecker : public CountryDownloaderChecker
public:
CancelDownloadingWhenAlmostDoneChecker(Storage & storage, TIndex const & index,
TaskRunner & runner)
- : CountryDownloaderChecker(storage, index, TMapOptions::MapWithCarRouting,
+ : CountryDownloaderChecker(storage, index, MapOptions::MapWithCarRouting,
vector<TStatus>{TStatus::ENotDownloaded, TStatus::EDownloading,
TStatus::ENotDownloaded}),
m_runner(runner)
@@ -151,7 +151,7 @@ protected:
// NotDownloaded -> Downloading -> OnDisk.
unique_ptr<CountryDownloaderChecker> AbsentCountryDownloaderChecker(Storage & storage,
TIndex const & index,
- TMapOptions files)
+ MapOptions files)
{
return make_unique<CountryDownloaderChecker>(
storage, index, files,
@@ -162,7 +162,7 @@ unique_ptr<CountryDownloaderChecker> AbsentCountryDownloaderChecker(Storage & st
// OnDisk -> Downloading -> OnDisk.
unique_ptr<CountryDownloaderChecker> PresentCountryDownloaderChecker(Storage & storage,
TIndex const & index,
- TMapOptions files)
+ MapOptions files)
{
return make_unique<CountryDownloaderChecker>(
storage, index, files,
@@ -173,7 +173,7 @@ unique_ptr<CountryDownloaderChecker> PresentCountryDownloaderChecker(Storage & s
// NotDownloaded -> InQueue -> Downloading -> OnDisk.
unique_ptr<CountryDownloaderChecker> QueuedCountryDownloaderChecker(Storage & storage,
TIndex const & index,
- TMapOptions files)
+ MapOptions files)
{
return make_unique<CountryDownloaderChecker>(
storage, index, files, vector<TStatus>{TStatus::ENotDownloaded, TStatus::EInQueue,
@@ -184,7 +184,7 @@ unique_ptr<CountryDownloaderChecker> QueuedCountryDownloaderChecker(Storage & st
// NotDownloaded -> Downloading -> NotDownloaded.
unique_ptr<CountryDownloaderChecker> CancelledCountryDownloaderChecker(Storage & storage,
TIndex const & index,
- TMapOptions files)
+ MapOptions files)
{
return make_unique<CountryDownloaderChecker>(
storage, index, files,
@@ -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::Map));
+ FileWriter writer(localFile->GetPath(MapOptions::Map));
writer.Write(zeroes.data(), zeroes.size());
}
localFile->SyncWithDisk();
- TEST_EQUAL(TMapOptions::Map, localFile->GetFiles(), ());
- TEST_EQUAL(size, localFile->GetSize(TMapOptions::Map), ());
+ TEST_EQUAL(MapOptions::Map, localFile->GetFiles(), ());
+ TEST_EQUAL(size, localFile->GetSize(MapOptions::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::Map), "USA_Georgia" DATA_FILE_EXTENSION,
+ TEST_EQUAL(usaGeorgiaFile.GetNameWithExt(MapOptions::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::CarRouting),
+ TEST_EQUAL(georgiaFile.GetNameWithExt(MapOptions::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::MapWithCarRouting);
+ storage.DeleteCountry(azerbaijanIndex, MapOptions::MapWithCarRouting);
{
MY_SCOPE_GUARD(cleanupCountryFiles,
- bind(&Storage::DeleteCountry, &storage, azerbaijanIndex, TMapOptions::Map));
+ bind(&Storage::DeleteCountry, &storage, azerbaijanIndex, MapOptions::Map));
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, azerbaijanIndex, TMapOptions::MapWithCarRouting);
+ AbsentCountryDownloaderChecker(storage, azerbaijanIndex, MapOptions::MapWithCarRouting);
checker->StartDownload();
runner.Run();
}
{
MY_SCOPE_GUARD(cleanupCountryFiles, bind(&Storage::DeleteCountry, &storage, azerbaijanIndex,
- TMapOptions::MapWithCarRouting));
+ MapOptions::MapWithCarRouting));
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, azerbaijanIndex, TMapOptions::MapWithCarRouting);
+ AbsentCountryDownloaderChecker(storage, azerbaijanIndex, MapOptions::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::Map);
+ storage.DeleteCountry(uruguayIndex, MapOptions::Map);
MY_SCOPE_GUARD(cleanupUruguayFiles,
- bind(&Storage::DeleteCountry, &storage, uruguayIndex, TMapOptions::Map));
+ bind(&Storage::DeleteCountry, &storage, uruguayIndex, MapOptions::Map));
TIndex const venezuelaIndex = storage.FindIndexByFile("Venezuela");
TEST(venezuelaIndex.IsValid(), ());
- storage.DeleteCountry(venezuelaIndex, TMapOptions::MapWithCarRouting);
+ storage.DeleteCountry(venezuelaIndex, MapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupVenezuelaFiles, bind(&Storage::DeleteCountry, &storage, venezuelaIndex,
- TMapOptions::MapWithCarRouting));
+ MapOptions::MapWithCarRouting));
unique_ptr<CountryDownloaderChecker> uruguayChecker =
- AbsentCountryDownloaderChecker(storage, uruguayIndex, TMapOptions::Map);
+ AbsentCountryDownloaderChecker(storage, uruguayIndex, MapOptions::Map);
unique_ptr<CountryDownloaderChecker> venezuelaChecker =
- QueuedCountryDownloaderChecker(storage, venezuelaIndex, TMapOptions::MapWithCarRouting);
+ QueuedCountryDownloaderChecker(storage, venezuelaIndex, MapOptions::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::MapWithCarRouting);
+ storage.DeleteCountry(index, MapOptions::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::Map);
+ storage.DeleteCountry(index, MapOptions::Map);
localFileV1->SyncWithDisk();
- TEST_EQUAL(TMapOptions::Nothing, localFileV1->GetFiles(), ());
+ TEST_EQUAL(MapOptions::Nothing, localFileV1->GetFiles(), ());
localFileV2->SyncWithDisk();
- TEST_EQUAL(TMapOptions::Nothing, localFileV2->GetFiles(), ());
+ TEST_EQUAL(MapOptions::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::MapWithCarRouting);
+ storage.DeleteCountry(index, MapOptions::MapWithCarRouting);
{
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, index, TMapOptions::MapWithCarRouting);
+ AbsentCountryDownloaderChecker(storage, index, MapOptions::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::MapWithCarRouting, localFileA->GetFiles(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, localFileA->GetFiles(), ());
- storage.DeleteCountry(index, TMapOptions::CarRouting);
+ storage.DeleteCountry(index, MapOptions::CarRouting);
shared_ptr<LocalCountryFile> localFileB = storage.GetLatestLocalFile(index);
TEST(localFileB.get(), ());
TEST_EQUAL(localFileA.get(), localFileB.get(), (*localFileA, *localFileB));
- TEST_EQUAL(TMapOptions::Map, localFileB->GetFiles(), ());
+ TEST_EQUAL(MapOptions::Map, localFileB->GetFiles(), ());
- storage.DeleteCountry(index, TMapOptions::Map);
+ storage.DeleteCountry(index, MapOptions::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::MapWithCarRouting);
+ storage.DeleteCountry(index, MapOptions::MapWithCarRouting);
// Download map file only.
{
unique_ptr<CountryDownloaderChecker> checker =
- AbsentCountryDownloaderChecker(storage, index, TMapOptions::Map);
+ AbsentCountryDownloaderChecker(storage, index, MapOptions::Map);
checker->StartDownload();
runner.Run();
}
shared_ptr<LocalCountryFile> localFileA = storage.GetLatestLocalFile(index);
TEST(localFileA.get(), ());
- TEST_EQUAL(TMapOptions::Map, localFileA->GetFiles(), ());
+ TEST_EQUAL(MapOptions::Map, localFileA->GetFiles(), ());
MwmSet::MwmId id = mwmSet.GetMwmIdByCountryFile(countryFile);
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(MapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
// Download routing file in addition to exising map file.
{
unique_ptr<CountryDownloaderChecker> checker =
- PresentCountryDownloaderChecker(storage, index, TMapOptions::CarRouting);
+ PresentCountryDownloaderChecker(storage, index, MapOptions::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::MapWithCarRouting, localFileB->GetFiles(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, localFileB->GetFiles(), ());
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::MapWithCarRouting, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(MapOptions::MapWithCarRouting, id.GetInfo()->GetLocalFile().GetFiles(), ());
// Delete routing file and check status update.
{
CountryStatusChecker checker(storage, index, TStatus::EOnDisk);
- storage.DeleteCountry(index, TMapOptions::CarRouting);
+ storage.DeleteCountry(index, MapOptions::CarRouting);
}
shared_ptr<LocalCountryFile> localFileC = storage.GetLatestLocalFile(index);
TEST(localFileC.get(), ());
TEST_EQUAL(localFileB.get(), localFileC.get(), (*localFileB, *localFileC));
- TEST_EQUAL(TMapOptions::Map, localFileC->GetFiles(), ());
+ TEST_EQUAL(MapOptions::Map, localFileC->GetFiles(), ());
TEST(id.IsAlive(), ());
- TEST_EQUAL(TMapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(MapOptions::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
// Delete map file and check status update.
{
CountryStatusChecker checker(storage, index, TStatus::ENotDownloaded);
- storage.DeleteCountry(index, TMapOptions::Map);
+ storage.DeleteCountry(index, MapOptions::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::Map, id.GetInfo()->GetLocalFile().GetFiles(), ());
+ TEST_EQUAL(MapOptions::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::MapWithCarRouting);
+ storage.DeleteCountry(index, MapOptions::MapWithCarRouting);
{
unique_ptr<CountryDownloaderChecker> checker =
- CancelledCountryDownloaderChecker(storage, index, TMapOptions::Map);
+ CancelledCountryDownloaderChecker(storage, index, MapOptions::Map);
checker->StartDownload();
- storage.DeleteCountry(index, TMapOptions::MapWithCarRouting);
+ storage.DeleteCountry(index, MapOptions::MapWithCarRouting);
runner.Run();
}
}
@@ -524,21 +524,21 @@ UNIT_TEST(StorageTest_DownloadTwoCountriesAndDelete)
TIndex const uruguayIndex = storage.FindIndexByFile("Uruguay");
TEST(uruguayIndex.IsValid(), ());
- storage.DeleteCountry(uruguayIndex, TMapOptions::MapWithCarRouting);
+ storage.DeleteCountry(uruguayIndex, MapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupUruguayFiles, bind(&Storage::DeleteCountry, &storage, uruguayIndex,
- TMapOptions::MapWithCarRouting));
+ MapOptions::MapWithCarRouting));
TIndex const venezuelaIndex = storage.FindIndexByFile("Venezuela");
TEST(venezuelaIndex.IsValid(), ());
- storage.DeleteCountry(venezuelaIndex, TMapOptions::MapWithCarRouting);
+ storage.DeleteCountry(venezuelaIndex, MapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupVenezuelaFiles, bind(&Storage::DeleteCountry, &storage, venezuelaIndex,
- TMapOptions::MapWithCarRouting));
+ MapOptions::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::MapWithCarRouting,
+ storage, uruguayIndex, MapOptions::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::MapWithCarRouting,
+ storage, venezuelaIndex, MapOptions::MapWithCarRouting,
vector<TStatus>{TStatus::ENotDownloaded, TStatus::EInQueue, TStatus::EDownloading,
TStatus::EDownloading, TStatus::EOnDisk});
uruguayChecker->StartDownload();
venezuelaChecker->StartDownload();
- storage.DeleteCountry(uruguayIndex, TMapOptions::Map);
- storage.DeleteCountry(venezuelaIndex, TMapOptions::CarRouting);
+ storage.DeleteCountry(uruguayIndex, MapOptions::Map);
+ storage.DeleteCountry(venezuelaIndex, MapOptions::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::Map, venezuelaFile->GetFiles(), ());
+ TEST_EQUAL(MapOptions::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::MapWithCarRouting);
+ storage.DeleteCountry(index, MapOptions::MapWithCarRouting);
MY_SCOPE_GUARD(cleanupFiles,
- bind(&Storage::DeleteCountry, &storage, index, TMapOptions::MapWithCarRouting));
+ bind(&Storage::DeleteCountry, &storage, index, MapOptions::MapWithCarRouting));
{
CancelDownloadingWhenAlmostDoneChecker checker(storage, index, runner);