//////////////////////////////////////////////////////////////////
| 77 | |
| 78 | /////////////////////////////////////////////////////////////////////// |
| 79 | std::string escapeJSON(Exiv2::ExifData::const_iterator it, bool bValue = true) { |
| 80 | std::string result; |
| 81 | |
| 82 | std::ostringstream os; |
| 83 | if (bValue) |
| 84 | os << it->value(); |
| 85 | else |
| 86 | os << it->key(); |
| 87 | |
| 88 | std::string s = os.str(); |
| 89 | for (auto&& c : s) { |
| 90 | if (c == '"') |
| 91 | result += "\\\""; |
| 92 | result += c; |
| 93 | } |
| 94 | |
| 95 | std::string q = "\""; |
| 96 | return q + result + q; |
| 97 | } |
| 98 | |
| 99 | std::string formatJSON(Exiv2::ExifData& exifData) { |
| 100 | size_t count = 0; |