| 81 | // Convert a string to a form suitable for XML output |
| 82 | |
| 83 | static std::string |
| 84 | escape_string (const char *cp) |
| 85 | { |
| 86 | std::string r; |
| 87 | r.reserve (strlen (cp) * 2); |
| 88 | while (*cp) { |
| 89 | if (*cp == '&') { |
| 90 | r += "&"; |
| 91 | } else if (*cp == '<') { |
| 92 | r += "<"; |
| 93 | } else if (*cp == '>') { |
| 94 | r += ">"; |
| 95 | } else { |
| 96 | r += *cp; |
| 97 | } |
| 98 | ++cp; |
| 99 | } |
| 100 | return r; |
| 101 | } |
| 102 | |
| 103 | // -------------------------------------------------------------- |
| 104 | // Widget to path conversion and back |
no test coverage detected