MCPcopy Create free account
hub / github.com/comaps/comaps / LoadBookmarks

Method LoadBookmarks

libs/map/bookmark_manager.cpp:2006–2028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2004}
2005
2006BookmarkManager::KMLDataCollectionPtr BookmarkManager::LoadBookmarks(std::string const & dir, std::string_view ext,
2007 KmlFileType fileType,
2008 BookmarksChecker const & checker)
2009{
2010 Platform::FilesList files;
2011 Platform::GetFilesByExt(dir, ext, files);
2012
2013 auto collection = std::make_shared<KMLDataCollection>();
2014 collection->reserve(files.size());
2015 for (auto const & file : files)
2016 {
2017 auto const filePath = base::JoinPath(dir, file);
2018 auto kmlData = LoadKmlFile(filePath, fileType);
2019 if (kmlData == nullptr)
2020 continue;
2021 if (checker && !checker(*kmlData))
2022 continue;
2023 if (m_needTeardown)
2024 break;
2025 collection->emplace_back(filePath, std::move(kmlData));
2026 }
2027 return collection;
2028}
2029
2030void BookmarkManager::LoadBookmarks()
2031{

Callers

nothing calls this directly

Calls 7

JoinPathFunction · 0.85
LoadKmlFileFunction · 0.85
GetBookmarksDirectoryFunction · 0.85
RunTaskMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected