diff options
Diffstat (limited to 'platform/get_text_by_id.hpp')
-rw-r--r-- | platform/get_text_by_id.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/platform/get_text_by_id.hpp b/platform/get_text_by_id.hpp new file mode 100644 index 0000000000..d5dba5bc53 --- /dev/null +++ b/platform/get_text_by_id.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include <std/string.hpp> +#include <std/unordered_map.hpp> + + +namespace platform +{ + +/// GetTextById represents text messages which are saved in textsDir +/// in a specified locale. +class GetTextById +{ +public: + GetTextById(string const & textsDir, string const & localeName); + + bool IsValid() const { return !m_localeTexts.empty(); } + string operator()(string const & textId) const; + +private: + unordered_map<string, string> m_localeTexts; +}; +} // namespace platform |