PoDoFo  1.0.0-dev
Public Types | Public Member Functions | Friends | List of all members
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

PdfObjectMustGetObject (const PdfReference &ref) const
 Finds the object with the given reference and returns a pointer to it if it is found. More...
 
PdfObjectGetObject (const PdfReference &ref) const
 Finds the object with the given reference and returns a pointer to it if it is found. More...
 
PdfObjectCreateDictionaryObject (const PdfName &type=PdfName::Null, const PdfName &subtype=PdfName::Null)
 Creates a new object and inserts it into the vector. More...
 
PdfObjectCreateArrayObject ()
 
PdfObjectCreateObject (const PdfObject &obj)
 Creates a new object and inserts it into the vector. More...
 
PdfObjectCreateObject (PdfObject &&obj)
 
void CollectGarbage ()
 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
 
const PdfFreeObjectList & GetFreeObjects () const
 
PdfDocumentGetDocument () const
 
iterator begin () const
 Iterator pointing at the beginning of the vector. More...
 
iterator end () const
 Iterator pointing at the end of the vector. More...
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
size_t size () const
 

Friends

class PdfDocument
 
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

◆ 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

◆ 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

◆ 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 PoDoFo::PdfIndirectObjectList::GetObjectCount ( ) const
inline
Returns
the logical object count in the document.
Remarks
It corresponds to the highest object number ever used 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: