PoDoFo::PdfParserObject Class Reference

#include <PdfParserObject.h>

Inheritance diagram for PoDoFo::PdfParserObject:

PoDoFo::PdfObject PoDoFo::PdfTokenizer PoDoFo::PdfVariant PoDoFo::PdfXRefStreamParserObject

List of all members.

Public Member Functions

 PdfParserObject (PdfVecObjects *pCreator, const PdfRefCountedInputDevice &rDevice, const PdfRefCountedBuffer &rBuffer, pdf_long lOffset=-1)
 PdfParserObject (const PdfRefCountedBuffer &rBuffer)
void ParseFile (PdfEncrypt *pEncrypt, bool bIsTrailer=false)
bool HasStreamToParse () const
bool IsLoadOnDemand () const
void SetLoadOnDemand (bool bDelayed)
void SetObjectNumber (unsigned int nObjNo)
void FreeObjectMemory (bool bForce=false)

Protected Member Functions

virtual void DelayedLoadImpl ()
virtual void DelayedStreamLoadImpl ()
void ParseStream ()


Detailed Description

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

Constructor & Destructor Documentation

PoDoFo::PdfParserObject::PdfParserObject ( PdfVecObjects pCreator,
const PdfRefCountedInputDevice rDevice,
const PdfRefCountedBuffer rBuffer,
pdf_long  lOffset = -1 
)

Parse the object data from the given file handle starting at the current position.

Parameters:
pCreator pointer to a PdfVecObjects to resolve object references
rDevice an open reference counted input device which is positioned in front of the object which is going to be parsed.
rBuffer buffer to use for parsing to avoid reallocations
lOffset the position in the device from which the object shall be read if lOffset = -1, the object will be read from the current position in the file.

PoDoFo::PdfParserObject::PdfParserObject ( const PdfRefCountedBuffer rBuffer  )  [explicit]

Parse the object data for an internal object. You have to call ParseDictionaryKeys as next function call.

The following two parameters are used to avoid allocation of a new buffer in PdfSimpleParser.

Warning:
This constructor is for internal usage only!
Parameters:
rBuffer buffer to use for parsing to avoid reallocations


Member Function Documentation

void PoDoFo::PdfParserObject::ParseFile ( PdfEncrypt pEncrypt,
bool  bIsTrailer = false 
)

Parse the object data from the given file handle If delayed loading is enabled, only the object and generation number is read now and everything else is read later.

Parameters:
pEncrypt an encryption dictionary which is used to decrypt strings and streams during parsing or NULL if the PDF file was not encrypted
bIsTrailer wether this is a trailer dictionary or not. trailer dictionaries do not have a object number etc.

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

bool PoDoFo::PdfParserObject::IsLoadOnDemand (  )  const [inline]

Returns:
true if this PdfParser loads all objects at the time they are accessed for the first time. The default is to load all object immediately. In this case false is returned.

void PoDoFo::PdfParserObject::SetLoadOnDemand ( bool  bDelayed  )  [inline]

Sets wether this object shall be loaded on demand when it's data is accessed for the first time.

Parameters:
bDelayed if true the object is loaded delayed.

void PoDoFo::PdfParserObject::SetObjectNumber ( unsigned int  nObjNo  )  [inline]

Set the object number of this object. It is almost never necessary to use this call. It is only included for usage in the PdfParser.

Parameters:
nObjNo the new object number of this object

void PoDoFo::PdfParserObject::FreeObjectMemory ( bool  bForce = 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:
bForce if 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

void PoDoFo::PdfParserObject::DelayedLoadImpl (  )  [protected, virtual]

Load all data of the object if load object on demand is enabled. Reimplemented from PdfVariant. Do not call this directly, use DelayedLoad().

Reimplemented from PoDoFo::PdfVariant.

void PoDoFo::PdfParserObject::DelayedStreamLoadImpl (  )  [protected, virtual]

Load the stream of the object if it has one and if loading on demand is enabled. Reimplemented from PdfObject. Do not call this directly, use DelayedStreamLoad().

Reimplemented from PoDoFo::PdfObject.

void PoDoFo::PdfParserObject::ParseStream (  )  [protected]

Starts reading at the file position m_lStreamOffset and interprets all bytes as contents of the objects stream. It is assumed that the dictionary has a valid /Length key already.

Called from DelayedStreamLoadImpl(). Do not call directly.


Generated on Tue Nov 29 09:28:34 2016 for PoDoFo by  doxygen 1.5.6