Lines Matching refs:bytes

72   result.bytes = 1;  in EncodeCharacter()
81 result.bytes = 1; in EncodeCharacter()
85 result.bytes = 2; in EncodeCharacter()
90 result.bytes = 3; in EncodeCharacter()
98 result.bytes = 4; in EncodeCharacter()
105 result.bytes = 5; in EncodeCharacter()
113 result.bytes = 6; in EncodeCharacter()
134 result.append(encoded.buffer, static_cast<std::size_t>(encoded.bytes)); in EncodeString()
148 const char *cp, std::size_t bytes) { in DecodeRawCharacter() argument
149 if (bytes >= 1) { in DecodeRawCharacter()
158 const char *cp, std::size_t bytes) { in DecodeRawCharacter() argument
163 } else if ((ch & 0xf8) == 0xf0 && bytes >= 4 && ch > 0xf0 && in DecodeRawCharacter()
169 } else if ((ch & 0xf0) == 0xe0 && bytes >= 3 && ch > 0xe0 && in DecodeRawCharacter()
174 } else if ((ch & 0xe0) == 0xc0 && bytes >= 2 && ch > 0xc0 && in DecodeRawCharacter()
184 const char *cp, std::size_t bytes) { in DecodeEscapedCharacter() argument
185 if (cp[0] == '\\' && bytes >= 2) { in DecodeEscapedCharacter()
189 std::size_t maxLen{std::min(std::size_t{4}, bytes)}; in DecodeEscapedCharacter()
196 } else if (bytes >= 4 && ToLowerCaseLetter(cp[1]) == 'x' && in DecodeEscapedCharacter()
214 const char *cp, std::size_t bytes) { in DecodeEscapedCharacters() argument
218 for (; len < EncodedCharacter::maxEncodingBytes && at < bytes; ++len) { in DecodeEscapedCharacters()
219 DecodedCharacter code{DecodeEscapedCharacter(cp + at, bytes - at)}; in DecodeEscapedCharacters()
221 at += code.bytes; in DecodeEscapedCharacters()
225 if (code.bytes > 0) { in DecodeEscapedCharacters()
226 code.bytes = count[code.bytes - 1]; in DecodeEscapedCharacters()
229 code.bytes = count[0]; in DecodeEscapedCharacters()
236 const char *cp, std::size_t bytes, bool backslashEscapes) { in DecodeCharacter() argument
237 if (backslashEscapes && bytes >= 2 && *cp == '\\') { in DecodeCharacter()
238 return DecodeEscapedCharacters<ENCODING>(cp, bytes); in DecodeCharacter()
240 return DecodeRawCharacter<ENCODING>(cp, bytes); in DecodeCharacter()
250 std::size_t bytes, bool backslashEscapes) { in DecodeCharacter() argument
254 return DecodeCharacter<Encoding::LATIN_1>(cp, bytes, backslashEscapes); in DecodeCharacter()
256 return DecodeCharacter<Encoding::UTF_8>(cp, bytes, backslashEscapes); in DecodeCharacter()
264 for (auto bytes{s.size()}; bytes != 0;) { in DecodeString() local
266 DecodeCharacter<ENCODING>(p, bytes, backslashEscapes)}; in DecodeString()
267 if (decoded.bytes > 0) { in DecodeString()
268 if (static_cast<std::size_t>(decoded.bytes) <= bytes) { in DecodeString()
270 bytes -= decoded.bytes; in DecodeString()
271 p += decoded.bytes; in DecodeString()
277 --bytes; in DecodeString()