| 7307 | } |
| 7308 | |
| 7309 | PUGI__FN void translate(char_t* buffer, const char_t* from, const char_t* to) |
| 7310 | { |
| 7311 | size_t to_length = strlength(to); |
| 7312 | |
| 7313 | char_t* write = buffer; |
| 7314 | |
| 7315 | while (*buffer) |
| 7316 | { |
| 7317 | PUGI__DMC_VOLATILE char_t ch = *buffer++; |
| 7318 | |
| 7319 | const char_t* pos = find_char(from, ch); |
| 7320 | |
| 7321 | if (!pos) |
| 7322 | *write++ = ch; // do not process |
| 7323 | else if (static_cast<size_t>(pos - from) < to_length) |
| 7324 | *write++ = to[pos - from]; // replace |
| 7325 | } |
| 7326 | |
| 7327 | // zero-terminate |
| 7328 | *write = 0; |
| 7329 | } |
| 7330 | |
| 7331 | struct xpath_variable_boolean : xpath_variable |
| 7332 | { |
no test coverage detected