1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#pragma once
#include "map/bookmark.hpp"
#include "indexer/feature.hpp"
#include "coding/reader.hpp"
#include "geometry/rect2d.hpp"
#include <memory>
#include <string>
extern std::string const kKmzExtension;
extern std::string const kKmlExtension;
extern std::string const kKmbExtension;
class User;
enum class KmlFileType
{
Text,
Binary
};
inline std::string DebugPrint(KmlFileType fileType)
{
switch (fileType)
{
case KmlFileType::Text: return "Text";
case KmlFileType::Binary: return "Binary";
}
UNREACHABLE();
}
std::unique_ptr<kml::FileData> LoadKmlFile(std::string const & file, KmlFileType fileType);
std::unique_ptr<kml::FileData> LoadKmzFile(std::string const & file, std::string & kmlHash);
std::unique_ptr<kml::FileData> LoadKmlData(Reader const & reader, KmlFileType fileType);
bool SaveKmlFile(kml::FileData & kmlData, std::string const & file, KmlFileType fileType);
bool SaveKmlData(kml::FileData & kmlData, Writer & writer, KmlFileType fileType);
void ResetIds(kml::FileData & kmlData);
void SaveFeatureTypes(feature::TypesHolder const & types, kml::BookmarkData & bmData);
std::string GetPreferredBookmarkName(kml::BookmarkData const & bmData);
std::string GetPreferredBookmarkStr(kml::LocalizableString const & name);
std::string GetPreferredBookmarkStr(kml::LocalizableString const & name, feature::RegionData const & regionData);
std::string GetLocalizedBookmarkType(std::vector<uint32_t> const & types);
bool FromCatalog(kml::FileData const & kmlData);
bool FromCatalog(kml::CategoryData const & categoryData, std::string const & serverId);
bool IsMyCategory(std::string const & userId, kml::CategoryData const & categoryData);
bool IsMyCategory(User const & user, kml::CategoryData const & categoryData);
void ExpandBookmarksRectForPreview(m2::RectD & rect);
|