blob: 58728054752a68d711e67db54f8b2ded04d67f20 (
about) (
plain) (
blame)
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
|
export module routemon:gpx;
import std;
import :geo;
import :util;
import :xml;
namespace routemon::gpx {
struct metadata
{
std::optional<std::string> name;
std::optional<std::string> desc;
};
struct track_segment
{
geo::linestring waypoints;
};
struct track
{
std::optional<std::string> name;
std::optional<std::string> desc;
std::vector<track_segment> segments;
};
struct file
{
std::string creator;
metadata meta;
std::vector<track> tracks;
};
class reader
{
xml::executor e_;
xml::parser<file> p_;
public:
explicit reader();
auto init() -> void;
auto put(std::string_view buf) -> void;
[[nodiscard]] auto finish() -> gpx::file;
};
} // namespace routemon::gpx
|