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

Function ExportSingleFileGpx

libs/map/bookmark_manager.cpp:116–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116BookmarkManager::SharingResult ExportSingleFileGpx(
117 BookmarkManager::KMLDataCollectionPtr::element_type::value_type const & kmlToShare)
118{
119 std::string const fileName = GetFileNameForExport(kmlToShare);
120 auto filePath = base::JoinPath(GetPlatform().TmpDir(), fileName + std::string{kGpxExtension});
121 auto const categoryId = kmlToShare.second->m_categoryData.m_id;
122 if (!SaveKmlFileSafe(*kmlToShare.second, filePath, KmlFileType::Gpx))
123 return {{categoryId}, BookmarkManager::SharingResult::Code::FileError, "Bookmarks file does not exist."};
124 return {{categoryId}, std::move(filePath), kGPXMimeType};
125}
126
127std::string BuildIndexFile(std::vector<std::string> const & filesForIndex)
128{

Callers 1

GetFileForSharingFunction · 0.85

Calls 4

GetFileNameForExportFunction · 0.85
JoinPathFunction · 0.85
SaveKmlFileSafeFunction · 0.85
TmpDirMethod · 0.80

Tested by

no test coverage detected