| 125 | } |
| 126 | |
| 127 | std::string BuildIndexFile(std::vector<std::string> const & filesForIndex) |
| 128 | { |
| 129 | std::string const filePath = base::JoinPath(GetPlatform().TmpDir(), "doc.kml"); |
| 130 | FileWriter fileWriter(filePath); |
| 131 | std::string content = |
| 132 | "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" |
| 133 | "<kml xmlns=\"http://earth.google.com/kml/2.0\">\n" |
| 134 | "<Document>\n" |
| 135 | "<name>CoMaps Bookmarks and Tracks</name>\n"; |
| 136 | for (auto const & fileName : filesForIndex) |
| 137 | { |
| 138 | content.append("<NetworkLink><name>"); |
| 139 | content.append(base::GetNameFromFullPathWithoutExt(fileName)); |
| 140 | content.append("</name><Link><href>"); |
| 141 | content.append(fileName); |
| 142 | content.append("</href></Link></NetworkLink>\n"); |
| 143 | } |
| 144 | content.append( |
| 145 | "</Document>\n" |
| 146 | "</kml>"); |
| 147 | fileWriter.Write(content.c_str(), content.length()); |
| 148 | return filePath; |
| 149 | } |
| 150 | |
| 151 | BookmarkManager::SharingResult ExportMultipleFiles(BookmarkManager::KMLDataCollectionPtr collection) |
| 152 | { |
no test coverage detected