MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / get_valid_length

Function get_valid_length

lib/pugixml/src/pugixml.cpp:3606–3612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3604
3605#ifdef PUGIXML_WCHAR_MODE
3606 PUGI__FN size_t get_valid_length(const char_t* data, size_t length)
3607 {
3608 if (length < 1) return 0;
3609
3610 // discard last character if it's the lead of a surrogate pair
3611 return (sizeof(wchar_t) == 2 && static_cast<unsigned int>(static_cast<uint16_t>(data[length - 1]) - 0xD800) < 0x400) ? length - 1 : length;
3612 }
3613
3614 PUGI__FN size_t convert_buffer_output(char_t* r_char, uint8_t* r_u8, uint16_t* r_u16, uint32_t* r_u32, const char_t* data, size_t length, xml_encoding encoding)
3615 {

Callers 2

write_directMethod · 0.85
write_stringMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected