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:
authorVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2015-07-30 13:51:24 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:58:49 +0300
commitc9ea450ec5fd459b4062dcb15a603f64f7ead06b (patch)
tree6a1df5edfbd90351785554e942c8847a20f38814 /platform/get_text_by_id.hpp
parent4d1f0e8ef4cb0a2f2cfb4ee289938b28ee0745e4 (diff)
Correction after colleagues comments. Adding unit tests. Some other changes.
Diffstat (limited to 'platform/get_text_by_id.hpp')
-rw-r--r--platform/get_text_by_id.hpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/get_text_by_id.hpp b/platform/get_text_by_id.hpp
index b70bac0cec..45c8fdb5e5 100644
--- a/platform/get_text_by_id.hpp
+++ b/platform/get_text_by_id.hpp
@@ -19,14 +19,18 @@ class GetTextById
{
public:
GetTextById(TextSource textSouce, string const & localeName);
+ /// The constructor is used for writing unit tests only.
+ GetTextById(string const & jsonBuffer);
bool IsValid() const { return !m_localeTexts.empty(); }
/// @return a pair of a text string in a specified locale for textId and a boolean flag.
/// If textId is found in m_localeTexts then the boolean flag is set to true.
/// The boolean flag is set to false otherwise.
- pair<string, bool> operator()(string const & textId) const;
+ string operator()(string const & textId) const;
private:
+ void InitFromJson(string const & jsonBuffer);
+
unordered_map<string, string> m_localeTexts;
};
} // namespace platform