PoDoFo 0.9.20
PoDoFo::PdfReference Class Referencefinal

#include <PdfReference.h>

Public Member Functions

 PdfReference ()
 
 PdfReference (const uint32_t objectNo, const uint16_t generationNo)
 
 PdfReference (const PdfReference &rhs)=default
 
std::string ToString () const
 
PdfReferenceoperator= (const PdfReference &rhs)=default
 
bool operator== (const PdfReference &rhs) const
 
bool operator!= (const PdfReference &rhs) const
 
bool operator< (const PdfReference &rhs) const
 
bool IsIndirect () const
 
void SetObjectNumber (uint32_t o)
 
uint32_t ObjectNumber () const
 
void SetGenerationNumber (const uint16_t g)
 
uint16_t GenerationNumber () 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/3]

PdfReference::PdfReference ( )

Create a PdfReference with object number and generation number initialized to 0.

◆ PdfReference() [2/3]

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() [3/3]

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

◆ ToString()

string PdfReference::ToString ( ) const

Convert the reference to a string.

Returns
a string representation of the object.
See also
PdfVariant::ToString