diff options
Diffstat (limited to 'indexer/classificator.cpp')
-rw-r--r-- | indexer/classificator.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/indexer/classificator.cpp b/indexer/classificator.cpp index 2c0a4c6e29..736d46e3b0 100644 --- a/indexer/classificator.cpp +++ b/indexer/classificator.cpp @@ -424,35 +424,8 @@ bool ClassifObject::IsDrawableLike(FeatureGeoType ft) const return false; } -namespace -{ - bool LoadFileToString(char const * fPath, string & buffer) - { - try - { - FileReader reader(fPath); - size_t const sz = static_cast<size_t>(reader.Size()); - if (sz > 0) - { - buffer.resize(sz); - reader.Read(0, &buffer[0], sz); - return true; - } - } - catch (FileReader::OpenException const &) - { - // It's OK. Just return false. - } - return false; - } -} - -bool Classificator::ReadClassificator(char const * fPath) +void Classificator::ReadClassificator(string const & buffer) { - string buffer; - if (!LoadFileToString(fPath, buffer)) - return false; - istringstream iss(buffer); m_root.Clear(); @@ -461,7 +434,6 @@ bool Classificator::ReadClassificator(char const * fPath) tree::LoadTreeAsText(iss, policy); m_root.Sort(); - return true; } void Classificator::PrintClassificator(char const * fPath) @@ -477,18 +449,12 @@ void Classificator::PrintClassificator(char const * fPath) #endif } -bool Classificator::ReadVisibility(char const * fPath) +void Classificator::ReadVisibility(string const & buffer) { - string buffer; - if (!LoadFileToString(fPath, buffer)) - return false; - istringstream iss(buffer); ClassifObject::VisLoadPolicy policy(&m_root); tree::LoadTreeAsText(iss, policy); - - return true; } void Classificator::PrintVisibility(char const * fPath) |