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_Dictionary Class Referencefinal

#include <cpdf_dictionary.h>

+ Inheritance diagram for CPDF_Dictionary:
+ Collaboration diagram for CPDF_Dictionary:

Public Types

using DictMap = std::map<ByteString, RetainPtr<CPDF_Object>, std::less<>>
 
using const_iterator = DictMap::const_iterator
 
- Public Types inherited from CPDF_Object
enum  Type {
  kBoolean = 1 , kNumber , kString , kName ,
  kArray , kDictionary , kStream , kNullobj ,
  kReference
}
 

Public Member Functions

Type GetType () const override
 
RetainPtr< CPDF_ObjectClone () const override
 
CPDF_DictionaryAsMutableDictionary () override
 
bool WriteTo (IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
 
bool IsLocked () const
 
size_t size () const
 
RetainPtr< const CPDF_ObjectGetObjectFor (const ByteString &key) const
 
RetainPtr< CPDF_ObjectGetMutableObjectFor (const ByteString &key)
 
RetainPtr< const CPDF_ObjectGetDirectObjectFor (const ByteString &key) const
 
RetainPtr< CPDF_ObjectGetMutableDirectObjectFor (const ByteString &key)
 
ByteString GetByteStringFor (const ByteString &key) const
 
ByteString GetByteStringFor (const ByteString &key, const ByteString &default_str) const
 
WideString GetUnicodeTextFor (const ByteString &key) const
 
ByteString GetNameFor (const ByteString &key) const
 
bool GetBooleanFor (const ByteString &key, bool bDefault) const
 
int GetIntegerFor (const ByteString &key) const
 
int GetIntegerFor (const ByteString &key, int default_int) const
 
int GetDirectIntegerFor (const ByteString &key) const
 
float GetFloatFor (const ByteString &key) const
 
RetainPtr< const CPDF_DictionaryGetDictFor (const ByteString &key) const
 
RetainPtr< CPDF_DictionaryGetMutableDictFor (const ByteString &key)
 
RetainPtr< CPDF_DictionaryGetOrCreateDictFor (const ByteString &key)
 
RetainPtr< const CPDF_ArrayGetArrayFor (const ByteString &key) const
 
RetainPtr< CPDF_ArrayGetMutableArrayFor (const ByteString &key)
 
RetainPtr< CPDF_ArrayGetOrCreateArrayFor (const ByteString &key)
 
RetainPtr< const CPDF_StreamGetStreamFor (const ByteString &key) const
 
RetainPtr< CPDF_StreamGetMutableStreamFor (const ByteString &key)
 
RetainPtr< const CPDF_NumberGetNumberFor (const ByteString &key) const
 
RetainPtr< const CPDF_StringGetStringFor (const ByteString &key) const
 
CFX_FloatRect GetRectFor (const ByteString &key) const
 
CFX_Matrix GetMatrixFor (const ByteString &key) const
 
bool KeyExist (const ByteString &key) const
 
std::vector< ByteStringGetKeys () const
 
template<typename T , typename... Args>
std::enable_if<!CanInternStrings< T >::value &&!std::is_same< T, CPDF_Stream >::value, RetainPtr< T > >::type SetNewFor (const ByteString &key, Args &&... args)
 
template<typename T , typename... Args>
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type SetNewFor (const ByteString &key, Args &&... args)
 
void SetFor (const ByteString &key, RetainPtr< CPDF_Object > object)
 
void SetFor (const ByteString &key, RetainPtr< CPDF_Stream > stream)=delete
 
void SetRectFor (const ByteString &key, const CFX_FloatRect &rect)
 
void SetMatrixFor (const ByteString &key, const CFX_Matrix &matrix)
 
void ConvertToIndirectObjectFor (const ByteString &key, CPDF_IndirectObjectHolder *pHolder)
 
RetainPtr< CPDF_ObjectRemoveFor (ByteStringView key)
 
void ReplaceKey (const ByteString &oldkey, const ByteString &newkey)
 
WeakPtr< ByteStringPoolGetByteStringPool () const
 
- Public Member Functions inherited from CPDF_Object
uint32_t GetObjNum () const
 
void SetObjNum (uint32_t objnum)
 
uint32_t GetGenNum () const
 
void SetGenNum (uint32_t gennum)
 
bool IsInline () const
 
uint64_t KeyForCache () const
 
RetainPtr< CPDF_ObjectCloneDirectObject () const
 
virtual ByteString GetString () const
 
virtual WideString GetUnicodeText () const
 
virtual float GetNumber () const
 
virtual int GetInteger () const
 
virtual void SetString (const ByteString &str)
 
virtual CPDF_ArrayAsMutableArray ()
 
virtual CPDF_BooleanAsMutableBoolean ()
 
virtual CPDF_NameAsMutableName ()
 
virtual CPDF_NullAsMutableNull ()
 
virtual CPDF_NumberAsMutableNumber ()
 
virtual CPDF_ReferenceAsMutableReference ()
 
virtual CPDF_StreamAsMutableStream ()
 
virtual CPDF_StringAsMutableString ()
 
virtual RetainPtr< CPDF_ReferenceMakeReference (CPDF_IndirectObjectHolder *holder) const
 
RetainPtr< const CPDF_ObjectGetDirect () const
 
RetainPtr< CPDF_ObjectGetMutableDirect ()
 
RetainPtr< const CPDF_DictionaryGetDict () const
 
RetainPtr< CPDF_DictionaryGetMutableDict ()
 
const CPDF_ArrayAsArray () const
 
const CPDF_BooleanAsBoolean () const
 
const CPDF_DictionaryAsDictionary () const
 
const CPDF_NameAsName () const
 
const CPDF_NullAsNull () const
 
const CPDF_NumberAsNumber () const
 
const CPDF_ReferenceAsReference () const
 
const CPDF_StreamAsStream () const
 
const CPDF_StringAsString () const
 
bool IsArray () const
 
bool IsBoolean () const
 
bool IsDictionary () const
 
bool IsName () const
 
bool IsNull () const
 
bool IsNumber () const
 
bool IsReference () const
 
bool IsStream () const
 
bool IsString () const
 
- Public Member Functions inherited from fxcrt::Retainable
 Retainable ()=default
 
bool HasOneRef () const
 

Public Attributes

 CONSTRUCT_VIA_MAKE_RETAIN
 

Private Member Functions

 ~CPDF_Dictionary () override
 
const CPDF_DictionaryGetDictInternal () const override
 
RetainPtr< CPDF_ObjectCloneNonCyclic (bool bDirect, std::set< const CPDF_Object * > *visited) const override
 

Friends

class CPDF_DictionaryLocker
 

Additional Inherited Members

- Static Public Attributes inherited from CPDF_Object
static constexpr uint32_t kInvalidObjNum = static_cast<uint32_t>(-1)
 
- Protected Member Functions inherited from CPDF_Object
 CPDF_Object ()=default
 
 CPDF_Object (const CPDF_Object &src)=delete
 
 ~CPDF_Object () override
 
virtual const CPDF_ObjectGetDirectInternal () const
 
RetainPtr< CPDF_ObjectCloneObjectNonCyclic (bool bDirect) const
 
- Protected Member Functions inherited from fxcrt::Retainable
virtual ~Retainable ()=default
 
- Protected Attributes inherited from CPDF_Object
uint32_t m_ObjNum = 0
 
uint32_t m_GenNum = 0
 

Detailed Description

Definition at line 29 of file cpdf_dictionary.h.

Member Typedef Documentation

◆ const_iterator

using CPDF_Dictionary::const_iterator = DictMap::const_iterator

Definition at line 32 of file cpdf_dictionary.h.

◆ DictMap

using CPDF_Dictionary::DictMap = std::map<ByteString, RetainPtr<CPDF_Object>, std::less<>>

Definition at line 31 of file cpdf_dictionary.h.

Member Function Documentation

◆ ~CPDF_Dictionary()

CPDF_Dictionary::~CPDF_Dictionary ( )
overrideprivate

Definition at line 31 of file cpdf_dictionary.cpp.

References CPDF_Object::kInvalidObjNum, and CPDF_Object::m_ObjNum.

◆ AsMutableDictionary()

CPDF_Dictionary * CPDF_Dictionary::AsMutableDictionary ( )
overridevirtual

Reimplemented from CPDF_Object.

Definition at line 45 of file cpdf_dictionary.cpp.

◆ Clone()

RetainPtr< CPDF_Object > CPDF_Dictionary::Clone ( ) const
overridevirtual

Implements CPDF_Object.

Definition at line 49 of file cpdf_dictionary.cpp.

References CPDF_Object::CloneObjectNonCyclic().

+ Here is the call graph for this function:

◆ CloneNonCyclic()

RetainPtr< CPDF_Object > CPDF_Dictionary::CloneNonCyclic ( bool bDirect,
std::set< const CPDF_Object * > * visited ) const
overrideprivatevirtual

Reimplemented from CPDF_Object.

Definition at line 53 of file cpdf_dictionary.cpp.

References CPDF_DictionaryLocker::CPDF_DictionaryLocker().

+ Here is the call graph for this function:

◆ ConvertToIndirectObjectFor()

void CPDF_Dictionary::ConvertToIndirectObjectFor ( const ByteString & key,
CPDF_IndirectObjectHolder * pHolder )

Definition at line 286 of file cpdf_dictionary.cpp.

References CPDF_IndirectObjectHolder::AddIndirectObject(), and IsLocked().

+ Here is the call graph for this function:

◆ GetArrayFor()

RetainPtr< const CPDF_Array > CPDF_Dictionary::GetArrayFor ( const ByteString & key) const

Definition at line 187 of file cpdf_dictionary.cpp.

Referenced by FPDF_GetNamedDest(), CPDF_Parser::GetIDArray(), GetQuadPointsArrayFromDictionary(), and CPDFSDK_FormFillEnvironment::ProcOpenAction().

+ Here is the caller graph for this function:

◆ GetBooleanFor()

bool CPDF_Dictionary::GetBooleanFor ( const ByteString & key,
bool bDefault ) const

Definition at line 127 of file cpdf_dictionary.cpp.

References CPDF_Object::GetInteger(), and ToBoolean().

Referenced by FPDF_GetFormType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetByteStringFor() [1/2]

ByteString CPDF_Dictionary::GetByteStringFor ( const ByteString & key) const

Definition at line 104 of file cpdf_dictionary.cpp.

References fxcrt::ByteString::ByteString(), and CPDF_Object::GetString().

Referenced by CheckForUnsupportedAnnot(), FPDFPage_Flatten(), CPDFSDK_BAAnnot::GetAppState(), CPDF_FileSpec::GetFileName(), and CPDF_SimpleFont::LoadPDFEncoding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetByteStringFor() [2/2]

ByteString CPDF_Dictionary::GetByteStringFor ( const ByteString & key,
const ByteString & default_str ) const

Definition at line 109 of file cpdf_dictionary.cpp.

References fxcrt::ByteString::ByteString(), and CPDF_Object::GetString().

Referenced by CPDF_OCContext::CheckOCGDictVisible(), and CPDF_PageLabel::GetLabel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetByteStringPool()

WeakPtr< ByteStringPool > CPDF_Dictionary::GetByteStringPool ( ) const
inline

Definition at line 126 of file cpdf_dictionary.h.

◆ GetDictFor()

RetainPtr< const CPDF_Dictionary > CPDF_Dictionary::GetDictFor ( const ByteString & key) const

Definition at line 163 of file cpdf_dictionary.cpp.

Referenced by FORM_DoDocumentAAction(), CPDFSDK_BAAnnot::GetAAction(), CPDFSDK_BAAnnot::GetAction(), CPDF_BookmarkTree::GetFirstChild(), CPDF_FormField::GetFullNameForDict(), and CPDFSDK_BAAnnot::IsAppearanceValid().

+ Here is the caller graph for this function:

◆ GetDictInternal()

const CPDF_Dictionary * CPDF_Dictionary::GetDictInternal ( ) const
overrideprivatevirtual

Reimplemented from CPDF_Object.

Definition at line 153 of file cpdf_dictionary.cpp.

◆ GetDirectIntegerFor()

int CPDF_Dictionary::GetDirectIntegerFor ( const ByteString & key) const

Definition at line 143 of file cpdf_dictionary.cpp.

References CPDF_Number::GetInteger(), and ToNumber().

Referenced by CPDF_Parser::StartLinearizedParse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDirectObjectFor()

RetainPtr< const CPDF_Object > CPDF_Dictionary::GetDirectObjectFor ( const ByteString & key) const

Definition at line 93 of file cpdf_dictionary.cpp.

Referenced by CPDFSDK_BAAnnot::GetDestination(), and CPDF_CryptoHandler::IsSignatureDictionary().

+ Here is the caller graph for this function:

◆ GetFloatFor()

float CPDF_Dictionary::GetFloatFor ( const ByteString & key) const

Definition at line 148 of file cpdf_dictionary.cpp.

References CPDF_Object::GetNumber().

+ Here is the call graph for this function:

◆ GetIntegerFor() [1/2]

int CPDF_Dictionary::GetIntegerFor ( const ByteString & key) const

Definition at line 133 of file cpdf_dictionary.cpp.

References CPDF_Object::GetInteger().

Referenced by CPDF_LinearizedHeader::CPDF_LinearizedHeader(), CreateFaxDecoder(), CreateFlateDecoder(), FlateOrLZWDecode(), FPDFAnnot_GetFlags(), CPDFSDK_BAAnnot::GetFlags(), CPDF_Function::Load(), CPDF_SimpleFont::LoadCharWidths(), LoadCryptInfo(), CPDF_Font::LoadFontDescriptor(), CPDF_Document::MovePages(), and CPDF_FlateEncoder::UpdateLength().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetIntegerFor() [2/2]

int CPDF_Dictionary::GetIntegerFor ( const ByteString & key,
int default_int ) const

Definition at line 138 of file cpdf_dictionary.cpp.

References CPDF_Object::GetInteger().

Referenced by CreateFaxDecoder(), CreateFlateDecoder(), FlateOrLZWDecode(), CPDF_PageLabel::GetLabel(), LoadCryptInfo(), and CPDF_Font::LoadFontDescriptor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetKeys()

std::vector< ByteString > CPDF_Dictionary::GetKeys ( ) const

Definition at line 259 of file cpdf_dictionary.cpp.

References CPDF_DictionaryLocker::CPDF_DictionaryLocker().

+ Here is the call graph for this function:

◆ GetMatrixFor()

CFX_Matrix CPDF_Dictionary::GetMatrixFor ( const ByteString & key) const

Definition at line 248 of file cpdf_dictionary.cpp.

References CFX_Matrix::CFX_Matrix(), and CPDF_Array::GetMatrix().

+ Here is the call graph for this function:

◆ GetMutableArrayFor()

RetainPtr< CPDF_Array > CPDF_Dictionary::GetMutableArrayFor ( const ByteString & key)

Definition at line 192 of file cpdf_dictionary.cpp.

◆ GetMutableDictFor()

RetainPtr< CPDF_Dictionary > CPDF_Dictionary::GetMutableDictFor ( const ByteString & key)

Definition at line 168 of file cpdf_dictionary.cpp.

◆ GetMutableDirectObjectFor()

RetainPtr< CPDF_Object > CPDF_Dictionary::GetMutableDirectObjectFor ( const ByteString & key)

Definition at line 98 of file cpdf_dictionary.cpp.

◆ GetMutableObjectFor()

RetainPtr< CPDF_Object > CPDF_Dictionary::GetMutableObjectFor ( const ByteString & key)

Definition at line 81 of file cpdf_dictionary.cpp.

◆ GetMutableStreamFor()

RetainPtr< CPDF_Stream > CPDF_Dictionary::GetMutableStreamFor ( const ByteString & key)

Definition at line 215 of file cpdf_dictionary.cpp.

◆ GetNameFor()

ByteString CPDF_Dictionary::GetNameFor ( const ByteString & key) const

Definition at line 122 of file cpdf_dictionary.cpp.

References fxcrt::ByteString::ByteString(), CPDF_Name::GetString(), and ToName().

Referenced by FPDFEditEmbedderTest::CheckFontDescriptor(), FPDFAnnot_GetSubtype(), ValidateDictOptionalType(), and ValidateDictType().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNumberFor()

RetainPtr< const CPDF_Number > CPDF_Dictionary::GetNumberFor ( const ByteString & key) const

Definition at line 226 of file cpdf_dictionary.cpp.

◆ GetObjectFor()

RetainPtr< const CPDF_Object > CPDF_Dictionary::GetObjectFor ( const ByteString & key) const

Definition at line 76 of file cpdf_dictionary.cpp.

Referenced by TEST().

+ Here is the caller graph for this function:

◆ GetOrCreateArrayFor()

RetainPtr< CPDF_Array > CPDF_Dictionary::GetOrCreateArrayFor ( const ByteString & key)

Definition at line 197 of file cpdf_dictionary.cpp.

◆ GetOrCreateDictFor()

RetainPtr< CPDF_Dictionary > CPDF_Dictionary::GetOrCreateDictFor ( const ByteString & key)

Definition at line 174 of file cpdf_dictionary.cpp.

◆ GetRectFor()

CFX_FloatRect CPDF_Dictionary::GetRectFor ( const ByteString & key) const

Definition at line 241 of file cpdf_dictionary.cpp.

References CFX_FloatRect::CFX_FloatRect(), and CPDF_Array::GetRect().

Referenced by FPDFAnnot_GetRect(), FPDFLink_GetAnnotRect(), FPDFPage_Flatten(), and CPDF_GenerateAP::GenerateFormAP().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetStreamFor()

RetainPtr< const CPDF_Stream > CPDF_Dictionary::GetStreamFor ( const ByteString & key) const

Definition at line 210 of file cpdf_dictionary.cpp.

Referenced by CPDFSDK_Widget::IsWidgetAppearanceValid(), and CPDF_Font::LoadFontDescriptor().

+ Here is the caller graph for this function:

◆ GetStringFor()

RetainPtr< const CPDF_String > CPDF_Dictionary::GetStringFor ( const ByteString & key) const

Definition at line 236 of file cpdf_dictionary.cpp.

◆ GetType()

CPDF_Object::Type CPDF_Dictionary::GetType ( ) const
overridevirtual

Implements CPDF_Object.

Definition at line 41 of file cpdf_dictionary.cpp.

References CPDF_Object::kDictionary.

◆ GetUnicodeTextFor()

WideString CPDF_Dictionary::GetUnicodeTextFor ( const ByteString & key) const

Definition at line 115 of file cpdf_dictionary.cpp.

References fxcrt::WideString::WideString(), CPDF_Reference::GetDirectInternal(), CPDF_Object::GetUnicodeText(), and ToReference().

Referenced by FPDFAnnot_GetStringValue(), CPDFSDK_BAAnnot::GetAnnotName(), CPDF_FileSpec::GetFileStream(), CPDF_FormField::GetFullNameForDict(), and CPDF_PageLabel::GetLabel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsLocked()

bool CPDF_Dictionary::IsLocked ( ) const
inline

Definition at line 43 of file cpdf_dictionary.h.

Referenced by ConvertToIndirectObjectFor(), RemoveFor(), and ReplaceKey().

+ Here is the caller graph for this function:

◆ KeyExist()

bool CPDF_Dictionary::KeyExist ( const ByteString & key) const

Definition at line 255 of file cpdf_dictionary.cpp.

Referenced by FPDFAnnot_HasKey(), CPDF_PageLabel::GetLabel(), CPDF_SimpleFont::LoadCharWidths(), CPDF_Font::LoadFontDescriptor(), ReportUnsupportedFeatures(), TEST_F(), and ValidateDictOptionalType().

+ Here is the caller graph for this function:

◆ RemoveFor()

RetainPtr< CPDF_Object > CPDF_Dictionary::RemoveFor ( ByteStringView key)

Definition at line 298 of file cpdf_dictionary.cpp.

References IsLocked().

Referenced by CPDFSecurityHandlerEmbedderTest::RemoveTrailerIdFromDocument().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReplaceKey()

void CPDF_Dictionary::ReplaceKey ( const ByteString & oldkey,
const ByteString & newkey )

Definition at line 309 of file cpdf_dictionary.cpp.

References IsLocked().

+ Here is the call graph for this function:

◆ SetFor() [1/2]

void CPDF_Dictionary::SetFor ( const ByteString & key,
RetainPtr< CPDF_Object > object )

Definition at line 267 of file cpdf_dictionary.cpp.

◆ SetFor() [2/2]

void CPDF_Dictionary::SetFor ( const ByteString & key,
RetainPtr< CPDF_Stream > stream )
delete

◆ SetMatrixFor()

void CPDF_Dictionary::SetMatrixFor ( const ByteString & key,
const CFX_Matrix & matrix )

◆ SetNewFor() [1/2]

template<typename T , typename... Args>
std::enable_if<!CanInternStrings< T >::value &&!std::is_same< T, CPDF_Stream >::value, RetainPtr< T > >::type CPDF_Dictionary::SetNewFor ( const ByteString & key,
Args &&... args )
inline

Definition at line 95 of file cpdf_dictionary.h.

◆ SetNewFor() [2/2]

template<typename T , typename... Args>
std::enable_if< CanInternStrings< T >::value, RetainPtr< T > >::type CPDF_Dictionary::SetNewFor ( const ByteString & key,
Args &&... args )
inline

Definition at line 101 of file cpdf_dictionary.h.

◆ SetRectFor()

void CPDF_Dictionary::SetRectFor ( const ByteString & key,
const CFX_FloatRect & rect )

◆ size()

size_t CPDF_Dictionary::size ( ) const
inline

Definition at line 45 of file cpdf_dictionary.h.

◆ WriteTo()

bool CPDF_Dictionary::WriteTo ( IFX_ArchiveStream * archive,
const CPDF_Encryptor * encryptor ) const
overridevirtual

Implements CPDF_Object.

Definition at line 348 of file cpdf_dictionary.cpp.

References CPDF_DictionaryLocker::CPDF_DictionaryLocker(), CPDF_CryptoHandler::IsSignatureDictionary(), and IFX_WriteStream::WriteString().

Referenced by CPDF_FlateEncoder::WriteDictTo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ CPDF_DictionaryLocker

friend class CPDF_DictionaryLocker
friend

Definition at line 129 of file cpdf_dictionary.h.

Member Data Documentation

◆ CONSTRUCT_VIA_MAKE_RETAIN

CPDF_Dictionary::CONSTRUCT_VIA_MAKE_RETAIN

Definition at line 34 of file cpdf_dictionary.h.


The documentation for this class was generated from the following files: