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:
authorvng <viktor.govako@gmail.com>2012-08-16 19:08:24 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:41:59 +0300
commit73b11cd8d57388d167c6143301e8183e68b103de (patch)
tree70b4ae00ec20c6eb988845a220578b5a62bbb61b /indexer
parent383cd6fbcb7a515f0b2f86d19fa47911760f9cfd (diff)
[search] Implement additional search around locality (like address).
Diffstat (limited to 'indexer')
-rw-r--r--indexer/feature.cpp12
-rw-r--r--indexer/feature.hpp8
2 files changed, 15 insertions, 5 deletions
diff --git a/indexer/feature.cpp b/indexer/feature.cpp
index d2c387704e..87b3e6bf8e 100644
--- a/indexer/feature.cpp
+++ b/indexer/feature.cpp
@@ -290,14 +290,16 @@ void FeatureType::GetPreferredDrawableNames(string & defaultName, string & intNa
}
}
-uint32_t FeatureType::GetPopulation() const
+uint8_t FeatureType::GetRank() const
{
ParseCommon();
+ return m_Params.rank;
+}
- if (m_Params.rank == 0)
- return 1;
-
- return static_cast<uint32_t>(pow(1.1, m_Params.rank));
+uint32_t FeatureType::GetPopulation() const
+{
+ uint8_t const r = GetRank();
+ return (r == 0 ? 1 : static_cast<uint32_t>(pow(1.1, r)));
}
double FeatureType::GetPopulationDrawRank() const
diff --git a/indexer/feature.hpp b/indexer/feature.hpp
index 13fbd1df8f..c4d2e10b78 100644
--- a/indexer/feature.hpp
+++ b/indexer/feature.hpp
@@ -60,6 +60,8 @@ public:
return (Header() & feature::HEADER_HAS_NAME) != 0;
}
+ // Array with 64 strings ??? Use ForEachName instead!
+ /*
class GetNamesFn
{
public:
@@ -75,6 +77,7 @@ public:
return true;
}
};
+ */
template <class T>
inline bool ForEachNameRef(T & functor) const
@@ -222,8 +225,13 @@ public:
void GetPrefferedNames(string & defaultName, string & intName) const;
/// Additional - take into account house number for defaultName
void GetPreferredDrawableNames(string & defaultName, string & intName) const;
+ inline bool GetName(int8_t lang, string & name) const
+ {
+ return m_Params.name.GetString(lang, name);
+ }
//@}
+ uint8_t GetRank() const;
uint32_t GetPopulation() const;
double GetPopulationDrawRank() const;