MCPcopy Create free account
hub / github.com/MyGUI/mygui / translate

Function translate

Tools/EditorFramework/pugixml.cpp:7309–7329  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7307}
7308
7309PUGI__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
7331struct xpath_variable_boolean : xpath_variable
7332{

Callers 1

eval_stringMethod · 0.70

Calls 2

strlengthFunction · 0.70
find_charFunction · 0.70

Tested by

no test coverage detected