diff options
author | Alex Zolotarev <alex@mapswithme.com> | 2014-01-28 15:29:31 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:10:43 +0300 |
commit | 2c940c20ad76f283327bce9cf7488edf100cf639 (patch) | |
tree | f50677795e05dae7813bdd29a45620fb6fe230d7 /coding/multilang_utf8_string.cpp | |
parent | d9d52789c11a65637a084316ff9e8f720a42665e (diff) |
[android] Fixed compilation on gcc 4.6
Diffstat (limited to 'coding/multilang_utf8_string.cpp')
-rw-r--r-- | coding/multilang_utf8_string.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/coding/multilang_utf8_string.cpp b/coding/multilang_utf8_string.cpp index d63413555c..84353d0cae 100644 --- a/coding/multilang_utf8_string.cpp +++ b/coding/multilang_utf8_string.cpp @@ -81,3 +81,25 @@ bool StringUtf8Multilang::GetString(int8_t lang, string & utf8s) const return false; } + +namespace +{ +struct Printer +{ + string & m_out; + Printer(string & out) : m_out(out) {} + bool operator()(int8_t code, string const & name) const + { + m_out += string(StringUtf8Multilang::GetLangByCode(code)) + string(":") + name + " "; + return true; + } +}; +} // namespace + +string DebugPrint(StringUtf8Multilang const & s) +{ + string out; + Printer printer(out); + s.ForEachRef(printer); + return out; +} |