| 56 | } |
| 57 | |
| 58 | void 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. |
| 74 | bool Load(std::string const & fileName, std::list<editor::Note> & notes, uint32_t & uploadedNotesCount) |
no test coverage detected