5#ifndef CORE_FXCRT_UTF16_H_
6#define CORE_FXCRT_UTF16_H_
8#include "third_party/base/check.h"
61class SurrogatePair
final {
65 : high_(high), low_(low) {
66 DCHECK(IsHighSurrogate(high_));
67 DCHECK(IsLowSurrogate(low_));
72 : high_(GetHighSurrogate(code_point)), low_(GetLowSurrogate(code_point)) {
75 DCHECK(IsSupplementary(code_point));
78 constexpr char16_t high()
const {
return high_; }
79 constexpr char16_t low()
const {
return low_; }
89 static constexpr char16_t GetHighSurrogate(
char32_t code_point) {
95 static constexpr char16_t GetLowSurrogate(
char32_t code_point) {
int GetIntegerFor(const ByteString &key) const
int GetIntegerFor(const ByteString &key, int default_int) const
FaxModule(const FaxModule &)=delete
static int FaxG4Decode(const uint8_t *src_buf, uint32_t src_size, int starting_bitpos, int width, int height, int pitch, uint8_t *dest_buf)
FaxModule & operator=(const FaxModule &)=delete
static std::unique_ptr< ScanlineDecoder > CreateDecoder(pdfium::span< const uint8_t > src_span, int width, int height, int K, bool EndOfLine, bool EncodedByteAlign, bool BlackIs1, int Columns, int Rows)
static uint32_t FlateOrLZWDecode(bool bLZW, pdfium::span< const uint8_t > src_span, bool bEarlyChange, int predictor, int Colors, int BitsPerComponent, int Columns, uint32_t estimated_size, std::unique_ptr< uint8_t, FxFreeDeleter > *dest_buf, uint32_t *dest_size)
ByteString & operator+=(char ch)
bool operator==(const char *ptr) const
ByteString & operator+=(const char *str)
ByteString & operator=(const char *str)
static WideString FromUTF8(ByteStringView str)
static WideString FromUTF16BE(pdfium::span< const uint8_t > data)
static WideString FromUTF16LE(pdfium::span< const uint8_t > data)
constexpr SurrogatePair(char32_t code_point)
constexpr char16_t high() const
constexpr char32_t ToCodePoint() const
constexpr SurrogatePair(char16_t high, char16_t low)
constexpr char16_t low() const
static size_t StripLanguageCodes(pdfium::span< wchar_t > s, size_t n)
const uint16_t kPDFDocEncoding[256]
ByteString PDF_EncodeString(ByteStringView src)
ByteString PDF_EncodeText(WideStringView str)
bool ValidateDecoderPipeline(const CPDF_Array *pDecoders)
uint32_t HexDecode(pdfium::span< const uint8_t > src_span, std::unique_ptr< uint8_t, FxFreeDeleter > *dest_buf, uint32_t *dest_size)
WideString PDF_DecodeText(pdfium::span< const uint8_t > span)
std::unique_ptr< fxcodec::ScanlineDecoder > CreateFaxDecoder(pdfium::span< const uint8_t > src_span, int width, int height, const CPDF_Dictionary *pParams)
uint32_t RunLengthDecode(pdfium::span< const uint8_t > src_span, std::unique_ptr< uint8_t, FxFreeDeleter > *dest_buf, uint32_t *dest_size)
uint32_t FlateOrLZWDecode(bool bLZW, pdfium::span< const uint8_t > src_span, const CPDF_Dictionary *pParams, uint32_t estimated_size, std::unique_ptr< uint8_t, FxFreeDeleter > *dest_buf, uint32_t *dest_size)
ByteString PDF_HexEncodeString(ByteStringView src)
std::unique_ptr< fxcodec::ScanlineDecoder > CreateFlateDecoder(pdfium::span< const uint8_t > src_span, int width, int height, int nComps, int bpc, const CPDF_Dictionary *pParams)
bool PDF_DataDecode(pdfium::span< const uint8_t > src_span, uint32_t estimated_size, bool bImageAcc, const DecoderArray &decoder_array, std::unique_ptr< uint8_t, FxFreeDeleter > *dest_buf, uint32_t *dest_size, ByteString *ImageEncoding, RetainPtr< const CPDF_Dictionary > *pImageParams)
uint32_t A85Decode(pdfium::span< const uint8_t > src_span, std::unique_ptr< uint8_t, FxFreeDeleter > *dest_buf, uint32_t *dest_size)
absl::optional< DecoderArray > GetDecoderArray(RetainPtr< const CPDF_Dictionary > pDict)
bool PDFCharIsLineEnding(uint8_t c)
int FXSYS_HexCharToInt(char c)
#define FX_INVALID_OFFSET
constexpr bool IsSupplementary(char32_t code_point)
constexpr char32_t kMaximumSupplementaryCodePoint
constexpr char32_t kMinimumSupplementaryCodePoint
constexpr bool IsHighSurrogate(char32_t code_point)
constexpr char16_t kMaximumHighSurrogateCodeUnit
constexpr char16_t kMaximumLowSurrogateCodeUnit
constexpr int kSurrogateBits
constexpr char16_t kSurrogateMask
constexpr char16_t kMinimumHighSurrogateCodeUnit
constexpr bool IsLowSurrogate(char32_t code_point)
constexpr char16_t kMinimumLowSurrogateCodeUnit