PoDoFo 0.9.6
PoDoFo::PdfArray Class Reference

#include <PdfArray.h>

Inheritance diagram for PoDoFo::PdfArray:
PoDoFo::PdfOwnedDataType 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
const PdfObject * FindAt (size_type idx) const
void push_back (const PdfObject &var)
void clear ()
size_t size () const
bool empty () const
void resize (size_t count, value_type val=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::PdfOwnedDataType
const PdfObject * GetOwner () const
Public Member Functions inherited from PoDoFo::PdfDataType
void SetImmutable (bool bImmutable)
bool GetImmutable () const

Additional Inherited Members

Protected Member Functions inherited from PoDoFo::PdfOwnedDataType
 PdfOwnedDataType ()
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

◆ PdfArray() [1/3]

PoDoFo::PdfArray::PdfArray ( )

Create an empty array

◆ PdfArray() [2/3]

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.

◆ PdfArray() [3/3]

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

Deep copy an existing PdfArray

Parameters
rhsthe array to copy

Member Function Documentation

◆ back() [1/2]

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

◆ back() [2/2]

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

◆ begin() [1/2]

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.

◆ begin() [2/2]

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.

◆ Clear()

void PoDoFo::PdfArray::Clear ( )
inline

Remove all elements from the array

◆ clear()

void PoDoFo::PdfArray::clear ( )

Remove all elements from the array

◆ ContainsString()

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

◆ empty()

bool PoDoFo::PdfArray::empty ( ) const
inline
Returns
true if the array is empty.

◆ end() [1/2]

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.

◆ end() [2/2]

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.

◆ FindAt()

const PdfObject * PoDoFo::PdfArray::FindAt ( size_type idx) const
inline

Get the object at the given index out of the array.

Lookup in the indirect objects as well, if the shallow object was a reference. The returned value is a pointer to the internal object in the dictionary so it MUST not be deleted.

Parameters
idx
Returns
pointer to the found value. NULL if the index was out of the boundaries

◆ front() [1/2]

PdfObject & PoDoFo::PdfArray::front ( )
inline
Returns
a read/write reference to the data at the first element of the array.

◆ front() [2/2]

const PdfObject & PoDoFo::PdfArray::front ( ) const
inline
Returns
a read-only (constant) reference to the data at the first element of the array.

◆ GetSize()

size_t PoDoFo::PdfArray::GetSize ( ) const
inline
Returns
the size of the array

◆ GetStringIndex()

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

◆ IsDirty()

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.

◆ operator=()

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

assignment operator

Parameters
rhsthe array to assign

◆ push_back()

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

◆ rbegin() [1/2]

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.

◆ rbegin() [2/2]

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.

◆ rend() [1/2]

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.

◆ rend() [2/2]

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.

◆ resize()

void PoDoFo::PdfArray::resize ( size_t count,
value_type val = value_type() )

Resize the internal vector.

Parameters
countnew size
valuerefernce value

◆ SetDirty()

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()

size_t PoDoFo::PdfArray::size ( ) const
inline
Returns
the size of the array

◆ Write()

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.