PoDoFo  0.9.4
Public Member Functions | List of all members
PoDoFo::PdfArray Class Reference

#include <PdfArray.h>

Inheritance diagram for PoDoFo::PdfArray:
PoDoFo::PdfDataType

Public Member Functions

 PdfArray ()
 
 PdfArray (const PdfObject &var)
 
 PdfArray (const PdfArray &rhs)
 
PdfArrayoperator= (const PdfArray &rhs)
 
size_t GetSize () const
 
void Clear ()
 
virtual void Write (PdfOutputDevice *pDevice, EPdfWriteMode eWriteMode, const PdfEncrypt *pEncrypt=NULL) const
 
bool ContainsString (const std::string &cmpString) const
 
size_t GetStringIndex (const std::string &cmpString) const
 
void push_back (const PdfObject &var)
 
size_t size () const
 
bool empty () const
 
void resize (size_t __n, value_type __x=PdfArrayBaseClass::value_type())
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
virtual bool IsDirty () const
 
virtual void SetDirty (bool bDirty)
 
- Public Member Functions inherited from PoDoFo::PdfDataType
void SetImmutable (bool bImmutable)
 
bool GetImmutable () const
 

Additional Inherited Members

- Protected Member Functions inherited from PoDoFo::PdfDataType
 PdfDataType ()
 
void AssertMutable () const
 

Detailed Description

This class represents a PdfArray Use it for all arrays that are written to a PDF file.

A PdfArray can hold any PdfVariant.

See also
PdfVariant

Constructor & Destructor Documentation

PoDoFo::PdfArray::PdfArray ( )

Create an empty array

PoDoFo::PdfArray::PdfArray ( const PdfObject var)
explicit

Create an array and add one value to it. The value is copied.

Parameters
varadd this object to the array.
PoDoFo::PdfArray::PdfArray ( const PdfArray rhs)

Deep copy an existing PdfArray

Parameters
rhsthe array to copy

Member Function Documentation

PdfObject & PoDoFo::PdfArray::back ( )
inline
Returns
a read/write reference to the data at the last element of the array.
const PdfObject & PoDoFo::PdfArray::back ( ) const
inline
Returns
a read-only (constant) reference to the data at the last element of the array.
PdfArray::iterator PoDoFo::PdfArray::begin ( )
inline

Returns a read/write iterator that points to the first element in the array. Iteration is done in ordinary element order.

PdfArray::const_iterator PoDoFo::PdfArray::begin ( ) const
inline

Returns a read-only (constant) iterator that points to the first element in the array. Iteration is done in ordinary element order.

void PoDoFo::PdfArray::Clear ( )
inline

Remove all elements from the array

bool PoDoFo::PdfArray::ContainsString ( const std::string &  cmpString) const

Utility method to determine if the array contains contains any objects of ePdfDataType_String whose value is the passed string.

Parameters
cmpStringthe string to compare against
Returns
true if success, false if not
bool PoDoFo::PdfArray::empty ( ) const
inline
Returns
true if the array is empty.
PdfArray::iterator PoDoFo::PdfArray::end ( )
inline

Returns a read/write iterator that points one past the last element in the array. Iteration is done in ordinary element order.

PdfArray::const_iterator PoDoFo::PdfArray::end ( ) const
inline

Returns a read-only (constant) iterator that points one past the last element in the array. Iteration is done in ordinary element order.

PdfObject & PoDoFo::PdfArray::front ( )
inline
Returns
a read/write reference to the data at the first element of the array.
const PdfObject & PoDoFo::PdfArray::front ( ) const
inline
Returns
a read-only (constant) reference to the data at the first element of the array.
size_t PoDoFo::PdfArray::GetSize ( ) const
inline
Returns
the size of the array
size_t PoDoFo::PdfArray::GetStringIndex ( const std::string &  cmpString) const

Utility method to return the actual index in the array which contains an object of ePdfDataType_String whose value is the passed string.

Parameters
cmpStringthe string to compare against
Returns
true if success, false if not
bool PoDoFo::PdfArray::IsDirty ( ) const
virtual

The dirty flag is set if this variant has been modified after construction.

Usually the dirty flag is also set if you call any non-const member function as we cannot determine if you actually changed something or not.

Returns
true if the value is dirty and has been modified since construction

Reimplemented from PoDoFo::PdfDataType.

PdfArray & PoDoFo::PdfArray::operator= ( const PdfArray rhs)

assignment operator

Parameters
rhsthe array to assign
void PoDoFo::PdfArray::push_back ( const PdfObject var)
inline

Adds a PdfObject to the array

Parameters
varadd a PdfObject to the array

This will set the dirty flag of this object.

See also
IsDirty
PdfArray::reverse_iterator PoDoFo::PdfArray::rbegin ( )
inline

Returns a read/write reverse iterator that points to the last element in the array. Iteration is done in reverse element order.

PdfArray::const_reverse_iterator PoDoFo::PdfArray::rbegin ( ) const
inline

Returns a read-only (constant) reverse iterator that points to the last element in the array. Iteration is done in reverse element order.

PdfArray::reverse_iterator PoDoFo::PdfArray::rend ( )
inline

Returns a read/write reverse iterator that points to one before the first element in the array. Iteration is done in reverse element order.

PdfArray::const_reverse_iterator PoDoFo::PdfArray::rend ( ) const
inline

Returns a read-only (constant) reverse iterator that points to one before the first element in the array. Iteration is done in reverse element order.

void PoDoFo::PdfArray::resize ( size_t  __n,
value_type  __x = PdfArrayBaseClass::value_type() 
)
inline

Resize the internal vector.

Parameters
__nnew size
void PoDoFo::PdfArray::SetDirty ( bool  bDirty)
virtual

Sets the dirty flag of this PdfVariant

Parameters
bDirtytrue if this PdfVariant has been modified from the outside
See also
IsDirty

Reimplemented from PoDoFo::PdfDataType.

size_t PoDoFo::PdfArray::size ( ) const
inline
Returns
the size of the array
void PoDoFo::PdfArray::Write ( PdfOutputDevice pDevice,
EPdfWriteMode  eWriteMode,
const PdfEncrypt pEncrypt = NULL 
) const
virtual

Write the array to an output device. This is an overloaded member function.

Parameters
pDevicewrite the object to this device
eWriteModeadditional options for writing this object
pEncryptan encryption object which is used to encrypt this object or NULL to not encrypt this object

Implements PoDoFo::PdfDataType.