Get reading of pointing detailed path to sound-strings for Platform::GetReader.

This commit is contained in:
Vladimir Byko-Ianko 2015-10-14 14:56:45 +03:00
parent 12fd9dc7a1
commit 63ad289b25
2 changed files with 8 additions and 12 deletions

View file

@ -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));

View file

@ -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