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 PdfArray & GetArray () const
const PdfDictionary & GetDictionary () 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
PdfObjectStream & GetOrCreateStream ()
const PdfObjectStream & MustGetStream () const
PdfObjectStream & MustGetStream ()
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
PdfDocument * GetDocument () const
PdfDocument & MustGetDocument () const
const PdfReferenceGetIndirectReference () const
bool IsDelayedLoadDone () const

Additional Inherited Members

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

◆ 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