PoDoFo 0.9.20
PoDoFo::PdfParserObject Class Reference

#include <PdfParserObject.h>

Inheritance diagram for PoDoFo::PdfParserObject:
PoDoFo::PdfObject PoDoFo::PdfXRefStreamParserObject

Public Member Functions

 PdfParserObject (InputStreamDevice &device, ssize_t offset=-1)
void FreeObjectMemory (bool force=false)
bool HasStreamToParse () const
ssize_t GetOffset () const
Public Member Functions inherited from PoDoFo::PdfObject
 PdfObject ()
 PdfObject (const PdfVariant &var)
 PdfObject (bool b)
 PdfObject (int64_t l)
 PdfObject (double d)
 PdfObject (const PdfString &str)
 PdfObject (const PdfName &name)
 PdfObject (const PdfReference &ref)
 PdfObject (const PdfArray &arr)
 PdfObject (const PdfDictionary &dict)
 PdfObject (const PdfObject &rhs)
PdfDataType GetDataType () const
const char * GetDataTypeString () const
bool IsBool () const
bool IsNumber () const
bool IsRealStrict () const
bool IsNumberOrReal () const
bool IsString () const
bool IsName () const
bool IsArray () const
bool IsDictionary () const
bool IsRawData () const
bool IsNull () const
bool IsReference () const
std::string ToString () const
bool GetBool () const
int64_t GetNumberLenient () const
int64_t GetNumber () const
double GetReal () const
double GetRealStrict () const
const PdfStringGetString () const
const PdfNameGetName () const
PdfReference GetReference () const
const PdfArrayGetArray () const
const PdfDictionaryGetDictionary () const
void SetBool (bool b)
void SetNumber (int64_t l)
void SetReal (double d)
void SetName (const PdfName &name)
void SetString (const PdfString &str)
void Write (OutputStream &stream, PdfWriteFlags writeMode, const PdfEncrypt *encrypt, charbuff &buffer) const
PdfObjectStreamGetOrCreateStream ()
const PdfObjectStreamMustGetStream () const
PdfObjectStreamMustGetStream ()
bool HasStream () const
bool operator< (const PdfObject &rhs) const
bool operator== (const PdfObject &rhs) const
bool operator!= (const PdfObject &rhs) const
bool operator== (const PdfVariant &rhs) const
bool operator!= (const PdfVariant &rhs) const
PdfObjectoperator= (const PdfObject &rhs)
bool IsDirty () const
PdfDocumentGetDocument () const
PdfDocumentMustGetDocument () const
const PdfReferenceGetIndirectReference () const
bool IsDelayedLoadDone () const

Protected Member Functions

void DelayedLoadImpl () override
Protected Member Functions inherited from PoDoFo::PdfObject
void DelayedLoad () const
void SetDirty ()
void SetDocument (PdfDocument *document)
void EnableDelayedLoading ()

Detailed Description

A PdfParserObject constructs a PdfObject from a PDF file. Parsing starts always at the current file position.

Constructor & Destructor Documentation

◆ PdfParserObject()

PdfParserObject::PdfParserObject ( InputStreamDevice & device,
ssize_t offset = -1 )
Warning
This constructor is for testing usage only

Member Function Documentation

◆ DelayedLoadImpl()

void PdfParserObject::DelayedLoadImpl ( )
overrideprotectedvirtual

Load all data of the object if delayed loading is enabled.

Never call this method directly; use DelayedLoad() instead.

You should override this to control deferred loading in your subclass. Note that this method should not load any associated streams, just the base object.

The default implementation throws. It should never be called, since objects that do not support delayed loading should not enable it.

While this method is not ‘const’ it may be called from a const context, so be careful what you mess with.

Reimplemented from PoDoFo::PdfObject.

Reimplemented in PoDoFo::PdfXRefStreamParserObject.

◆ FreeObjectMemory()

void PdfParserObject::FreeObjectMemory ( bool force = false)

Tries to free all memory allocated by this PdfObject (variables and streams) and reads it from disk again if it is requested another time.

This will only work if load on demand is used. If the object is dirty if will not be free'd.

Parameters
forceif true the object will be free'd even if IsDirty() returns true. So you will loose any changes made to this object.
See also
IsLoadOnDemand
IsDirty

◆ GetOffset()

ssize_t PoDoFo::PdfParserObject::GetOffset ( ) const
inline

Gets an offset in which the object beginning is stored in the file. Note the offset points just after the object identificator ("0 0 obj").

Returns
an offset in which the object is stored in the source device, or -1, if the object was created on demand.

◆ HasStreamToParse()

bool PoDoFo::PdfParserObject::HasStreamToParse ( ) const
inline

Returns if this object has a stream object appended. which has to be parsed.

Returns
true if there is a stream