コード例 #1
0
ファイル: feature_vec_model.cpp プロジェクト: alexz89ua/omim
pair<MwmSet::MwmId, MwmSet::RegResult> FeaturesFetcher::RegisterMap(
    LocalCountryFile const & localFile)
{
  try
  {
    auto result = m_multiIndex.RegisterMap(localFile);
    if (result.second != MwmSet::RegResult::Success)
    {
      LOG(LWARNING, ("Can't add map", localFile.GetCountryName(), "(", result.second, ").",
                     "Probably it's already added or has newer data version."));
    }
    else
    {
      MwmSet::MwmId const & id = result.first;
      ASSERT(id.IsAlive(), ());
      m_rect.Add(id.GetInfo()->m_limitRect);
    }

    return result;
  }
  catch (RootException const & ex)
  {
    LOG(LERROR, ("IO error while adding", localFile.GetCountryName(), "map.", ex.Msg()));
    return make_pair(MwmSet::MwmId(), MwmSet::RegResult::BadFile);
  }
}
コード例 #2
0
  void GenerateVersionSections(LocalCountryFile const & localFile)
  {
    FilesContainerW routingCont(localFile.GetPath(MapOptions::CarRouting));
    // Write version for routing file that is equal to correspondent mwm file.
    FilesContainerW mwmCont(localFile.GetPath(MapOptions::Map));

    FileWriter w1 = routingCont.GetWriter(VERSION_FILE_TAG);
    FileWriter w2 = mwmCont.GetWriter(VERSION_FILE_TAG);
    version::WriteVersion(w1, my::TodayAsYYMMDD());
    version::WriteVersion(w2, my::TodayAsYYMMDD());
  }
コード例 #3
0
  // static
  unique_ptr<FeaturesOffsetsTable> FeaturesOffsetsTable::CreateIfNotExistsAndLoad(
      LocalCountryFile const & localFile)
  {
    string const offsetsFilePath = CountryIndexes::GetPath(localFile, CountryIndexes::Index::Offsets);

    if (Platform::IsFileExistsByFullPath(offsetsFilePath))
      return LoadImpl(offsetsFilePath);

    return CreateImpl(localFile, FilesContainerR(localFile.GetPath(MapOptions::Map)), offsetsFilePath);
  }
コード例 #4
0
ファイル: storage.cpp プロジェクト: alexz89ua/omim
void DeleteFromDiskWithIndexes(LocalCountryFile const & localFile, MapOptions options)
{
  DeleteCountryIndexes(localFile);
  localFile.DeleteFromDisk(options);
}