PoDoFo  1.0.0-dev
Public Member Functions | List of all members
PoDoFo::PdfReference Class Referencefinal

A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object number and 0 is the generation number. More...

#include <PdfReference.h>

Inheritance diagram for PoDoFo::PdfReference:
PoDoFo::PdfDataMember PoDoFo::PdfDataProvider< PdfReference >

Public Member Functions

 PdfReference ()
 Create a PdfReference with object number and generation number initialized to 0.
 
 PdfReference (const uint32_t objectNo, const uint16_t generationNo)
 Create a PdfReference to an object with a given object and generation number. More...
 
 PdfReference (const PdfReference &rhs)=default
 Create a copy of an existing PdfReference. More...
 
PdfReferenceoperator= (const PdfReference &rhs)=default
 Assign the value of another object to this PdfReference. More...
 
void Write (OutputStream &stream, PdfWriteFlags flags, const PdfStatefulEncrypt *encrypt, charbuff &buffer) const
 
bool operator== (const PdfReference &rhs) const
 Compare to PdfReference objects. More...
 
bool operator!= (const PdfReference &rhs) const
 Compare to PdfReference objects. More...
 
bool operator< (const PdfReference &rhs) const
 Compare to PdfReference objects. More...
 
bool IsIndirect () const
 Allows to check if a reference points to an indirect object. More...
 
void SetObjectNumber (uint32_t o)
 Set the object number of this object. More...
 
uint32_t ObjectNumber () const
 Get the object number. More...
 
void SetGenerationNumber (const uint16_t g)
 Set the generation number of this object. More...
 
uint16_t GenerationNumber () const
 Get the generation number. More...
 
- Public Member Functions inherited from PoDoFo::PdfDataProvider< PdfReference >
std::string ToString (PdfWriteFlags flags=PdfWriteFlags::None) const
 Converts the current object into a string representation which can be written directly to a PDF file on disc. More...
 
void ToString (std::string &str, PdfWriteFlags flags=PdfWriteFlags::None) const
 

Detailed Description

A reference is a pointer to a object in the PDF file of the form "4 0 R", where 4 is the object number and 0 is the generation number.

Every object in the PDF file can be identified this way.

This class is a indirect reference in a PDF file.

Constructor & Destructor Documentation

◆ PdfReference() [1/2]

PdfReference::PdfReference ( const uint32_t  objectNo,
const uint16_t  generationNo 
)

Create a PdfReference to an object with a given object and generation number.

Parameters
nObjectNothe object number
nGenerationNothe generation number

◆ PdfReference() [2/2]

PoDoFo::PdfReference::PdfReference ( const PdfReference rhs)
default

Create a copy of an existing PdfReference.

Parameters
rhsthe object to copy

Member Function Documentation

◆ GenerationNumber()

uint16_t PoDoFo::PdfReference::GenerationNumber ( ) const
inline

Get the generation number.

Returns
the generation number of this PdfReference

◆ IsIndirect()

bool PdfReference::IsIndirect ( ) const

Allows to check if a reference points to an indirect object.

A reference is indirect if object number and generation number are both not equal 0.

Returns
true if this reference is the reference of an indirect object.

◆ ObjectNumber()

uint32_t PoDoFo::PdfReference::ObjectNumber ( ) const
inline

Get the object number.

Returns
the object number of this PdfReference

◆ operator!=()

bool PdfReference::operator!= ( const PdfReference rhs) const

Compare to PdfReference objects.

Returns
false if both reference the same object

◆ operator<()

bool PdfReference::operator< ( const PdfReference rhs) const

Compare to PdfReference objects.

Returns
true if this reference has a smaller object and generation number

◆ operator=()

PdfReference& PoDoFo::PdfReference::operator= ( const PdfReference rhs)
default

Assign the value of another object to this PdfReference.

Parameters
rhsthe object to copy

◆ operator==()

bool PdfReference::operator== ( const PdfReference rhs) const

Compare to PdfReference objects.

Returns
true if both reference the same object

◆ SetGenerationNumber()

void PoDoFo::PdfReference::SetGenerationNumber ( const uint16_t  g)
inline

Set the generation number of this object.

Parameters
gthe new generation number

◆ SetObjectNumber()

void PoDoFo::PdfReference::SetObjectNumber ( uint32_t  o)
inline

Set the object number of this object.

Parameters
othe new object number

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