| 2004 | } |
| 2005 | |
| 2006 | BookmarkManager::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 | |
| 2030 | void BookmarkManager::LoadBookmarks() |
| 2031 | { |
nothing calls this directly
no test coverage detected