Lines Matching full:cp
148 const char *cp, std::size_t bytes) { in DecodeRawCharacter() argument
150 return {*reinterpret_cast<const std::uint8_t *>(cp), 1}; in DecodeRawCharacter()
158 const char *cp, std::size_t bytes) { in DecodeRawCharacter() argument
159 auto p{reinterpret_cast<const std::uint8_t *>(cp)}; in DecodeRawCharacter()
184 const char *cp, std::size_t bytes) { in DecodeEscapedCharacter() argument
185 if (cp[0] == '\\' && bytes >= 2) { in DecodeEscapedCharacter()
186 if (std::optional<char> escChar{BackslashEscapeValue(cp[1])}) { in DecodeEscapedCharacter()
188 } else if (IsOctalDigit(cp[1])) { in DecodeEscapedCharacter()
190 char32_t code{static_cast<char32_t>(DecimalDigitValue(cp[1]))}; in DecodeEscapedCharacter()
192 for (; code <= 037 && len < maxLen && IsOctalDigit(cp[len]); ++len) { in DecodeEscapedCharacter()
193 code = 8 * code + DecimalDigitValue(cp[len]); in DecodeEscapedCharacter()
196 } else if (bytes >= 4 && ToLowerCaseLetter(cp[1]) == 'x' && in DecodeEscapedCharacter()
197 IsHexadecimalDigit(cp[2]) && IsHexadecimalDigit(cp[3])) { in DecodeEscapedCharacter()
198 return {static_cast<char32_t>(16 * HexadecimalDigitValue(cp[2]) + in DecodeEscapedCharacter()
199 HexadecimalDigitValue(cp[3])), in DecodeEscapedCharacter()
201 } else if (IsLetter(cp[1])) { in DecodeEscapedCharacter()
203 return {static_cast<unsigned char>(cp[1]), 2}; in DecodeEscapedCharacter()
209 return {static_cast<unsigned char>(cp[0]), 1}; in DecodeEscapedCharacter()
214 const char *cp, std::size_t bytes) { in DecodeEscapedCharacters() argument
219 DecodedCharacter code{DecodeEscapedCharacter(cp + at, bytes - at)}; in DecodeEscapedCharacters()
236 const char *cp, std::size_t bytes, bool backslashEscapes) { in DecodeCharacter() argument
237 if (backslashEscapes && bytes >= 2 && *cp == '\\') { in DecodeCharacter()
239 ToLowerCaseLetter(cp[1]) == 'u' && IsHexadecimalDigit(cp[2]) && in DecodeCharacter()
240 IsHexadecimalDigit(cp[3]) && IsHexadecimalDigit(cp[4]) && in DecodeCharacter()
241 IsHexadecimalDigit(cp[5])) { in DecodeCharacter()
243 static_cast<char32_t>(4096 * HexadecimalDigitValue(cp[2]) + in DecodeCharacter()
244 256 * HexadecimalDigitValue(cp[3]) + in DecodeCharacter()
245 16 * HexadecimalDigitValue(cp[4]) + HexadecimalDigitValue(cp[5])), in DecodeCharacter()
247 if (bytes >= 10 && IsHexadecimalDigit(cp[6]) && in DecodeCharacter()
248 IsHexadecimalDigit(cp[7]) && IsHexadecimalDigit(cp[8]) && in DecodeCharacter()
249 IsHexadecimalDigit(cp[9])) { in DecodeCharacter()
251 (4096 * HexadecimalDigitValue(cp[6]) + in DecodeCharacter()
252 256 * HexadecimalDigitValue(cp[7]) + in DecodeCharacter()
253 16 * HexadecimalDigitValue(cp[8]) + in DecodeCharacter()
254 HexadecimalDigitValue(cp[9])), in DecodeCharacter()
260 return DecodeEscapedCharacters<ENCODING>(cp, bytes); in DecodeCharacter()
263 return DecodeRawCharacter<ENCODING>(cp, bytes); in DecodeCharacter()
272 DecodedCharacter DecodeCharacter(Encoding encoding, const char *cp, in DecodeCharacter() argument
277 return DecodeCharacter<Encoding::LATIN_1>(cp, bytes, backslashEscapes); in DecodeCharacter()
279 return DecodeCharacter<Encoding::UTF_8>(cp, bytes, backslashEscapes); in DecodeCharacter()