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:
authortatiana-yan <tatiana.kondakova@gmail.com>2019-05-21 19:11:34 +0300
committergmoryes <gmoryes@gmail.com>2019-05-22 11:40:48 +0300
commit04394def48acc692bdf38184c383d47992f2b0b5 (patch)
treefe2b14054f3088fbbe4a3909caf4e7ec4c9b2ba2 /storage
parent670039d1fc6d6707225cb07f5887067c800076d8 (diff)
[tests] Add ContriesNamesTest.
Diffstat (limited to 'storage')
-rw-r--r--storage/storage.cpp7
-rw-r--r--storage/storage.hpp8
2 files changed, 13 insertions, 2 deletions
diff --git a/storage/storage.cpp b/storage/storage.cpp
index ef7a46c117..59da1cbc94 100644
--- a/storage/storage.cpp
+++ b/storage/storage.cpp
@@ -364,6 +364,13 @@ Country const & Storage::CountryByCountryId(CountryId const & countryId) const
return node->Value();
}
+bool Storage::IsNode(CountryId const & countryId) const
+{
+ if (!IsCountryIdValid(countryId))
+ return false;
+ return m_countries.FindFirst(countryId) != nullptr;
+}
+
bool Storage::IsLeaf(CountryId const & countryId) const
{
if (!IsCountryIdValid(countryId))
diff --git a/storage/storage.hpp b/storage/storage.hpp
index 2686f2a308..fcb398ac2d 100644
--- a/storage/storage.hpp
+++ b/storage/storage.hpp
@@ -536,9 +536,13 @@ public:
CountryId FindCountryIdByFile(string const & name) const;
- // These two functions check whether |countryId| is a leaf
- // or an inner node of the country tree.
+ // Returns true iff |countryId| exists as a node in the tree.
+ bool IsNode(CountryId const & countryId) const;
+
+ // Returns true iff |countryId| is a leaf of the tree.
bool IsLeaf(CountryId const & countryId) const;
+
+ // Returns true iff |countryId| is an inner node of the tree.
bool IsInnerNode(CountryId const & countryId) const;
LocalAndRemoteSize CountrySizeInBytes(CountryId const & countryId, MapOptions opt) const;