PoDoFo 1.2.0
Loading...
Searching...
No Matches
PoDoFo::PdfIndirectObjectList Class Referencefinal

A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will read the PdfFile into memory and create a PdfIndirectObjectList of all dictionaries found in the PDF file. More...

#include <PdfIndirectObjectList.h>

Public Types

using iterator = ObjectList::const_iterator
using reverse_iterator = ObjectList::const_reverse_iterator

Public Member Functions

PdfObject & MustGetObject (const PdfReference &ref) const
 Finds the object with the given reference and returns a pointer to it if it is found.
PdfObject * GetObject (const PdfReference &ref) const
 Finds the object with the given reference and returns a pointer to it if it is found.
PdfObject & CreateDictionaryObject (const PdfName &type=PdfName::Null, const PdfName &subtype=PdfName::Null)
 Creates a new object and inserts it into the vector.
PdfObject & CreateArrayObject ()
PdfObject & CreateNullObject ()
 Creates a new null object and inserts it into the vector.
PdfObject & CreateObject (const PdfObject &obj)
 Creates a new object and inserts it into the vector.
PdfObject & CreateObject (PdfObject &&obj)
void CollectGarbage (PdfGarbageCollectionFlags flags=PdfGarbageCollectionFlags::None)
 Deletes all objects that are not references by other objects besides the trailer (which references the root dictionary, which in turn should reference all other objects).
unsigned GetSize () const
unsigned GetObjectCount () const
uint32_t GetLastObjectNumber () const
 The highest object number ever used.
const PdfFreeObjectList & GetFreeObjects () const
const PdfObjectNumSet & GetUnavailableObjects () const
PdfDocument & GetDocument () const
iterator begin () const
 Iterator pointing at the beginning of the vector.
iterator end () const
 Iterator pointing at the end of the vector.
reverse_iterator rbegin () const
reverse_iterator rend () const
size_t size () const

Friends

class PdfDocument
class PdfMemDocument
class PdfObject
class PdfObjectOutputStream

Detailed Description

A list of PdfObjects that constitutes the indirect object list of the document The PdfParser will read the PdfFile into memory and create a PdfIndirectObjectList of all dictionaries found in the PDF file.

The PdfWriter class contrary creates a PdfIndirectObjectList internally and writes it to a PDF file later with an appropriate table of contents.

This class contains also advanced functions for searching of PdfObject's in a PdfIndirectObjectList.

Member Function Documentation

◆ begin()

PdfIndirectObjectList::iterator PdfIndirectObjectList::begin ( ) const

Iterator pointing at the beginning of the vector.

Returns
beginning iterator

◆ CollectGarbage()

void PdfIndirectObjectList::CollectGarbage ( PdfGarbageCollectionFlags flags = PdfGarbageCollectionFlags::None)

Deletes all objects that are not references by other objects besides the trailer (which references the root dictionary, which in turn should reference all other objects).

Remarks
Not supported on a PdfStreamedDocument

◆ CreateDictionaryObject()

PdfObject & PdfIndirectObjectList::CreateDictionaryObject ( const PdfName & type = PdfName::Null,
const PdfName & subtype = PdfName::Null )

Creates a new object and inserts it into the vector.

This function assigns the next free object number to the PdfObject.

Parameters
typeoptional value of the /Type key of the object
subtypeoptional value of the /SubType key of the object
Returns
PdfObject pointer to the new PdfObject

◆ CreateNullObject()

PdfObject & PdfIndirectObjectList::CreateNullObject ( )

Creates a new null object and inserts it into the vector.

This function assigns the next free object number to the PdfObject.

Remarks
Useful to allocate an object before moving content into it

◆ CreateObject()

PdfObject & PdfIndirectObjectList::CreateObject ( const PdfObject & obj)

Creates a new object and inserts it into the vector.

This function assigns the next free object number to the PdfObject.

Parameters
objvalue of the PdfObject
Returns
PdfObject pointer to the new PdfObject

◆ end()

PdfIndirectObjectList::iterator PdfIndirectObjectList::end ( ) const

Iterator pointing at the end of the vector.

Returns
ending iterator

◆ GetDocument()

PdfDocument & PoDoFo::PdfIndirectObjectList::GetDocument ( ) const
inline
Returns
a reference to the owner document

◆ GetFreeObjects()

const PdfFreeObjectList & PoDoFo::PdfIndirectObjectList::GetFreeObjects ( ) const
inline
Returns
a list of free references in this vector

◆ GetLastObjectNumber()

uint32_t PoDoFo::PdfIndirectObjectList::GetLastObjectNumber ( ) const
inline

The highest object number ever used.

Remarks
This value is used to determine the next available object number, when the free object list is empty. We assume object 0 to be always present

◆ GetObject()

PdfObject * PdfIndirectObjectList::GetObject ( const PdfReference & ref) const

Finds the object with the given reference and returns a pointer to it if it is found.

Parameters
refthe object to be found
Returns
the found object or nullptr if no object was found.

◆ GetObjectCount()

unsigned PdfIndirectObjectList::GetObjectCount ( ) const
Returns
the logical object count in the document.
Remarks
It corresponds to the highest object number ever used + 1 and it never decreases. This value is used to determine the next available object number, when the free object list is empty

◆ GetSize()

unsigned PdfIndirectObjectList::GetSize ( ) const
Returns
the size of the internal object list
Remarks
It may differ from GetObjectCount()

◆ MustGetObject()

PdfObject & PdfIndirectObjectList::MustGetObject ( const PdfReference & ref) const

Finds the object with the given reference and returns a pointer to it if it is found.

Throws a PdfError exception with error code PdfErrorCode::NoObject if no object was found

Parameters
refthe object to be found
Returns
the found object
Exceptions
PdfError(PdfErrorCode::NoObject)

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