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
cpdf_array.h
Go to the documentation of this file.
1// Copyright 2016 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// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7#ifndef CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_
8#define CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_
9
10#include <stddef.h>
11
12#include <set>
13#include <type_traits>
14#include <utility>
15#include <vector>
16
17#include "core/fpdfapi/parser/cpdf_indirect_object_holder.h"
18#include "core/fpdfapi/parser/cpdf_object.h"
19#include "core/fxcrt/fx_coordinates.h"
20#include "core/fxcrt/retain_ptr.h"
21#include "third_party/abseil-cpp/absl/types/optional.h"
22#include "third_party/base/check.h"
23
24// Arrays never contain nullptrs for objects within bounds, but some of the
25// methods will tolerate out-of-bounds indices and return nullptr for those
26// cases.
27class CPDF_Array final : public CPDF_Object {
28 public:
29 using const_iterator = std::vector<RetainPtr<CPDF_Object>>::const_iterator;
30
32
33 // CPDF_Object:
34 Type GetType() const override;
35 RetainPtr<CPDF_Object> Clone() const override;
36 CPDF_Array* AsMutableArray() override;
37 bool WriteTo(IFX_ArchiveStream* archive,
38 const CPDF_Encryptor* encryptor) const override;
39
40 bool IsEmpty() const { return m_Objects.empty(); }
41 size_t size() const { return m_Objects.size(); }
42
43 // The Get*ObjectAt() methods tolerate out-of-bounds indices and return
44 // nullptr in those cases. Otherwise, for in-bound indices, the result
45 // is never nullptr.
47 RetainPtr<const CPDF_Object> GetObjectAt(size_t index) const;
48
49 // The Get*DirectObjectAt() methods tolerate out-of-bounds indices and
50 // return nullptr in those cases. Furthermore, for reference objects that
51 // do not correspond to a valid indirect object, nullptr is returned.
53 RetainPtr<const CPDF_Object> GetDirectObjectAt(size_t index) const;
54
55 // The Get*At() methods tolerate out-of-bounds indices and return nullptr
56 // in those cases. Furthermore, these safely coerce to the sub-class,
57 // returning nullptr if the object at the location is of a different type.
58 ByteString GetByteStringAt(size_t index) const;
59 WideString GetUnicodeTextAt(size_t index) const;
60 bool GetBooleanAt(size_t index, bool bDefault) const;
61 int GetIntegerAt(size_t index) const;
62 float GetFloatAt(size_t index) const;
63 RetainPtr<CPDF_Dictionary> GetMutableDictAt(size_t index);
64 RetainPtr<const CPDF_Dictionary> GetDictAt(size_t index) const;
65 RetainPtr<CPDF_Stream> GetMutableStreamAt(size_t index);
66 RetainPtr<const CPDF_Stream> GetStreamAt(size_t index) const;
67 RetainPtr<CPDF_Array> GetMutableArrayAt(size_t index);
68 RetainPtr<const CPDF_Array> GetArrayAt(size_t index) const;
69 RetainPtr<const CPDF_Number> GetNumberAt(size_t index) const;
70 RetainPtr<const CPDF_String> GetStringAt(size_t index) const;
71
72 CFX_FloatRect GetRect() const;
73 CFX_Matrix GetMatrix() const;
74
75 absl::optional<size_t> Find(const CPDF_Object* pThat) const;
76 bool Contains(const CPDF_Object* pThat) const;
77
78 // Creates object owned by the array, and returns a retained pointer to it.
79 // We have special cases for objects that can intern strings from
80 // a ByteStringPool. Prefer using these templates over direct calls
81 // to Append()/SetAt()/InsertAt() since by creating a new object with no
82 // previous references, they ensure cycles can not be introduced.
83 template <typename T, typename... Args>
84 typename std::enable_if<!CanInternStrings<T>::value, RetainPtr<T>>::type
85 AppendNew(Args&&... args) {
86 return pdfium::WrapRetain(static_cast<T*>(
87 AppendInternal(pdfium::MakeRetain<T>(std::forward<Args>(args)...))));
88 }
89 template <typename T, typename... Args>
90 typename std::enable_if<CanInternStrings<T>::value, RetainPtr<T>>::type
91 AppendNew(Args&&... args) {
92 return pdfium::WrapRetain(static_cast<T*>(AppendInternal(
93 pdfium::MakeRetain<T>(m_pPool, std::forward<Args>(args)...))));
94 }
95 template <typename T, typename... Args>
96 typename std::enable_if<!CanInternStrings<T>::value, RetainPtr<T>>::type
97 SetNewAt(size_t index, Args&&... args) {
98 return pdfium::WrapRetain(static_cast<T*>(SetAtInternal(
99 index, pdfium::MakeRetain<T>(std::forward<Args>(args)...))));
100 }
101 template <typename T, typename... Args>
102 typename std::enable_if<CanInternStrings<T>::value, RetainPtr<T>>::type
103 SetNewAt(size_t index, Args&&... args) {
104 return pdfium::WrapRetain(static_cast<T*>(SetAtInternal(
105 index, pdfium::MakeRetain<T>(m_pPool, std::forward<Args>(args)...))));
106 }
107 template <typename T, typename... Args>
108 typename std::enable_if<!CanInternStrings<T>::value, RetainPtr<T>>::type
109 InsertNewAt(size_t index, Args&&... args) {
110 return pdfium::WrapRetain(static_cast<T*>(InsertAtInternal(
111 index, pdfium::MakeRetain<T>(std::forward<Args>(args)...))));
112 }
113 template <typename T, typename... Args>
114 typename std::enable_if<CanInternStrings<T>::value, RetainPtr<T>>::type
115 InsertNewAt(size_t index, Args&&... args) {
116 return pdfium::WrapRetain(static_cast<T*>(InsertAtInternal(
117 index, pdfium::MakeRetain<T>(m_pPool, std::forward<Args>(args)...))));
118 }
119
120 // Adds non-null `object` to the end of the array, growing as appropriate.
121 void Append(RetainPtr<CPDF_Object> object);
122 void Append(RetainPtr<CPDF_Stream> stream) = delete;
123
124 // Overwrites the object at `index` with non-null `object`, if it is
125 // in bounds. Otherwise, `index` is out of bounds, and `object` is
126 // not stored.
127 void SetAt(size_t index, RetainPtr<CPDF_Object> object);
128 void SetAt(size_t index, RetainPtr<CPDF_Stream> stream) = delete;
129
130 // Inserts non-null `object` at `index` and shifts by one position all of the
131 // objects beyond it like std::vector::insert(), if `index` is less than or
132 // equal to the current array size. Otherwise, `index` is out of bounds,
133 // and `object` is not stored.
134 void InsertAt(size_t index, RetainPtr<CPDF_Object> object);
135 void InsertAt(size_t index, RetainPtr<CPDF_Stream> stream) = delete;
136
137 void Clear();
138 void RemoveAt(size_t index);
139 void ConvertToIndirectObjectAt(size_t index,
141 bool IsLocked() const { return !!m_LockCount; }
142
143 private:
144 friend class CPDF_ArrayLocker;
145
146 CPDF_Array();
147 explicit CPDF_Array(const WeakPtr<ByteStringPool>& pPool);
148 ~CPDF_Array() override;
149
150 // No guarantees about result lifetime, use with caution.
151 const CPDF_Object* GetObjectAtInternal(size_t index) const;
152 CPDF_Object* GetMutableObjectAtInternal(size_t index);
153 CPDF_Object* AppendInternal(RetainPtr<CPDF_Object> pObj);
154 CPDF_Object* SetAtInternal(size_t index, RetainPtr<CPDF_Object> pObj);
155 CPDF_Object* InsertAtInternal(size_t index, RetainPtr<CPDF_Object> pObj);
156
158 bool bDirect,
159 std::set<const CPDF_Object*>* pVisited) const override;
160
161 std::vector<RetainPtr<CPDF_Object>> m_Objects;
162 WeakPtr<ByteStringPool> m_pPool;
163 mutable uint32_t m_LockCount = 0;
164};
165
167 public:
168 FX_STACK_ALLOCATED();
170
171 explicit CPDF_ArrayLocker(const CPDF_Array* pArray);
172 explicit CPDF_ArrayLocker(RetainPtr<CPDF_Array> pArray);
173 explicit CPDF_ArrayLocker(RetainPtr<const CPDF_Array> pArray);
175
177 CHECK(m_pArray->IsLocked());
178 return m_pArray->m_Objects.begin();
179 }
181 CHECK(m_pArray->IsLocked());
182 return m_pArray->m_Objects.end();
183 }
184
185 private:
186 RetainPtr<const CPDF_Array> const m_pArray;
187};
188
189inline CPDF_Array* ToArray(CPDF_Object* obj) {
190 return obj ? obj->AsMutableArray() : nullptr;
191}
192
193inline const CPDF_Array* ToArray(const CPDF_Object* obj) {
194 return obj ? obj->AsArray() : nullptr;
195}
196
197inline RetainPtr<CPDF_Array> ToArray(RetainPtr<CPDF_Object> obj) {
198 return RetainPtr<CPDF_Array>(ToArray(obj.Get()));
199}
200
201inline RetainPtr<const CPDF_Array> ToArray(RetainPtr<const CPDF_Object> obj) {
202 return RetainPtr<const CPDF_Array>(ToArray(obj.Get()));
203}
204
205#endif // CORE_FPDFAPI_PARSER_CPDF_ARRAY_H_
uint32_t FX_HashCode_GetLoweredAsIfW(ByteStringView str)
uint32_t FX_HashCode_GetLoweredA(ByteStringView str)
uint32_t FX_HashCode_GetAsIfW(ByteStringView str)
uint32_t FX_HashCode_GetA(ByteStringView str)
CPDF_ArrayLocker(RetainPtr< CPDF_Array > pArray)
const_iterator begin() const
Definition cpdf_array.h:176
const_iterator end() const
Definition cpdf_array.h:180
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
absl::optional< size_t > Find(const CPDF_Object *pThat) const
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:91
RetainPtr< const CPDF_Dictionary > GetDictAt(size_t index) const
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type InsertNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:109
bool IsLocked() const
Definition cpdf_array.h:141
RetainPtr< CPDF_Stream > GetMutableStreamAt(size_t index)
bool Contains(const CPDF_Object *pThat) const
void ConvertToIndirectObjectAt(size_t index, CPDF_IndirectObjectHolder *pHolder)
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type InsertNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:115
std::enable_if<!CanInternStrings< T >::value, RetainPtr< T > >::type SetNewAt(size_t index, Args &&... args)
Definition cpdf_array.h:97
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:103
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)
const CPDF_Array * AsArray() const
virtual CPDF_Array * AsMutableArray()
virtual FX_FILESIZE CurrentOffset() const =0
static RetainPtr< IFX_SeekableReadStream > CreateFromFilename(const char *filename)
Definition fx_stream.cpp:68
virtual size_t ReadBlock(pdfium::span< uint8_t > buffer)
Definition fx_stream.cpp:88
virtual FX_FILESIZE GetPosition()
Definition fx_stream.cpp:84
virtual bool ReadBlockAtOffset(pdfium::span< uint8_t > buffer, FX_FILESIZE offset)=0
virtual bool IsEOF()
Definition fx_stream.cpp:80
bool WriteBlock(pdfium::span< const uint8_t > buffer) override
Definition fx_stream.cpp:92
virtual bool WriteBlockAtOffset(pdfium::span< const uint8_t > data, FX_FILESIZE offset)=0
bool WriteBlock(pdfium::span< const uint8_t > buffer) override
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:51
bool WriteString(ByteStringView str)
Definition fx_stream.cpp:47
virtual ~IFX_WriteStream()=default
bool WriteDWord(uint32_t i)
Definition fx_stream.cpp:55
virtual bool WriteBlock(pdfium::span< const uint8_t > data)=0
void TrimLeft(ByteStringView targets)
bool IsValidLength(size_t length) const
Definition bytestring.h:121
bool Contains(ByteStringView lpszSub, size_t start=0) const
Definition bytestring.h:187
const_iterator begin() const
Definition bytestring.h:102
bool IsValidIndex(size_t index) const
Definition bytestring.h:120
static ByteString FormatFloat(float f)
ByteStringView AsStringView() const
Definition bytestring.h:87
uint32_t GetID() const
Definition bytestring.h:213
void Reserve(size_t len)
ByteString(const char *ptr)
bool EqualNoCase(ByteStringView str) const
static ByteString Format(const char *pFormat,...)
ByteString & operator+=(const ByteString &str)
bool operator!=(ByteStringView str) const
Definition bytestring.h:131
size_t GetLength() const
Definition bytestring.h:115
ByteString Substr(size_t first, size_t count) const
size_t GetStringLength() const
Definition bytestring.h:116
size_t InsertAtBack(char ch)
Definition bytestring.h:162
bool operator==(ByteStringView str) const
pdfium::span< const uint8_t > raw_span() const
Definition bytestring.h:97
void AllocCopy(ByteString &dest, size_t nCopyLen, size_t nCopyIndex) const
void AssignCopy(const char *pSrcData, size_t nSrcLen)
bool Contains(char ch, size_t start=0) const
Definition bytestring.h:191
absl::optional< size_t > ReverseFind(char ch) const
intptr_t ReferenceCountForTesting() const
size_t Delete(size_t index, size_t count=1)
const_reverse_iterator rend() const
Definition bytestring.h:111
ByteString & operator+=(char ch)
const uint8_t * raw_str() const
Definition bytestring.h:80
void ReallocBeforeWrite(size_t nNewLen)
ByteString(ByteStringView bstrc)
RetainPtr< StringData > m_pData
Definition bytestring.h:225
static ByteString FormatInteger(int i)
pdfium::span< char > GetBuffer(size_t nMinBufLength)
void Trim(char target)
bool operator==(const ByteString &other) const
bool operator==(const char *ptr) const
const_iterator end() const
Definition bytestring.h:103
ByteString(const ByteString &other)
size_t Remove(char ch)
ByteString(const char *pStr, size_t len)
bool operator<(ByteStringView str) const
ByteString(wchar_t)=delete
ByteString & operator+=(const char *str)
ByteString & operator+=(ByteStringView str)
ByteString(const uint8_t *pStr, size_t len)
size_t Replace(ByteStringView pOld, ByteStringView pNew)
absl::optional< size_t > Find(ByteStringView subStr, size_t start=0) const
bool operator!=(const ByteString &other) const
Definition bytestring.h:132
void SetAt(size_t index, char c)
ByteString & operator=(ByteStringView str)
ByteString(ByteStringView str1, ByteStringView str2)
void Trim(ByteStringView targets)
ByteString & operator=(const char *str)
static ByteString FormatV(const char *pFormat, va_list argList)
void TrimRight(char target)
const char * c_str() const
Definition bytestring.h:76
ByteString Substr(size_t offset) const
ByteString & operator=(const ByteString &that)
ByteString & operator=(ByteString &&that) noexcept
bool IsEmpty() const
Definition bytestring.h:119
void TrimRight(ByteStringView targets)
bool operator<(const ByteString &other) const
ByteString(const std::initializer_list< ByteStringView > &list)
CharType operator[](const size_t index) const
Definition bytestring.h:150
const_reverse_iterator rbegin() const
Definition bytestring.h:108
CharType Back() const
Definition bytestring.h:156
CharType Front() const
Definition bytestring.h:155
bool operator!=(const char *ptr) const
Definition bytestring.h:130
int Compare(ByteStringView str) const
size_t Insert(size_t index, char ch)
void ReleaseBuffer(size_t nNewLength)
ByteString(const fxcrt::ostringstream &outStream)
void TrimLeft(char target)
size_t InsertAtFront(char ch)
Definition bytestring.h:161
ByteString First(size_t count) const
void AllocBeforeWrite(size_t nNewLen)
bool operator<(const char *ptr) const
void Concat(const char *pSrcData, size_t nSrcLen)
absl::optional< size_t > Find(char ch, size_t start=0) const
ByteString(ByteString &&other) noexcept
ByteString Last(size_t count) const
U * AsRaw() const
Definition retain_ptr.h:107
RetainPtr & operator=(const RetainPtr< U > &that)
Definition retain_ptr.h:89
operator bool() const
Definition retain_ptr.h:149
void Unleak(T *ptr)
Definition retain_ptr.h:130
RetainPtr(std::nullptr_t ptr)
Definition retain_ptr.h:35
void Reset(T *obj=nullptr)
Definition retain_ptr.h:116
bool operator!=(const RetainPtr &that) const
Definition retain_ptr.h:133
void Swap(RetainPtr &that)
Definition retain_ptr.h:126
RetainPtr() noexcept=default
RetainPtr(RetainPtr &&that) noexcept
Definition retain_ptr.h:48
bool operator!=(const U &that) const
Definition retain_ptr.h:141
RetainPtr & operator=(const RetainPtr &that)
Definition retain_ptr.h:72
bool operator==(const RetainPtr &that) const
Definition retain_ptr.h:132
T & operator*() const
Definition retain_ptr.h:150
bool operator==(const U &that) const
Definition retain_ptr.h:136
RetainPtr & operator=(RetainPtr &&that) noexcept
Definition retain_ptr.h:80
T * operator->() const
Definition retain_ptr.h:151
RetainPtr & operator=(RetainPtr< U > &&that) noexcept
Definition retain_ptr.h:99
RetainPtr(const RetainPtr< U > &that)
Definition retain_ptr.h:54
T * Get() const noexcept
Definition retain_ptr.h:123
~RetainPtr()=default
bool operator<(const RetainPtr &that) const
Definition retain_ptr.h:145
RetainPtr(const RetainPtr &that) noexcept
Definition retain_ptr.h:44
operator T*() const noexcept
Definition retain_ptr.h:122
RetainPtr & operator=(std::nullptr_t) noexcept
Definition retain_ptr.h:65
UnownedPtr< T > BackPointer() const
Definition retain_ptr.h:125
RetainPtr(RetainPtr< U > &&that) noexcept
Definition retain_ptr.h:60
RetainPtr< U > As() const
Definition retain_ptr.h:112
RetainPtr(T *pObj) noexcept
Definition retain_ptr.h:37
bool HasOneRef() const
Definition retain_ptr.h:162
Retainable()=default
virtual ~Retainable()=default
void CopyContents(const CharType *pStr, size_t nLen)
static StringDataTemplate * Create(size_t nLen)
void CopyContents(const StringDataTemplate &other)
bool CanOperateInPlace(size_t nTotalLen) const
static StringDataTemplate * Create(const CharType *pStr, size_t nLen)
void CopyContentsAt(size_t offset, const CharType *pStr, size_t nLen)
absl::optional< size_t > Find(CharType ch) const
bool operator>(const StringViewTemplate &that) const
StringViewTemplate(const CharType *ptr) noexcept
bool operator<(const StringViewTemplate &that) const
constexpr StringViewTemplate(const UnsignedType *ptr, size_t size) noexcept
bool IsValidLength(size_t length) const
constexpr StringViewTemplate(const CharType *ptr, size_t size) noexcept
bool operator!=(const CharType *ptr) const
StringViewTemplate TrimmedRight(CharType ch) const
pdfium::span< const UnsignedType > m_Span
bool EqualsASCII(const StringViewTemplate< char > &that) const
const CharType * unterminated_c_str() const
bool operator==(const CharType *ptr) const
bool Contains(CharType ch) const
bool EqualsASCIINoCase(const StringViewTemplate< char > &that) const
pdfium::span< const UnsignedType > raw_span() const
StringViewTemplate Substr(size_t first, size_t count) const
bool operator==(const StringViewTemplate &other) const
const_iterator end() const
const UnsignedType & operator[](const size_t index) const
StringViewTemplate Last(size_t count) const
CharType CharAt(const size_t index) const
bool operator!=(const StringViewTemplate &other) const
StringViewTemplate First(size_t count) const
constexpr StringViewTemplate(const pdfium::span< const CharType > &other) noexcept
constexpr StringViewTemplate(const StringViewTemplate &src) noexcept=default
const_iterator begin() const
StringViewTemplate & operator=(const StringViewTemplate &src)
const_reverse_iterator rend() const
StringViewTemplate & operator=(const CharType *src)
StringViewTemplate Substr(size_t offset) const
constexpr StringViewTemplate() noexcept=default
constexpr StringViewTemplate(const CharType &ch) noexcept
const_reverse_iterator rbegin() const
const UnsignedType * raw_str() const
bool IsValidIndex(size_t index) const
constexpr StringViewTemplate(const pdfium::span< const UnsignedType > &other) noexcept
T * get() const noexcept
UnownedPtr(const UnownedPtr< U > &that)
Definition unowned_ptr.h:98
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:83
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:91
constexpr UnownedPtr(std::nullptr_t ptr)
Definition unowned_ptr.h:81
CPDF_Array * ToArray(CPDF_Object *obj)
Definition cpdf_array.h:189
const CPDF_Array * ToArray(const CPDF_Object *obj)
Definition cpdf_array.h:193
RetainPtr< CPDF_Array > ToArray(RetainPtr< CPDF_Object > obj)
Definition cpdf_array.h:197
#define FPDFCREATE_INCREMENTAL
#define FPDFCREATE_NO_ORIGINAL
NOINLINE void FX_OutOfMemoryTerminate(size_t size)
Definition fx_memory.cpp:37
void FXMEM_DefaultFree(void *pointer)
Definition fx_memory.cpp:33
void * FXMEM_DefaultAlloc(size_t byte_size)
Definition fx_memory.cpp:21
void * FXMEM_DefaultCalloc(size_t num_elems, size_t byte_size)
Definition fx_memory.cpp:25
void * FXMEM_DefaultRealloc(void *pointer, size_t new_size)
Definition fx_memory.cpp:29
void * FX_ArrayBufferAllocate(size_t length)
void FX_InitializeMemoryAllocators()
void FX_ArrayBufferFree(void *data)
void * FX_ArrayBufferAllocateUninitialized(size_t length)
void * FX_Random_MT_Start(uint32_t dwSeed)
Definition fx_random.cpp:85
uint32_t FX_Random_MT_Generate(void *pContext)
Definition fx_random.cpp:96
void FX_Random_MT_Close(void *pContext)
#define FX_FILESIZE
Definition fx_types.h:19
bool operator==(const char *lhs, const ByteString &rhs)
Definition bytestring.h:233
bool operator<(const ByteStringView &lhs, const char *rhs)
Definition bytestring.h:251
ByteString operator+(const ByteString &str1, const ByteString &str2)
Definition bytestring.h:270
ByteString operator+(ByteStringView str1, const char *str2)
Definition bytestring.h:258
bool operator<(const ByteStringView &lhs, const ByteString &rhs)
Definition bytestring.h:248
bool operator==(const T *lhs, const StringViewTemplate< T > &rhs)
bool operator<(const T *lhs, const StringViewTemplate< T > &rhs)
ByteString operator+(const ByteString &str1, char ch)
Definition bytestring.h:273
ByteString operator+(const ByteString &str1, const char *str2)
Definition bytestring.h:279
void PrintTo(const ByteString &str, std::ostream *os)
bool operator!=(const T *lhs, const StringViewTemplate< T > &rhs)
ByteString operator+(char ch, const ByteString &str2)
Definition bytestring.h:276
ByteString operator+(const ByteString &str1, ByteStringView str2)
Definition bytestring.h:285
ByteString operator+(const char *str1, const ByteString &str2)
Definition bytestring.h:282
bool operator!=(ByteStringView lhs, const ByteString &rhs)
Definition bytestring.h:242
bool operator!=(const char *lhs, const ByteString &rhs)
Definition bytestring.h:239
ByteString operator+(ByteStringView str1, ByteStringView str2)
Definition bytestring.h:255
ByteString operator+(ByteStringView str1, char ch)
Definition bytestring.h:264
bool operator<(const char *lhs, const ByteString &rhs)
Definition bytestring.h:245
ByteString operator+(char ch, ByteStringView str2)
Definition bytestring.h:267
ByteString operator+(ByteStringView str1, const ByteString &str2)
Definition bytestring.h:288
ByteString operator+(const char *str1, ByteStringView str2)
Definition bytestring.h:261
bool operator==(ByteStringView lhs, const ByteString &rhs)
Definition bytestring.h:236
void * CallocOrDie2D(size_t w, size_t h, size_t member_size)
Definition fx_memory.cpp:79
void * AllocOrDie2D(size_t w, size_t h, size_t member_size)
Definition fx_memory.cpp:65
void * StringAllocOrDie(size_t num_members, size_t member_size)
Definition fx_memory.cpp:94
void * Alloc(size_t num_members, size_t member_size)
void * StringAlloc(size_t num_members, size_t member_size)
void * ReallocOrDie(void *ptr, size_t num_members, size_t member_size)
Definition fx_memory.cpp:86
void * Realloc(void *ptr, size_t num_members, size_t member_size)
void StringDealloc(void *ptr)
void * AllocOrDie(size_t num_members, size_t member_size)
Definition fx_memory.cpp:57
void * Calloc(size_t num_members, size_t member_size)
void * CallocOrDie(size_t num_members, size_t member_size)
Definition fx_memory.cpp:71
void Dealloc(void *ptr)
UnownedPtr< T > WrapUnowned(T *that)
RetainPtr< T > MakeRetain(Args &&... args)
Definition retain_ptr.h:209
RetainPtr< T > WrapRetain(T *that)
Definition retain_ptr.h:216
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224
void operator()(void *ptr) const
pointer allocate(size_type n, const void *hint=0)
void deallocate(pointer p, size_type n)
const_pointer address(const_reference x) const noexcept
FxPartitionAllocAllocator() noexcept=default
size_type max_size() const noexcept
~FxPartitionAllocAllocator()=default
pointer address(reference x) const noexcept
FxPartitionAllocAllocator(const FxPartitionAllocAllocator< U, Alloc, Free > &other) noexcept
bool operator!=(const FxPartitionAllocAllocator &that)
void construct(U *p, Args &&... args)
bool operator==(const FxPartitionAllocAllocator &that)
FxPartitionAllocAllocator(const FxPartitionAllocAllocator &other) noexcept=default
void operator()(T *ptr) const
Definition retain_ptr.h:24
size_t operator()(const ByteString &str) const
Definition bytestring.h:315
#define UNOWNED_PTR_EXCLUSION