| 592 | } |
| 593 | |
| 594 | std::string ExportKml(FileData const & fileData) |
| 595 | { |
| 596 | std::string resultBuffer; |
| 597 | try |
| 598 | { |
| 599 | MemWriter<decltype(resultBuffer)> sink(resultBuffer); |
| 600 | kml::SerializerKml ser(fileData); |
| 601 | ser.Serialize(sink); |
| 602 | } |
| 603 | catch (kml::SerializerKml::SerializeException const & exc) |
| 604 | { |
| 605 | throw std::runtime_error(std::string("Export error: ") + exc.what()); |
| 606 | } |
| 607 | return resultBuffer; |
| 608 | } |
| 609 | |
| 610 | FileData ImportKml(std::string const & str) |
| 611 | { |