| 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 | { |
no outgoing calls
no test coverage detected