diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2018-03-23 19:05:10 +0300 |
---|---|---|
committer | Roman Kuznetsov <r.kuznetsow@gmail.com> | 2018-04-06 15:59:42 +0300 |
commit | 71298a534e5fe5f00785d1897c8715afc23cb68f (patch) | |
tree | d458dd7934b8e96d25d45f69be3c9cf6815401d9 /kml | |
parent | 59797a467ca935ab43dca4b3386de6db0088a99a (diff) |
Support new KMB format.
Diffstat (limited to 'kml')
-rw-r--r-- | kml/type_utils.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kml/type_utils.hpp b/kml/type_utils.hpp index 85782b16e8..87afae88a5 100644 --- a/kml/type_utils.hpp +++ b/kml/type_utils.hpp @@ -66,6 +66,18 @@ double constexpr kMinRating = 0.0; double constexpr kMaxRating = 10.0; uint32_t constexpr kRatingBits = 30; +int8_t constexpr kDefaultLangCode = 0; + +inline std::string GetDefaultStr(LocalizableString const & str) +{ + return (str.empty() || str.find(kDefaultLangCode) == str.end()) ? "" : str.at(kDefaultLangCode); +} + +inline void SetDefaultStr(LocalizableString & localizableStr, std::string const & str) +{ + localizableStr[kDefaultLangCode] = str; +} + #define DECLARE_COLLECTABLE(IndexType, ...) \ IndexType m_collectionIndex; \ template <typename Collector> \ |