PoDoFo::PdfVecObjects Class Reference
#include <PdfVecObjects.h>
List of all members.
Detailed Description
A STL vector of PdfObjects. I.e. a list of
PdfObject classes. The
PdfParser will read the PdfFile into memory and create a
PdfVecObjects of all dictionaries found in the PDF file.
The PdfWriter class contrary creates a PdfVecObjects internally and writes it to a PDF file later with an appropriate table of contents.
These class contains also advanced funtions for searching of PdfObject's in a PdfVecObject.
Constructor & Destructor Documentation
PoDoFo::PdfVecObjects::PdfVecObjects |
( |
|
) |
|
Member Function Documentation
PdfDocument * PoDoFo::PdfVecObjects::GetParentDocument |
( |
|
) |
const [inline] |
- Returns:
- a pointer to a PdfDocument that is the parent of this vector. Might be NULL if the vector has no parent.
void PoDoFo::PdfVecObjects::SetParentDocument |
( |
PdfDocument * |
pDocument |
) |
[inline] |
Sets a parent document of this vector
- Parameters:
-
| pDocument | the parent of this vector |
void PoDoFo::PdfVecObjects::SetAutoDelete |
( |
bool |
bAutoDelete |
) |
[inline] |
Enable/disable auto deletion. By default auto deletion is disabled.
- Parameters:
-
| bAutoDelete | if true all objects will be deleted when the PdfVecObjects is deleted. |
bool PoDoFo::PdfVecObjects::AutoDelete |
( |
|
) |
const [inline] |
- Returns:
- if autodeletion is enabled and all objects will be deleted when the PdfVecObjects is deleted.
void PoDoFo::PdfVecObjects::Clear |
( |
|
) |
|
Removes all objects from the vector and resets it to the default state.
If SetAutoDelete is true all objects are deleted. All observers are removed from the vector.
- See also:
- SetAutoDelete
AutoDelete
size_t PoDoFo::PdfVecObjects::GetSize |
( |
|
) |
const [inline] |
- Returns:
- the size of the internal vector
size_t PoDoFo::PdfVecObjects::GetObjectCount |
( |
|
) |
const [inline] |
- Returns:
- the highest object number in the vector
Finds the object with the given reference in m_vecOffsets and returns a pointer to it if it is found.
- Parameters:
-
| ref | the object to be found |
- Returns:
- the found object or NULL if no object was found.
size_t PoDoFo::PdfVecObjects::GetIndex |
( |
const PdfReference & |
ref |
) |
const |
Finds the object with the given reference in m_vecOffsets and returns the index to it.
- Parameters:
-
| ref | the object to be found |
- Returns:
- the found object or NULL if no object was found.
Remove the object with the given object and generation number from the list of objects. The object is returned if it was found. Otherwise NULL is returned. The caller has to delete the object by hisself.
- Parameters:
-
| ref | the object to be found |
| bMarkAsFree | if true the removed object reference is marked as free object you will always want to have this true as invalid PDF files can be generated otherwise |
- Returns:
- The removed object.
PdfObject * PoDoFo::PdfVecObjects::RemoveObject |
( |
const TIVecObjects & |
it |
) |
|
Remove the object with the iterator it from the vector and return it
- Parameters:
-
- Returns:
- the removed object
PdfObject * PoDoFo::PdfVecObjects::CreateObject |
( |
const char * |
pszType = NULL |
) |
|
Creates a new object and inserts it into the vector. This function assigns the next free object number to the PdfObject.
- Parameters:
-
| pszType | optionall value of the /Type key of the object |
- Returns:
- PdfObject pointer to the new PdfObject
Creates a new object (of type rVariants) and inserts it into the vector. This function assigns the next free object number to the PdfObject.
- Parameters:
-
- Returns:
- PdfObject pointer to the new PdfObject
void PoDoFo::PdfVecObjects::AddFreeObject |
( |
const PdfReference & |
rReference |
) |
|
Mark a reference as unused so that it can be reused for new objects.
- Parameters:
-
| rReference | the reference to reuse |
const TPdfReferenceList & PoDoFo::PdfVecObjects::GetFreeObjects |
( |
|
) |
const [inline] |
- Returns:
- a list of free references in this vector
void PoDoFo::PdfVecObjects::RenumberObjects |
( |
PdfObject * |
pTrailer, |
|
|
TPdfReferenceSet * |
pNotDelete = NULL , |
|
|
bool |
bDoGarbageCollection = false | |
|
) |
| | |
Renumbers all objects according to there current position in the vector. All references remain intact. Warning! This function is _very_ calculation intensive.
- Parameters:
-
| pTrailer | the trailer object |
| pNotDelete | a list of object which must not be deleted |
| bDoGarbageCollection | enable garbage collection, which deletes all objects that are not reachable from the trailer. This might be slow! |
- See also:
- CollectGarbage
void PoDoFo::PdfVecObjects::push_back |
( |
PdfObject * |
pObj |
) |
|
void PoDoFo::PdfVecObjects::insert_sorted |
( |
PdfObject * |
pObj |
) |
|
Insert an object into this vector so that the vector remains sorted w.r.t. the ordering based on object and generation numbers m_bObjectCount will be increased for the object.
- Parameters:
-
| pObj | pointer to the object you want to insert |
void PoDoFo::PdfVecObjects::Sort |
( |
|
) |
|
Sort the objects in the vector based on their object and generation numbers
void PoDoFo::PdfVecObjects::Reserve |
( |
size_t |
size |
) |
[inline] |
Causes the internal vector to reserve space for size elements.
- Parameters:
-
| size | reserve space for that much elements in the internal vector |
void PoDoFo::PdfVecObjects::GetObjectDependencies |
( |
const PdfObject * |
pObj, |
|
|
TPdfReferenceList * |
pList | |
|
) |
| | const |
Get a set with all references of objects that the passed object depends on.
- Parameters:
-
| pObj | the object to calculate all dependencies for |
| pList | write the list of dependencies to this list |
void PoDoFo::PdfVecObjects::Attach |
( |
Observer * |
pObserver |
) |
[inline] |
Attach a new observer
- Parameters:
-
void PoDoFo::PdfVecObjects::Detach |
( |
Observer * |
pObserver |
) |
|
Detach an observer.
- Parameters:
-
| pObserver | observer to detach |
void PoDoFo::PdfVecObjects::SetStreamFactory |
( |
StreamFactory * |
pFactory |
) |
[inline] |
Sets a StreamFactory which is used whenever CreateStream is called.
- Parameters:
-
| pFactory | a stream factory or NULL to reset to the default factory |
Creates a stream object This method is a factory for PdfStream objects.
- Parameters:
-
- Returns:
- a new stream object
Creates a stream object by copying an existing stream
- Parameters:
-
- Returns:
- a new stream object
void PoDoFo::PdfVecObjects::WriteObject |
( |
PdfObject * |
pObject |
) |
|
Can be called to force objects to be written to disk.
- Parameters:
-
| pObject | a PdfObject that should be written to disk. |
void PoDoFo::PdfVecObjects::Finish |
( |
|
) |
|
Call whenever a document is finished
void PoDoFo::PdfVecObjects::BeginAppendStream |
( |
const PdfStream * |
pStream |
) |
|
Every stream implementation has to call this in BeginAppend
- Parameters:
-
| pStream | the stream object that is calling |
void PoDoFo::PdfVecObjects::EndAppendStream |
( |
const PdfStream * |
pStream |
) |
|
Every stream implementation has to call this in EndAppend
- Parameters:
-
| pStream | the stream object that is calling |
TIVecObjects PoDoFo::PdfVecObjects::begin |
( |
|
) |
[inline] |
Iterator pointing at the begining of the vector
- Returns:
- beginning iterator
TCIVecObjects PoDoFo::PdfVecObjects::begin |
( |
|
) |
const [inline] |
Iterator pointing at the begining of the vector
- Returns:
- beginning iterator
TIVecObjects PoDoFo::PdfVecObjects::end |
( |
|
) |
[inline] |
Iterator pointing at the end of the vector
- Returns:
- ending iterator
TCIVecObjects PoDoFo::PdfVecObjects::end |
( |
|
) |
const [inline] |
Iterator pointing at the end of the vector
- Returns:
- ending iterator
PdfObject * PoDoFo::PdfVecObjects::GetBack |
( |
|
) |
[inline] |
Get the last object in the vector
- Returns:
- the last object in the vector or NULL if the vector is emtpy.
void PoDoFo::PdfVecObjects::CollectGarbage |
( |
PdfObject * |
pTrailer |
) |
|
Deletes all objects that are not references by other objects besides the trailer (which references the root dictionary, which in turn should reference all other objects).
- Parameters:
-
| pTrailer | trailer object of the PDF |
Warning this might be slow!
std::string PoDoFo::PdfVecObjects::GetNextSubsetPrefix |
( |
|
) |
|
Get next unique subset-prefix
- Returns:
- a string to use as subset-prefix.
void PoDoFo::PdfVecObjects::SetObjectCount |
( |
const PdfReference & |
rRef |
) |
[inline] |
Set the object count so that the object described this reference is contained in the object count.
- Parameters:
-
| rRef | reference of newly added object |