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

Function get_valid_length

Tools/EditorFramework/pugixml.cpp:2998–3006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2996
2997#ifdef PUGIXML_WCHAR_MODE
2998PUGI__FN size_t get_valid_length(const char_t* data, size_t length)
2999{
3000 assert(length > 0);
3001
3002 // discard last character if it's the lead of a surrogate pair
3003 return (sizeof(wchar_t) == 2 && static_cast<unsigned int>(static_cast<uint16_t>(data[length - 1]) - 0xD800) < 0x400)
3004 ? length - 1
3005 : length;
3006}
3007
3008PUGI__FN size_t convert_buffer(
3009 char_t* r_char,

Callers 1

writeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected