From c9ea450ec5fd459b4062dcb15a603f64f7ead06b Mon Sep 17 00:00:00 2001 From: Vladimir Byko-Ianko Date: Thu, 30 Jul 2015 13:51:24 +0300 Subject: Correction after colleagues comments. Adding unit tests. Some other changes. --- platform/get_text_by_id.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'platform/get_text_by_id.hpp') 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 operator()(string const & textId) const; + string operator()(string const & textId) const; private: + void InitFromJson(string const & jsonBuffer); + unordered_map m_localeTexts; }; } // namespace platform -- cgit v1.2.3