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-10-14 14:56:45 +0300
committerVladimir Byko-Ianko <v.bykoianko@corp.mail.ru>2015-10-14 14:56:45 +0300
commit63ad289b25b44ce08b409be3ca1b7f36125d9d37 (patch)
tree56577c9b34d2bbe92295e138b7e1cee269761975 /platform
parent12fd9dc7a1fd9d3fddf0cf88db0ffe0bf28e89d5 (diff)
Get reading of pointing detailed path to sound-strings for Platform::GetReader.
Diffstat (limited to 'platform')
-rw-r--r--platform/get_text_by_id.cpp16
-rw-r--r--platform/get_text_by_id.hpp4
2 files changed, 8 insertions, 12 deletions
diff --git a/platform/get_text_by_id.cpp b/platform/get_text_by_id.cpp
index 4a2ebafb95..f60be22468 100644
--- a/platform/get_text_by_id.cpp
+++ b/platform/get_text_by_id.cpp
@@ -15,23 +15,18 @@ string const kDefaultLanguage = "en";
string GetTextSourceString(platform::TextSource textSource)
{
-#if defined(OMIM_OS_ANDROID) || defined(OMIM_OS_IPHONE)
switch (textSource)
{
case platform::TextSource::TtsSound:
- return "sound-strings";
+ return string("sound-strings");
}
-#else
- switch (textSource)
- {
- case platform::TextSource::TtsSound:
- return "../data/sound-strings";
- }
-#endif
ASSERT(false, ());
return string();
}
+} // namespace
+namespace platform
+{
bool GetJsonBuffer(platform::TextSource textSource, string const & localeName, string & jsonBuffer)
{
string const pathToJson = my::JoinFoldersToPath(
@@ -50,10 +45,7 @@ bool GetJsonBuffer(platform::TextSource textSource, string const & localeName, s
}
return true;
}
-} // namespace
-namespace platform
-{
TGetTextByIdPtr MakeGetTextById(string const & jsonBuffer, string const & localeName)
{
TGetTextByIdPtr result(new GetTextById(jsonBuffer, localeName));
diff --git a/platform/get_text_by_id.hpp b/platform/get_text_by_id.hpp
index 9a6fd38467..b153617820 100644
--- a/platform/get_text_by_id.hpp
+++ b/platform/get_text_by_id.hpp
@@ -50,4 +50,8 @@ private:
/// * a factory returns nullptr
TGetTextByIdPtr GetTextByIdFactory(TextSource textSource, string const & localeName);
TGetTextByIdPtr ForTestingGetTextByIdFactory(string const & jsonBuffer, string const & localeName);
+
+/// \bried fills jsonBuffer with json file in twine format with strings in a language of localeName.
+/// @return true if no error was happened and false otherwise.
+bool GetJsonBuffer(platform::TextSource textSource, string const & localeName, string & jsonBuffer);
} // namespace platform