PoDoFo 0.9.20
Public Member Functions | List of all members
PoDoFo::PdfArray Class Referencefinal

#include <PdfArray.h>

Inheritance diagram for PoDoFo::PdfArray:
PoDoFo::PdfDataContainer PoDoFo::PdfDataProvider

Public Member Functions

 PdfArray ()
 
 PdfArray (const PdfArray &rhs)
 
PdfArrayoperator= (const PdfArray &rhs)
 
unsigned GetSize () const
 
bool IsEmpty () const
 
void Clear ()
 
void Write (OutputStream &stream, PdfWriteFlags writeMode, const PdfStatefulEncrypt &encrypt, charbuff &buffer) const override
 
const PdfObjectFindAt (unsigned idx) const
 
void Resize (unsigned count, const PdfObject &val=PdfObject())
 
size_t size () const
 
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
 
- Public Member Functions inherited from PoDoFo::PdfDataContainer
const PdfObjectGetOwner () const
 
- Public Member Functions inherited from PoDoFo::PdfDataProvider
std::string ToString () const
 

Additional Inherited Members

- Protected Member Functions inherited from PoDoFo::PdfDataContainer
 PdfDataContainer ()
 
- Protected Member Functions inherited from PoDoFo::PdfDataProvider
 PdfDataProvider ()
 

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/2]

PdfArray::PdfArray ( )

Create an empty array

◆ PdfArray() [2/2]

PdfArray::PdfArray ( const PdfArray rhs)

Deep copy an existing PdfArray

Parameters
rhsthe array to copy

Member Function Documentation

◆ back() [1/2]

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

◆ back() [2/2]

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

◆ begin() [1/2]

PdfArray::iterator PdfArray::begin ( )

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 PdfArray::begin ( ) const

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

◆ Clear()

void PdfArray::Clear ( )

Remove all elements from the array

◆ end() [1/2]

PdfArray::iterator PdfArray::end ( )

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 PdfArray::end ( ) const

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 * PdfArray::FindAt ( unsigned  idx) const

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. nullptr if the index was out of the boundaries

◆ front() [1/2]

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

◆ front() [2/2]

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

◆ GetSize()

unsigned PdfArray::GetSize ( ) const
Returns
the size of the array

◆ IsEmpty()

bool PdfArray::IsEmpty ( ) const
Returns
true if is empty

◆ operator=()

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

assignment operator

Parameters
rhsthe array to assign

◆ rbegin() [1/2]

PdfArray::reverse_iterator PdfArray::rbegin ( )

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 PdfArray::rbegin ( ) const

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 PdfArray::rend ( )

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 PdfArray::rend ( ) const

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 PdfArray::Resize ( unsigned  count,
const PdfObject val = PdfObject() 
)

Resize the internal vector.

Parameters
countnew size
valuerefernce value

◆ size()

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

◆ Write()

void PdfArray::Write ( OutputStream stream,
PdfWriteFlags  writeMode,
const PdfStatefulEncrypt &  encrypt,
charbuff buffer 
) const
overridevirtual

Write the complete datatype to a file.

Parameters
devicewrite the object to this device
writeModeadditional options for writing this object
encryptan encryption object which is used to encrypt this object or nullptr to not encrypt this object

Implements PoDoFo::PdfDataProvider.