Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
clamped_math.h
Go to the documentation of this file.
1// Copyright 2024 The PDFium Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CORE_FXCRT_NUMERICS_CLAMPED_MATH_H_
6#define CORE_FXCRT_NUMERICS_CLAMPED_MATH_H_
7
8#include <stddef.h>
9
10#include <limits>
11#include <type_traits>
12
13#include "core/fxcrt/numerics/clamped_math_impl.h"
14
15namespace pdfium {
16namespace internal {
17
18template <typename T>
20 static_assert(std::is_arithmetic<T>::value,
21 "ClampedNumeric<T>: T must be a numeric type.");
22
23 public:
24 using type = T;
25
26 constexpr ClampedNumeric() : value_(0) {}
27
28 // Copy constructor.
29 template <typename Src>
30 constexpr ClampedNumeric(const ClampedNumeric<Src>& rhs)
31 : value_(saturated_cast<T>(rhs.value_)) {}
32
33 template <typename Src>
34 friend class ClampedNumeric;
35
36 // Strictly speaking, this is not necessary, but declaring this allows class
37 // template argument deduction to be used so that it is possible to simply
38 // write `ClampedNumeric(777)` instead of `ClampedNumeric<int>(777)`.
39 // NOLINTNEXTLINE(google-explicit-constructor)
40 constexpr ClampedNumeric(T value) : value_(value) {}
41
42 // This is not an explicit constructor because we implicitly upgrade regular
43 // numerics to ClampedNumerics to make them easier to use.
44 template <typename Src>
45 // NOLINTNEXTLINE(google-explicit-constructor)
46 constexpr ClampedNumeric(Src value) : value_(saturated_cast<T>(value)) {
47 static_assert(UnderlyingType<Src>::is_numeric, "Argument must be numeric.");
48 }
49
50 // This is not an explicit constructor because we want a seamless conversion
51 // from StrictNumeric types.
52 template <typename Src>
53 // NOLINTNEXTLINE(google-explicit-constructor)
54 constexpr ClampedNumeric(StrictNumeric<Src> value)
55 : value_(saturated_cast<T>(static_cast<Src>(value))) {}
56
57 // Returns a ClampedNumeric of the specified type, cast from the current
58 // ClampedNumeric, and saturated to the destination type.
59 template <typename Dst>
60 constexpr ClampedNumeric<typename UnderlyingType<Dst>::type> Cast() const {
61 return *this;
62 }
63
64 // Prototypes for the supported arithmetic operator overloads.
65 template <typename Src>
66 constexpr ClampedNumeric& operator+=(const Src rhs);
67 template <typename Src>
68 constexpr ClampedNumeric& operator-=(const Src rhs);
69 template <typename Src>
70 constexpr ClampedNumeric& operator*=(const Src rhs);
71 template <typename Src>
72 constexpr ClampedNumeric& operator/=(const Src rhs);
73 template <typename Src>
74 constexpr ClampedNumeric& operator%=(const Src rhs);
75 template <typename Src>
76 constexpr ClampedNumeric& operator<<=(const Src rhs);
77 template <typename Src>
78 constexpr ClampedNumeric& operator>>=(const Src rhs);
79 template <typename Src>
80 constexpr ClampedNumeric& operator&=(const Src rhs);
81 template <typename Src>
82 constexpr ClampedNumeric& operator|=(const Src rhs);
83 template <typename Src>
84 constexpr ClampedNumeric& operator^=(const Src rhs);
85
86 constexpr ClampedNumeric operator-() const {
87 // The negation of two's complement int min is int min, so that's the
88 // only overflow case where we will saturate.
89 return ClampedNumeric<T>(SaturatedNegWrapper(value_));
90 }
91
92 constexpr ClampedNumeric operator~() const {
93 return ClampedNumeric<decltype(InvertWrapper(T()))>(InvertWrapper(value_));
94 }
95
96 constexpr ClampedNumeric Abs() const {
97 // The negation of two's complement int min is int min, so that's the
98 // only overflow case where we will saturate.
99 return ClampedNumeric<T>(SaturatedAbsWrapper(value_));
100 }
101
102 template <typename U>
104 const U rhs) const {
105 using result_type = typename MathWrapper<ClampedMaxOp, T, U>::type;
106 return ClampedNumeric<result_type>(
107 ClampedMaxOp<T, U>::Do(value_, Wrapper<U>::value(rhs)));
108 }
109
110 template <typename U>
112 const U rhs) const {
113 using result_type = typename MathWrapper<ClampedMinOp, T, U>::type;
114 return ClampedNumeric<result_type>(
115 ClampedMinOp<T, U>::Do(value_, Wrapper<U>::value(rhs)));
116 }
117
118 // This function is available only for integral types. It returns an unsigned
119 // integer of the same width as the source type, containing the absolute value
120 // of the source, and properly handling signed min.
121 constexpr ClampedNumeric<typename UnsignedOrFloatForSize<T>::type>
122 UnsignedAbs() const {
123 return ClampedNumeric<typename UnsignedOrFloatForSize<T>::type>(
124 SafeUnsignedAbs(value_));
125 }
126
127 constexpr ClampedNumeric& operator++() {
128 *this += 1;
129 return *this;
130 }
131
132 constexpr ClampedNumeric operator++(int) {
133 ClampedNumeric value = *this;
134 *this += 1;
135 return value;
136 }
137
138 constexpr ClampedNumeric& operator--() {
139 *this -= 1;
140 return *this;
141 }
142
143 constexpr ClampedNumeric operator--(int) {
144 ClampedNumeric value = *this;
145 *this -= 1;
146 return value;
147 }
148
149 // These perform the actual math operations on the ClampedNumerics.
150 // Binary arithmetic operations.
151 template <template <typename, typename, typename> class M,
152 typename L,
153 typename R>
154 static constexpr ClampedNumeric MathOp(const L lhs, const R rhs) {
155 using Math = typename MathWrapper<M, L, R>::math;
156 return ClampedNumeric<T>(
157 Math::template Do<T>(Wrapper<L>::value(lhs), Wrapper<R>::value(rhs)));
158 }
159
160 // Assignment arithmetic operations.
161 template <template <typename, typename, typename> class M, typename R>
162 constexpr ClampedNumeric& MathOp(const R rhs) {
163 using Math = typename MathWrapper<M, T, R>::math;
164 *this =
165 ClampedNumeric<T>(Math::template Do<T>(value_, Wrapper<R>::value(rhs)));
166 return *this;
167 }
168
169 template <typename Dst>
170 constexpr operator Dst() const {
171 return saturated_cast<typename ArithmeticOrUnderlyingEnum<Dst>::type>(
172 value_);
173 }
174
175 // This method extracts the raw integer value without saturating it to the
176 // destination type as the conversion operator does. This is useful when
177 // e.g. assigning to an auto type or passing as a deduced template parameter.
178 constexpr T RawValue() const { return value_; }
179
180 private:
181 T value_;
182
183 // These wrappers allow us to handle state the same way for both
184 // ClampedNumeric and POD arithmetic types.
185 template <typename Src>
186 struct Wrapper {
187 static constexpr typename UnderlyingType<Src>::type value(Src value) {
188 return value;
189 }
190 };
191};
192
193// Convenience wrapper to return a new ClampedNumeric from the provided
194// arithmetic or ClampedNumericType.
195template <typename T>
197 const T value) {
198 return value;
199}
200
201// These implement the variadic wrapper for the math operations.
202template <template <typename, typename, typename> class M,
203 typename L,
204 typename R>
206 const L lhs,
207 const R rhs) {
208 using Math = typename MathWrapper<M, L, R>::math;
209 return ClampedNumeric<typename Math::result_type>::template MathOp<M>(lhs,
210 rhs);
211}
212
213// General purpose wrapper template for arithmetic operations.
214template <template <typename, typename, typename> class M,
215 typename L,
216 typename R,
217 typename... Args>
218constexpr auto ClampMathOp(const L lhs, const R rhs, const Args... args) {
219 return ClampMathOp<M>(ClampMathOp<M>(lhs, rhs), args...);
220}
221
222BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Add, +, +=)
223BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Sub, -, -=)
224BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Mul, *, *=)
225BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Div, /, /=)
226BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Mod, %, %=)
227BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Lsh, <<, <<=)
228BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Rsh, >>, >>=)
229BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, And, &, &=)
230BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Or, |, |=)
231BASE_NUMERIC_ARITHMETIC_OPERATORS(Clamped, Clamp, Xor, ^, ^=)
232BASE_NUMERIC_ARITHMETIC_VARIADIC(Clamped, Clamp, Max)
233BASE_NUMERIC_ARITHMETIC_VARIADIC(Clamped, Clamp, Min)
240
241} // namespace internal
242
243using internal::ClampAdd;
244using internal::ClampAnd;
245using internal::ClampDiv;
246using internal::ClampedNumeric;
247using internal::ClampLsh;
248using internal::ClampMax;
249using internal::ClampMin;
250using internal::ClampMod;
251using internal::ClampMul;
252using internal::ClampOr;
253using internal::ClampRsh;
254using internal::ClampSub;
255using internal::ClampXor;
256using internal::MakeClampedNum;
257
258} // namespace pdfium
259
260#endif // CORE_FXCRT_NUMERICS_CLAMPED_MATH_H_
fxcrt::ByteString ByteString
Definition bytestring.h:180
#define DCHECK
Definition check.h:33
#define CHECK_LE(x, y)
Definition check_op.h:14
#define BASE_FLOAT_ARITHMETIC_OPS(NAME, OP)
CPDF_ArrayLocker(RetainPtr< CPDF_Array > pArray)
const_iterator begin() const
Definition cpdf_array.h:185
const_iterator end() const
Definition cpdf_array.h:189
CPDF_ArrayLocker(const CPDF_Array *pArray)
CPDF_ArrayLocker(RetainPtr< const CPDF_Array > pArray)
size_t size() const
Definition cpdf_array.h:41
void Append(RetainPtr< CPDF_Stream > stream)=delete
bool GetBooleanAt(size_t index, bool bDefault) const
void SetAt(size_t index, RetainPtr< CPDF_Object > object)
RetainPtr< CPDF_Dictionary > GetMutableDictAt(size_t index)
RetainPtr< CPDF_Object > CloneNonCyclic(bool bDirect, std::set< const CPDF_Object * > *pVisited) const override
bool IsEmpty() const
Definition cpdf_array.h:40
RetainPtr< const CPDF_Object > GetDirectObjectAt(size_t index) const
RetainPtr< const CPDF_Stream > GetStreamAt(size_t index) const
Type GetType() const override
CPDF_Array * AsMutableArray() override
RetainPtr< const CPDF_Object > GetObjectAt(size_t index) const
RetainPtr< CPDF_Object > GetMutableObjectAt(size_t index)
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type AppendNew(Args &&... args)
Definition cpdf_array.h:85
WideString GetUnicodeTextAt(size_t index) const
RetainPtr< CPDF_Array > GetMutableArrayAt(size_t index)
RetainPtr< CPDF_Object > Clone() const override
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type AppendNew(Args &&... args)
Definition cpdf_array.h:94
RetainPtr< const CPDF_Dictionary > GetDictAt(size_t index) const
std::vector< RetainPtr< CPDF_Object > >::const_iterator const_iterator
Definition cpdf_array.h:29
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type InsertNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:115
bool IsLocked() const
Definition cpdf_array.h:150
RetainPtr< CPDF_Stream > GetMutableStreamAt(size_t index)
bool Contains(const CPDF_Object *pThat) const
void ConvertToIndirectObjectAt(size_t index, CPDF_IndirectObjectHolder *pHolder)
std::optional< size_t > Find(const CPDF_Object *pThat) const
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type InsertNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:124
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type SetNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:100
bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
RetainPtr< CPDF_Object > GetMutableDirectObjectAt(size_t index)
CFX_Matrix GetMatrix() const
~CPDF_Array() override
int GetIntegerAt(size_t index) const
void SetAt(size_t index, RetainPtr< CPDF_Stream > stream)=delete
void InsertAt(size_t index, RetainPtr< CPDF_Object > object)
ByteString GetByteStringAt(size_t index) const
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type SetNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:109
void Append(RetainPtr< CPDF_Object > object)
RetainPtr< const CPDF_String > GetStringAt(size_t index) const
RetainPtr< const CPDF_Array > GetArrayAt(size_t index) const
RetainPtr< const CPDF_Number > GetNumberAt(size_t index) const
CFX_FloatRect GetRect() const
void InsertAt(size_t index, RetainPtr< CPDF_Stream > stream)=delete
void RemoveAt(size_t index)
float GetFloatAt(size_t index) const
CPDF_Creator(CPDF_Document *pDoc, RetainPtr< IFX_RetainableWriteStream > archive)
bool SetFileVersion(int32_t fileVersion)
void RemoveSecurity()
bool Create(uint32_t flags)
CPDF_Dictionary * GetMutableTrailerForTesting()
const CPDF_Dictionary * trailer() const
const ObjectInfo * GetObjectInfo(uint32_t obj_num) const
CPDF_CrossRefTable(RetainPtr< CPDF_Dictionary > trailer, uint32_t trailer_object_number)
void SetFree(uint32_t obj_num, uint16_t gen_num)
void Update(std::unique_ptr< CPDF_CrossRefTable > new_cross_ref)
const std::map< uint32_t, ObjectInfo > & objects_info() const
static std::unique_ptr< CPDF_CrossRefTable > MergeUp(std::unique_ptr< CPDF_CrossRefTable > current, std::unique_ptr< CPDF_CrossRefTable > top)
void AddCompressed(uint32_t obj_num, uint32_t archive_obj_num, uint32_t archive_obj_index)
uint32_t trailer_object_number() const
void AddNormal(uint32_t obj_num, uint16_t gen_num, bool is_object_stream, FX_FILESIZE pos)
void SetTrailer(RetainPtr< CPDF_Dictionary > trailer, uint32_t trailer_object_number)
void SetObjectMapSize(uint32_t size)
CPDF_CryptoHandler(Cipher cipher, pdfium::span< const uint8_t > key)
bool DecryptObjectTree(RetainPtr< CPDF_Object > object)
static bool IsSignatureDictionary(const CPDF_Dictionary *dictionary)
DataVector< uint8_t > EncryptContent(uint32_t objnum, uint32_t gennum, pdfium::span< const uint8_t > source) const
const_iterator end() const
CPDF_DictionaryLocker(const CPDF_Dictionary *pDictionary)
const_iterator begin() const
CPDF_DictionaryLocker(RetainPtr< const CPDF_Dictionary > pDictionary)
CPDF_DictionaryLocker(RetainPtr< CPDF_Dictionary > pDictionary)
Type GetType() const override
bool KeyExist(const ByteString &key) const
int GetIntegerFor(const ByteString &key) const
RetainPtr< const CPDF_Stream > GetStreamFor(const ByteString &key) const
RetainPtr< const CPDF_Number > GetNumberFor(const ByteString &key) const
void SetFor(const ByteString &key, RetainPtr< CPDF_Object > object)
ByteString GetByteStringFor(const ByteString &key, const ByteString &default_str) const
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type SetNewFor(const ByteString &key, Args &&... args)
RetainPtr< CPDF_Object > RemoveFor(ByteStringView key)
RetainPtr< CPDF_Array > GetOrCreateArrayFor(const ByteString &key)
void SetMatrixFor(const ByteString &key, const CFX_Matrix &matrix)
RetainPtr< CPDF_Stream > GetMutableStreamFor(const ByteString &key)
RetainPtr< CPDF_Object > GetMutableDirectObjectFor(const ByteString &key)
RetainPtr< const CPDF_Dictionary > GetDictFor(const ByteString &key) const
RetainPtr< CPDF_Array > GetMutableArrayFor(const ByteString &key)
float GetFloatFor(const ByteString &key) const
RetainPtr< CPDF_Dictionary > GetOrCreateDictFor(const ByteString &key)
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type SetNewFor(const ByteString &key, Args &&... args)
void ConvertToIndirectObjectFor(const ByteString &key, CPDF_IndirectObjectHolder *pHolder)
WideString GetUnicodeTextFor(const ByteString &key) const
RetainPtr< CPDF_Object > Clone() const override
const CPDF_Dictionary * GetDictInternal() const override
RetainPtr< CPDF_Object > CloneNonCyclic(bool bDirect, std::set< const CPDF_Object * > *visited) const override
CPDF_Dictionary * AsMutableDictionary() override
std::vector< ByteString > GetKeys() const
bool GetBooleanFor(const ByteString &key, bool bDefault) const
ByteString GetByteStringFor(const ByteString &key) const
int GetDirectIntegerFor(const ByteString &key) const
RetainPtr< const CPDF_String > GetStringFor(const ByteString &key) const
WeakPtr< ByteStringPool > GetByteStringPool() const
void SetRectFor(const ByteString &key, const CFX_FloatRect &rect)
RetainPtr< CPDF_Dictionary > GetMutableDictFor(const ByteString &key)
RetainPtr< const CPDF_Object > GetDirectObjectFor(const ByteString &key) const
bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
RetainPtr< const CPDF_Array > GetArrayFor(const ByteString &key) const
size_t size() const
RetainPtr< const CPDF_Object > GetObjectFor(const ByteString &key) const
int GetIntegerFor(const ByteString &key, int default_int) const
~CPDF_Dictionary() override
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
bool IsLocked() const
void SetFor(const ByteString &key, RetainPtr< CPDF_Stream > stream)=delete
CFX_FloatRect GetRectFor(const ByteString &key) const
ByteString GetNameFor(const ByteString &key) const
CFX_Matrix GetMatrixFor(const ByteString &key) const
RetainPtr< CPDF_Object > GetMutableObjectFor(const ByteString &key)
void ReplaceKey(const ByteString &oldkey, const ByteString &newkey)
virtual uint32_t DeletePage(int page_index)=0
virtual ~Extension()=default
virtual bool ContainsExtensionForm() const =0
virtual bool ContainsExtensionFullForm() const =0
virtual int GetPageCount() const =0
virtual bool ContainsExtensionForegroundForm() const =0
virtual ~LinkListIface()=default
void SetDocument(CPDF_Document *pDoc)
CPDF_Document * GetDocument() const
virtual void MaybePurgeImage(uint32_t objnum)=0
virtual void ClearStockFont()=0
virtual RetainPtr< CPDF_StreamAcc > GetFontFileStreamAcc(RetainPtr< const CPDF_Stream > pFontStream)=0
virtual void MaybePurgeFontFileStreamAcc(RetainPtr< CPDF_StreamAcc > &&pStreamAcc)=0
void SetDocument(CPDF_Document *pDoc)
CPDF_Document * GetDocument() const
~CPDF_Document() override
bool has_valid_cross_reference_table() const
JBig2_DocumentContext * GetOrCreateCodecContext()
CPDF_Parser::Error LoadLinearizedDoc(RetainPtr< CPDF_ReadValidator > validator, const ByteString &password)
RetainPtr< CPDF_Object > ParseIndirectObject(uint32_t objnum) override
uint32_t GetParsedPageCountForTesting()
bool IsPageLoaded(int iPage) const
RetainPtr< const CPDF_Dictionary > GetPageDictionary(int iPage)
int GetPageCount() const
RetainPtr< CPDF_Dictionary > CreateNewPage(int iPage)
void SetExtension(std::unique_ptr< Extension > pExt)
void SetLinksContext(std::unique_ptr< LinkListIface > pContext)
PageDataIface * GetPageData() const
bool IsModifiedAPStream(const CPDF_Stream *stream) const
RetainPtr< const CPDF_Array > GetFileIdentifier() const
void MaybePurgeImage(uint32_t objnum)
void MaybePurgeFontFileStreamAcc(RetainPtr< CPDF_StreamAcc > &&pStreamAcc)
RetainPtr< CPDF_Dictionary > GetMutableRoot()
RetainPtr< CPDF_Dictionary > GetInfo()
RenderDataIface * GetRenderData() const
LinkListIface * GetLinksContext() const
CPDF_Document(std::unique_ptr< RenderDataIface > pRenderData, std::unique_ptr< PageDataIface > pPageData)
CPDF_Parser::Error LoadDoc(RetainPtr< IFX_SeekableReadStream > pFileAccess, const ByteString &password)
void ResizePageListForTesting(size_t size)
CPDF_Parser * GetParser() const
RetainPtr< CPDF_Dictionary > GetMutablePageDictionary(int iPage)
bool MovePages(pdfium::span< const int > page_indices, int dest_page_index)
int GetPageIndex(uint32_t objnum)
Extension * GetExtension() const
uint32_t GetUserPermissions(bool get_owner_perms) const
void SetPageToNullObject(uint32_t page_obj_num)
RetainPtr< CPDF_StreamAcc > GetFontFileStreamAcc(RetainPtr< const CPDF_Stream > pFontStream)
RetainPtr< CPDF_Stream > CreateModifiedAPStream(RetainPtr< CPDF_Dictionary > dict)
void SetRootForTesting(RetainPtr< CPDF_Dictionary > root)
bool TryInit() override
static bool IsValidPageObject(const CPDF_Object *obj)
const CPDF_Dictionary * GetRoot() const
void SetParser(std::unique_ptr< CPDF_Parser > pParser)
uint32_t DeletePage(int iPage)
static constexpr int kPageMaxNum
void SetPageObjNum(int iPage, uint32_t objNum)
void IncrementParsedPageCount()
CPDF_Encryptor(const CPDF_CryptoHandler *pHandler, int objnum)
DataVector< uint8_t > Encrypt(pdfium::span< const uint8_t > src_data) const
bool WriteDictTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const
pdfium::span< const uint8_t > GetSpan() const
CPDF_FlateEncoder(RetainPtr< const CPDF_Stream > pStream, bool bFlateEncode)
void UpdateLength(size_t size)
RetainPtr< const CPDF_Object > GetIndirectObject(uint32_t objnum) const
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type New(Args &&... args)
RetainPtr< T > NewIndirect(Args &&... args)
RetainPtr< CPDF_Object > GetOrParseIndirectObject(uint32_t objnum)
WeakPtr< ByteStringPool > GetByteStringPool() const
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type New(Args &&... args)
virtual RetainPtr< CPDF_Object > ParseIndirectObject(uint32_t objnum)
RetainPtr< CPDF_Object > GetMutableIndirectObject(uint32_t objnum)
uint32_t AddIndirectObject(RetainPtr< CPDF_Object > pObj)
bool ReplaceIndirectObjectIfHigherGeneration(uint32_t objnum, RetainPtr< CPDF_Object > pObj)
bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
float GetNumber() const override
bool IsInteger() const
Definition cpdf_number.h:30
int GetInteger() const override
RetainPtr< CPDF_Object > Clone() const override
void SetString(const ByteString &str) override
~CPDF_Number() override
ByteString GetString() const override
CPDF_Number * AsMutableNumber() override
Type GetType() const override
void SetGenNum(uint32_t gennum)
Definition cpdf_object.h:68
RetainPtr< const CPDF_Dictionary > GetDict() const
bool IsInline() const
Definition cpdf_object.h:69
uint32_t GetGenNum() const
Definition cpdf_object.h:67
virtual Type GetType() const =0
virtual WideString GetUnicodeText() const
virtual ByteString GetString() const
RetainPtr< const CPDF_Object > GetDirect() const
uint32_t m_GenNum
bool IsName() const
virtual CPDF_Null * AsMutableNull()
const CPDF_Name * AsName() const
bool IsArray() const
const CPDF_Boolean * AsBoolean() const
virtual void SetString(const ByteString &str)
const CPDF_Null * AsNull() const
bool IsDictionary() const
bool IsStream() const
virtual RetainPtr< CPDF_Reference > MakeReference(CPDF_IndirectObjectHolder *holder) const
RetainPtr< CPDF_Object > GetMutableDirect()
const CPDF_Array * AsArray() const
virtual int GetInteger() const
CPDF_Object()=default
virtual float GetNumber() const
bool IsNull() const
bool IsBoolean() const
uint32_t GetObjNum() const
Definition cpdf_object.h:65
const CPDF_Dictionary * AsDictionary() const
virtual bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const =0
RetainPtr< CPDF_Object > CloneDirectObject() const
virtual CPDF_Stream * AsMutableStream()
bool IsString() const
virtual CPDF_Number * AsMutableNumber()
virtual CPDF_Dictionary * AsMutableDictionary()
virtual RetainPtr< CPDF_Object > Clone() const =0
bool IsNumber() const
virtual CPDF_Reference * AsMutableReference()
uint32_t m_ObjNum
CPDF_Object(const CPDF_Object &src)=delete
const CPDF_Stream * AsStream() const
static constexpr uint32_t kInvalidObjNum
Definition cpdf_object.h:52
virtual const CPDF_Object * GetDirectInternal() const
virtual CPDF_Name * AsMutableName()
bool IsReference() const
void SetObjNum(uint32_t objnum)
Definition cpdf_object.h:66
const CPDF_String * AsString() const
uint64_t KeyForCache() const
virtual CPDF_Array * AsMutableArray()
const CPDF_Reference * AsReference() const
virtual RetainPtr< CPDF_Object > CloneNonCyclic(bool bDirect, std::set< const CPDF_Object * > *pVisited) const
virtual CPDF_String * AsMutableString()
const CPDF_Number * AsNumber() const
RetainPtr< CPDF_Dictionary > GetMutableDict()
RetainPtr< CPDF_Object > CloneObjectNonCyclic(bool bDirect) const
virtual const CPDF_Dictionary * GetDictInternal() const
~CPDF_Object() override
virtual CPDF_Boolean * AsMutableBoolean()
void SetSyntaxParserForTesting(std::unique_ptr< CPDF_SyntaxParser > parser)
bool RebuildCrossRef()
uint32_t GetPermissions(bool get_owner_perms) const
const CPDF_Dictionary * GetTrailer() const
RetainPtr< CPDF_Object > ParseIndirectObjectAtForTesting(FX_FILESIZE pos)
FX_FILESIZE GetObjectPositionOrZero(uint32_t objnum) const
void SetLinearizedHeaderForTesting(std::unique_ptr< CPDF_LinearizedHeader > pLinearized)
int GetFileVersion() const
Error StartLinearizedParse(RetainPtr< CPDF_ReadValidator > validator, const ByteString &password)
uint32_t GetRootObjNum() const
RetainPtr< const CPDF_Array > GetIDArray() const
RetainPtr< const CPDF_Dictionary > GetEncryptDict() const
std::vector< unsigned int > GetTrailerEnds()
CPDF_Parser(ParsedObjectsHolder *holder)
FX_FILESIZE GetLastXRefOffset() const
Definition cpdf_parser.h:83
bool WriteToArchive(IFX_ArchiveStream *archive, FX_FILESIZE src_size)
const CPDF_LinearizedHeader * GetLinearizedHeader() const
ByteString GetPassword() const
Definition cpdf_parser.h:70
static constexpr size_t kInvalidPos
Definition cpdf_parser.h:59
const CPDF_CrossRefTable * GetCrossRefTableForTesting() const
CPDF_Dictionary * GetMutableTrailerForTesting()
uint32_t GetTrailerObjectNumber() const
static constexpr uint32_t kMaxObjectNumber
Definition cpdf_parser.h:57
bool IsXRefStream() const
uint32_t GetFirstPageNo() const
Error StartParseInternal()
ByteString GetEncodedPassword() const
FX_FILESIZE GetDocumentSize() const
bool IsValidObjectNumber(uint32_t objnum) const
Error StartParse(RetainPtr< IFX_SeekableReadStream > pFile, const ByteString &password)
std::unique_ptr< CPDF_LinearizedHeader > ParseLinearizedHeader()
FX_FILESIZE ParseStartXRef()
bool IsObjectFree(uint32_t objnum) const
RetainPtr< CPDF_Dictionary > GetCombinedTrailer() const
bool LoadCrossRefTable(FX_FILESIZE pos, bool skip)
uint32_t GetLastObjNum() const
const RetainPtr< CPDF_SecurityHandler > & GetSecurityHandler() const
Definition cpdf_parser.h:96
RetainPtr< CPDF_Object > ParseIndirectObject(uint32_t objnum)
uint32_t GetInfoObjNum() const
bool xref_table_rebuilt() const
CPDF_CryptoHandler * GetCryptoHandler() const
bool OnInit(const CPDF_Dictionary *pEncryptDict, RetainPtr< const CPDF_Array > pIdArray, const ByteString &password)
~CPDF_SecurityHandler() override
uint32_t GetPermissions(bool get_owner_perms) const
void OnCreate(CPDF_Dictionary *pEncryptDict, const CPDF_Array *pIdArray, const ByteString &password)
ByteString GetEncodedPassword(ByteStringView password) const
void SetString(const ByteString &str) override
~CPDF_String() override
CPDF_String * AsMutableString() override
Type GetType() const override
bool IsHex() const
Definition cpdf_string.h:34
bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
ByteString EncodeString() const
RetainPtr< CPDF_Object > Clone() const override
WideString GetUnicodeText() const override
ByteString GetString() const override
bool IsInteger() const
Definition fx_number.cpp:86
FX_Number(int32_t value)
Definition fx_number.cpp:20
FX_Number(float value)
Definition fx_number.cpp:22
FX_Number(uint32_t value)=delete
int32_t GetSigned() const
Definition fx_number.cpp:96
float GetFloat() const
bool IsSigned() const
Definition fx_number.cpp:91
FX_Number(ByteStringView str)
Definition fx_number.cpp:24
virtual FX_FILESIZE CurrentOffset() const =0
static RetainPtr< IFX_SeekableReadStream > CreateFromFilename(const char *filename)
Definition fx_stream.cpp:68
virtual FX_FILESIZE GetPosition()
Definition fx_stream.cpp:80
virtual bool ReadBlockAtOffset(pdfium::span< uint8_t > buffer, FX_FILESIZE offset)=0
virtual bool IsEOF()
Definition fx_stream.cpp:76
virtual bool Flush()=0
virtual FX_FILESIZE GetSize()=0
bool WriteFilesize(FX_FILESIZE size)
Definition fx_stream.cpp:61
bool WriteByte(uint8_t byte)
Definition fx_stream.cpp:50
bool WriteString(ByteStringView str)
Definition fx_stream.cpp:46
virtual ~IFX_WriteStream()=default
bool WriteDWord(uint32_t i)
Definition fx_stream.cpp:54
virtual bool WriteBlock(pdfium::span< const uint8_t > data)=0
virtual size_t GetLength() const
void AppendUint8(uint8_t value)
BinaryBuffer & operator=(const BinaryBuffer &that)=delete
void AppendUint16(uint16_t value)
virtual ~BinaryBuffer()
DataVector< uint8_t > m_buffer
void AppendSpan(pdfium::span< const uint8_t > span)
size_t GetSize() const
pdfium::span< const uint8_t > GetSpan() const
void DeleteBuf(size_t start_index, size_t count)
void AppendDouble(double value)
void ExpandBuf(size_t size)
bool IsEmpty() const
void AppendString(const ByteString &str)
void EstimateSize(size_t size)
BinaryBuffer & operator=(BinaryBuffer &&that) noexcept
BinaryBuffer(BinaryBuffer &&that) noexcept
void AppendUint32(uint32_t value)
BinaryBuffer(const BinaryBuffer &that)=delete
pdfium::span< uint8_t > GetMutableSpan()
DataVector< uint8_t > DetachBuffer()
void SetAllocStep(size_t step)
static ByteString Format(const char *pFormat,...)
ByteString & operator=(ByteString &&that) noexcept
FixedSizeDataVector & operator=(FixedSizeDataVector< T > &&that) noexcept
FixedSizeDataVector & operator=(const FixedSizeDataVector &)=delete
static FixedSizeDataVector TruncatedFrom(FixedSizeDataVector &&that, size_t new_size)
static FixedSizeDataVector Uninit(size_t size)
FixedSizeDataVector(const FixedSizeDataVector &)=delete
FixedSizeDataVector(FixedSizeDataVector< T > &&that) noexcept
static FixedSizeDataVector TryZeroed(size_t size)
static FixedSizeDataVector TryUninit(size_t size)
static FixedSizeDataVector Zeroed(size_t size)
virtual void OnObservableDestroyed()=0
virtual ~ObserverIface()=default
Observable(const Observable &that)=delete
void AddObserver(ObserverIface *pObserver)
size_t ActiveObserversForTesting() const
void RemoveObserver(ObserverIface *pObserver)
Observable & operator=(const Observable &that)=delete
ObservedPtr(T *pObservable)
ObservedPtr()=default
ObservedPtr & operator=(const ObservedPtr &that)
bool operator==(const ObservedPtr &that) const
void OnObservableDestroyed() override
bool HasObservable() const
~ObservedPtr() override
void Reset(T *pObservable=nullptr)
T & operator*() const
ObservedPtr(const ObservedPtr &that)
bool operator!=(const ObservedPtr &that) const
bool operator!=(const U *that) const
bool operator==(const U *that) const
T * operator->() const
StringType Intern(const StringType &str)
T * get() const noexcept
UnownedPtr(const UnownedPtr< U > &that)
Definition unowned_ptr.h:99
bool operator==(const UnownedPtr &that) const
operator T*() const noexcept
UnownedPtr(UnownedPtr< U > &&that) noexcept
UnownedPtr & operator=(UnownedPtr< U > &&that) noexcept
constexpr UnownedPtr(const UnownedPtr &that) noexcept=default
constexpr UnownedPtr(T *pObj) noexcept
Definition unowned_ptr.h:84
UnownedPtr & operator=(T *that) noexcept
bool operator==(std::nullptr_t ptr) const
UnownedPtr & operator=(UnownedPtr &&that) noexcept
UnownedPtr & operator=(std::nullptr_t) noexcept
UnownedPtr & operator=(const UnownedPtr< U > &that) noexcept
T * operator->() const
constexpr UnownedPtr() noexcept=default
bool operator<(const UnownedPtr &that) const
UnownedPtr & operator=(const UnownedPtr &that) noexcept=default
T & operator*() const
constexpr UnownedPtr(UnownedPtr &&that) noexcept
Definition unowned_ptr.h:92
constexpr UnownedPtr(std::nullptr_t ptr)
Definition unowned_ptr.h:82
bool operator==(const WeakPtr &that) const
Definition weak_ptr.h:40
void Swap(WeakPtr &that)
Definition weak_ptr.h:56
T * operator->()
Definition weak_ptr.h:34
void Reset()
Definition weak_ptr.h:52
T * Get() const
Definition weak_ptr.h:45
WeakPtr()=default
void Reset(std::unique_ptr< T, D > pObj)
Definition weak_ptr.h:53
WeakPtr(std::unique_ptr< T, D > pObj)
Definition weak_ptr.h:25
WeakPtr(const WeakPtr &that)
Definition weak_ptr.h:23
WeakPtr & operator=(const WeakPtr &that)
Definition weak_ptr.h:36
WeakPtr(std::nullptr_t arg)
Definition weak_ptr.h:30
operator bool() const
Definition weak_ptr.h:32
void DeleteObject()
Definition weak_ptr.h:46
const T * operator->() const
Definition weak_ptr.h:35
bool HasOneRef() const
Definition weak_ptr.h:33
WeakPtr(WeakPtr &&that) noexcept
Definition weak_ptr.h:24
bool operator!=(const WeakPtr &that) const
Definition weak_ptr.h:43
WideString(char)=delete
WideString(const std::initializer_list< WideStringView > &list)
WideString & operator+=(const WideString &str)
WideString(wchar_t ch)
bool operator==(const WideString &other) const
ByteString ToUTF8() const
static WideString Format(const wchar_t *pFormat,...)
UNSAFE_BUFFER_USAGE WideString(const wchar_t *pStr, size_t len)
WideString & operator=(WideString &&that) noexcept
WideString(WideStringView str1, WideStringView str2)
WideString()=default
WideString First(size_t count) const
static WideString FromUTF8(ByteStringView str)
WideString & operator+=(const wchar_t *str)
bool operator==(const wchar_t *ptr) const
WideString & operator+=(wchar_t ch)
bool operator<(WideStringView str) const
bool EqualsASCIINoCase(ByteStringView that) const
Definition widestring.h:114
~WideString()=default
WideString(const WideString &other)=default
static WideString FromDefANSI(ByteStringView str)
int GetInteger() const
int CompareNoCase(const wchar_t *str) const
WideString(const wchar_t *ptr)
static WideString FromLatin1(ByteStringView str)
WideString(WideString &&other) noexcept=default
bool IsASCII() const
Definition widestring.h:110
bool operator==(WideStringView str) const
bool operator!=(const WideString &other) const
Definition widestring.h:85
ByteString ToLatin1() const
intptr_t ReferenceCountForTesting() const
static WideString FromUTF16BE(pdfium::span< const uint8_t > data)
bool operator<(const WideString &other) const
int Compare(const wchar_t *str) const
WideString & operator=(const WideString &that)
WideString EncodeEntities() const
ByteString ToASCII() const
static WideString FromASCII(ByteStringView str)
WideString & operator+=(WideStringView str)
static WideString FromUTF16LE(pdfium::span< const uint8_t > data)
ByteString ToUCS2LE() const
WideString Last(size_t count) const
int Compare(const WideString &str) const
WideString & operator=(const wchar_t *str)
WideString Substr(size_t offset) const
WideString(WideStringView str)
bool operator!=(const wchar_t *ptr) const
Definition widestring.h:83
static WideString FormatV(const wchar_t *lpszFormat, va_list argList)
ByteString ToUTF16LE() const
static WideString FormatInteger(int i)
bool EqualsASCII(ByteStringView that) const
Definition widestring.h:111
ByteString ToDefANSI() const
bool operator<(const wchar_t *ptr) const
WideString Substr(size_t first, size_t count) const
bool operator!=(WideStringView str) const
Definition widestring.h:84
WideString & operator=(WideStringView str)
constexpr CheckedNumericState(Src value=0.0, bool is_valid=true)
constexpr CheckedNumericState(const CheckedNumericState< Src > &rhs)
constexpr CheckedNumericState(const CheckedNumericState< Src > &rhs)
constexpr CheckedNumericState(Src value=0, bool is_valid=true)
constexpr bool AssignIfValid(Dst *result) const
static constexpr CheckedNumeric MathOp(const L lhs, const R rhs)
constexpr CheckedNumeric< typename UnderlyingType< Dst >::type > Cast() const
constexpr CheckedNumeric operator-() const
constexpr CheckedNumeric & operator>>=(const Src rhs)
constexpr CheckedNumeric & operator/=(const Src rhs)
constexpr CheckedNumeric(StrictNumeric< Src > value)
constexpr CheckedNumeric(const CheckedNumeric< Src > &rhs)
constexpr CheckedNumeric operator~() const
constexpr CheckedNumeric operator++(int)
constexpr CheckedNumeric & operator^=(const Src rhs)
constexpr CheckedNumeric & operator-=(const Src rhs)
constexpr bool IsValid() const
constexpr CheckedNumeric< typename MathWrapper< CheckedMaxOp, T, U >::type > Max(const U rhs) const
constexpr CheckedNumeric & operator++()
constexpr CheckedNumeric & operator+=(const Src rhs)
constexpr CheckedNumeric operator--(int)
constexpr StrictNumeric< Dst > ValueOrDefault(const Src default_value) const
constexpr CheckedNumeric()=default
constexpr CheckedNumeric & operator|=(const Src rhs)
constexpr CheckedNumeric< typename MathWrapper< CheckedMinOp, T, U >::type > Min(const U rhs) const
constexpr CheckedNumeric< typename UnsignedOrFloatForSize< T >::type > UnsignedAbs() const
constexpr CheckedNumeric(T value)
constexpr CheckedNumeric & operator&=(const Src rhs)
friend U GetNumericValueForTest(const CheckedNumeric< U > &src)
constexpr CheckedNumeric & operator--()
constexpr CheckedNumeric Abs() const
constexpr CheckedNumeric & operator*=(const Src rhs)
constexpr CheckedNumeric & operator%=(const Src rhs)
constexpr CheckedNumeric & MathOp(const R rhs)
constexpr CheckedNumeric(Src value)
constexpr StrictNumeric< Dst > ValueOrDie() const
constexpr ClampedNumeric< typename MathWrapper< ClampedMaxOp, T, U >::type > Max(const U rhs) const
constexpr ClampedNumeric(Src value)
constexpr ClampedNumeric(T value)
constexpr ClampedNumeric< typename UnsignedOrFloatForSize< T >::type > UnsignedAbs() const
constexpr ClampedNumeric operator++(int)
constexpr ClampedNumeric(const ClampedNumeric< Src > &rhs)
constexpr ClampedNumeric & operator*=(const Src rhs)
constexpr ClampedNumeric operator-() const
constexpr ClampedNumeric< typename MathWrapper< ClampedMinOp, T, U >::type > Min(const U rhs) const
constexpr ClampedNumeric & operator^=(const Src rhs)
constexpr ClampedNumeric operator--(int)
constexpr ClampedNumeric< typename UnderlyingType< Dst >::type > Cast() const
constexpr ClampedNumeric & operator++()
constexpr ClampedNumeric & operator>>=(const Src rhs)
constexpr ClampedNumeric & operator&=(const Src rhs)
constexpr ClampedNumeric & operator%=(const Src rhs)
constexpr ClampedNumeric Abs() const
constexpr ClampedNumeric & MathOp(const R rhs)
constexpr ClampedNumeric & operator|=(const Src rhs)
constexpr ClampedNumeric & operator+=(const Src rhs)
constexpr ClampedNumeric & operator/=(const Src rhs)
constexpr ClampedNumeric operator~() const
constexpr ClampedNumeric & operator-=(const Src rhs)
static constexpr ClampedNumeric MathOp(const L lhs, const R rhs)
constexpr ClampedNumeric & operator--()
constexpr ClampedNumeric(StrictNumeric< Src > value)
#define UNSAFE_BUFFERS(...)
#define GSL_POINTER
#define TRIVIAL_ABI
#define UNSAFE_BUFFER_USAGE
CPDF_Array * ToArray(CPDF_Object *obj)
Definition cpdf_array.h:198
const CPDF_Array * ToArray(const CPDF_Object *obj)
Definition cpdf_array.h:202
RetainPtr< CPDF_Array > ToArray(RetainPtr< CPDF_Object > obj)
Definition cpdf_array.h:206
#define FPDFCREATE_INCREMENTAL
#define FPDFCREATE_NO_ORIGINAL
const CPDF_Dictionary * ToDictionary(const CPDF_Object *obj)
RetainPtr< CPDF_Dictionary > ToDictionary(RetainPtr< CPDF_Object > obj)
CPDF_Dictionary * ToDictionary(CPDF_Object *obj)
const CPDF_Number * ToNumber(const CPDF_Object *obj)
Definition cpdf_number.h:46
RetainPtr< CPDF_Number > ToNumber(RetainPtr< CPDF_Object > obj)
Definition cpdf_number.h:50
CPDF_Number * ToNumber(CPDF_Object *obj)
Definition cpdf_number.h:42
CPDF_String * ToString(CPDF_Object *obj)
Definition cpdf_string.h:50
RetainPtr< const CPDF_String > ToString(RetainPtr< const CPDF_Object > obj)
Definition cpdf_string.h:58
const CPDF_String * ToString(const CPDF_Object *obj)
Definition cpdf_string.h:54
bool PDFCharIsWhitespace(uint8_t c)
bool ValidateDictOptionalType(const CPDF_Dictionary *dict, ByteStringView type)
std::optional< FX_FILESIZE > GetHeaderOffset(const RetainPtr< IFX_SeekableReadStream > &pFile)
bool PDFCharIsOther(uint8_t c)
ByteString PDF_NameDecode(ByteStringView orig)
const char kPDFCharTypes[256]
ByteString PDF_NameEncode(const ByteString &orig)
bool PDFCharIsNumeric(uint8_t c)
uint8_t GetPDFCharTypeFromArray(uint8_t c)
bool ValidateFontResourceDict(const CPDF_Dictionary *dict)
bool ValidateDictType(const CPDF_Dictionary *dict, ByteStringView type)
std::vector< float > ReadArrayElementsToVector(const CPDF_Array *pArray, size_t nCount)
bool ValidateDictAllResourcesOfType(const CPDF_Dictionary *dict, ByteStringView type)
bool PDFCharIsDelimiter(uint8_t c)
bool PDFCharIsLineEnding(uint8_t c)
time_t FXSYS_time(time_t *tloc)
int FXSYS_WideHexCharToInt(wchar_t c)
int32_t FXSYS_towupper(wchar_t c)
bool FXSYS_IsHexDigit(char c)
void FXSYS_IntToTwoHexChars(uint8_t n, char *buf)
void FXSYS_SetTimeFunction(time_t(*func)())
bool FXSYS_IsDecimalDigit(wchar_t c)
bool FXSYS_iswalpha(wchar_t c)
bool FXSYS_iswlower(int32_t c)
float FXSYS_wcstof(WideStringView pwsStr, size_t *pUsedLen)
int FXSYS_DecimalCharToInt(char c)
bool FXSYS_IsWideHexDigit(wchar_t c)
bool FXSYS_IsOctalDigit(char c)
bool FXSYS_SafeLT(const T &lhs, const T &rhs)
bool FXSYS_iswupper(int32_t c)
bool FXSYS_IsDecimalDigit(char c)
size_t FXSYS_ToUTF16BE(uint32_t unicode, char *buf)
bool FXSYS_IsUpperASCII(int32_t c)
char FXSYS_ToUpperASCII(char c)
int FXSYS_DecimalCharToInt(wchar_t c)
int FXSYS_HexCharToInt(char c)
bool FXSYS_IsLowerASCII(int32_t c)
bool FXSYS_iswalnum(wchar_t c)
void FXSYS_IntToFourHexChars(uint16_t n, char *buf)
bool FXSYS_iswspace(wchar_t c)
struct tm * FXSYS_localtime(const time_t *tp)
bool FXSYS_SafeEQ(const T &lhs, const T &rhs)
int32_t FXSYS_towlower(wchar_t c)
UNSAFE_BUFFER_USAGE wchar_t * FXSYS_wcsncpy(wchar_t *dstStr, const wchar_t *srcStr, size_t count)
void FXSYS_SetLocaltimeFunction(struct tm *(*func)(const time_t *))
void * FX_Random_MT_Start(uint32_t dwSeed)
Definition fx_random.cpp:87
uint32_t FX_Random_MT_Generate(void *pContext)
Definition fx_random.cpp:98
void FX_Random_GenerateMT(pdfium::span< uint32_t > pBuffer)
void FX_Random_MT_Close(void *pContext)
pdfium::CheckedNumeric< FX_FILESIZE > FX_SAFE_FILESIZE
pdfium::CheckedNumeric< uint32_t > FX_SAFE_UINT32
pdfium::CheckedNumeric< int32_t > FX_SAFE_INT32
constexpr uint32_t FXBSTR_ID(uint8_t c1, uint8_t c2, uint8_t c3, uint8_t c4)
Definition fx_string.h:19
double StringToDouble(WideStringView wsStr)
float StringToFloat(ByteStringView str)
ByteString FX_UTF8Encode(WideStringView wsStr)
Definition fx_string.cpp:68
std::u16string FX_UTF16Encode(WideStringView wsStr)
Definition fx_string.cpp:76
float StringToFloat(WideStringView wsStr)
double StringToDouble(ByteStringView str)
#define FX_FILESIZE
Definition fx_types.h:19
WideString operator+(const wchar_t *str1, WideStringView str2)
Definition widestring.h:147
bool operator==(const wchar_t *lhs, const WideString &rhs)
Definition widestring.h:177
WideString operator+(const WideString &str1, const WideString &str2)
Definition widestring.h:156
StringViewTemplate< wchar_t > WideStringView
WideString operator+(const WideString &str1, WideStringView str2)
Definition widestring.h:171
WideString operator+(const WideString &str1, wchar_t ch)
Definition widestring.h:159
bool operator!=(const U *lhs, const ObservedPtr< T > &rhs)
WideString operator+(WideStringView str1, const WideString &str2)
Definition widestring.h:174
std::vector< StrType > Split(const StrType &that, typename StrType::CharType ch)
Definition fx_string.h:36
bool operator!=(WideStringView lhs, const WideString &rhs)
Definition widestring.h:186
StringViewTemplate< char > ByteStringView
bool operator==(WideStringView lhs, const WideString &rhs)
Definition widestring.h:180
bool operator!=(const wchar_t *lhs, const WideString &rhs)
Definition widestring.h:183
WideString operator+(WideStringView str1, const wchar_t *str2)
Definition widestring.h:144
WideString operator+(WideStringView str1, wchar_t ch)
Definition widestring.h:150
void PrintTo(const WideString &str, std::ostream *os)
WideString operator+(WideStringView str1, WideStringView str2)
Definition widestring.h:141
WideString operator+(wchar_t ch, WideStringView str2)
Definition widestring.h:153
WideString operator+(wchar_t ch, const WideString &str2)
Definition widestring.h:162
WideString operator+(const wchar_t *str1, const WideString &str2)
Definition widestring.h:168
bool operator<(const wchar_t *lhs, const WideString &rhs)
Definition widestring.h:189
bool operator==(const U *lhs, const ObservedPtr< T > &rhs)
WideString operator+(const WideString &str1, const wchar_t *str2)
Definition widestring.h:165
constexpr CheckedNumeric< typename MathWrapper< M, L, R >::type > CheckMathOp(const L lhs, const R rhs)
constexpr ClampedNumeric< typename MathWrapper< M, L, R >::type > ClampMathOp(const L lhs, const R rhs)
constexpr bool CheckedMulImpl(T x, T y, T *result)
constexpr bool IsValidForType(const CheckedNumeric< Src > value)
constexpr std::make_unsigned< T >::type InvertWrapper(T value)
constexpr CheckedNumeric< typename UnderlyingType< T >::type > MakeCheckedNum(const T value)
constexpr T NegateWrapper(T value)
constexpr StrictNumeric< Dst > ValueOrDefaultForType(const CheckedNumeric< Src > value, const Default default_value)
constexpr auto CheckMathOp(const L lhs, const R rhs, const Args... args)
constexpr bool CheckedSubImpl(T x, T y, T *result)
constexpr T AbsWrapper(T value)
constexpr StrictNumeric< Dst > ValueOrDieForType(const CheckedNumeric< Src > value)
L * operator+(L *lhs, const StrictNumeric< R > rhs)
constexpr bool CheckedAddImpl(T x, T y, T *result)
constexpr ClampedNumeric< typename UnderlyingType< T >::type > MakeClampedNum(const T value)
L * operator-(L *lhs, const StrictNumeric< R > rhs)
constexpr auto ClampMathOp(const L lhs, const R rhs, const Args... args)
UnownedPtr< T > WrapUnowned(T *that)
bool Contains(const Container &container, const Value &value)
Definition contains.h:69
std::set< uint32_t > GetObjectsWithReferences(const CPDF_Document *document)
std::set< uint32_t > GetObjectsWithMultipleReferences(const CPDF_Document *document)
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:222
#define BASE_NUMERIC_COMPARISON_OPERATORS(CLASS, NAME, OP)
#define BASE_NUMERICS_LIKELY(x)
#define BASE_NUMERICS_UNLIKELY(x)
#define IsConstantEvaluated()
#define BASE_HAS_OPTIMIZED_SAFE_MATH
#define BASE_NUMERIC_ARITHMETIC_OPERATORS(CLASS, CL_ABBR, OP_NAME, OP, CMP_OP)
#define BASE_NUMERIC_ARITHMETIC_VARIADIC(CLASS, CL_ABBR, OP_NAME)
StringPoolTemplate< WideString > WideStringPool
StringPoolTemplate< ByteString > ByteStringPool
fxcrt::ByteStringView ByteStringView
fxcrt::WideStringView WideStringView
static constexpr bool value
static const NumericRepresentation value
typename math::result_type type
M< typename UnderlyingType< L >::type, typename UnderlyingType< R >::type, void > math
size_t operator()(const WideString &str) const
Definition widestring.h:216
#define UNOWNED_PTR_EXCLUSION
fxcrt::WideString WideString
Definition widestring.h:207
uint32_t FX_HashCode_GetLoweredW(WideStringView str)
uint32_t FX_HashCode_GetW(WideStringView str)