Lines Matching refs: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()
238 return DecodeEscapedCharacters<ENCODING>(cp, bytes); in DecodeCharacter()
240 return DecodeRawCharacter<ENCODING>(cp, bytes); in DecodeCharacter()
249 DecodedCharacter DecodeCharacter(Encoding encoding, const char *cp, 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()