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

Function SaveToXml

libs/editor/editor_notes.cpp:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void SaveToXml(std::list<editor::Note> const & notes, pugi::xml_document & xml, uint32_t const uploadedNotesCount)
59{
60 auto constexpr kDigitsAfterComma = 7;
61 auto root = xml.append_child("notes");
62 root.append_attribute("uploadedNotesCount") = uploadedNotesCount;
63 for (auto const & note : notes)
64 {
65 auto node = root.append_child("note");
66
67 node.append_attribute("lat") = strings::to_string_dac(note.m_point.m_lat, kDigitsAfterComma).data();
68 node.append_attribute("lon") = strings::to_string_dac(note.m_point.m_lon, kDigitsAfterComma).data();
69 node.append_attribute("text") = note.m_note.data();
70 }
71}
72
73/// Not thread-safe, use only for initialization.
74bool Load(std::string const & fileName, std::list<editor::Note> & notes, uint32_t & uploadedNotesCount)

Callers 1

SaveFunction · 0.85

Calls 2

to_string_dacFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected