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

#include <PdfArray.h>

Inheritance diagram for mm::PdfArray:
mm::PdfDataContainer mm::PdfDataProvider

Public Member Functions

 PdfArray ()
 
 PdfArray (const PdfObject &var)
 
 PdfArray (const PdfArray &rhs)
 
PdfArrayoperator= (const PdfArray &rhs)
 
unsigned GetSize () const
 
void Clear ()
 
void Write (PdfOutputDevice &device, PdfWriteMode eriteMode, const PdfEncrypt *encrypt) const override
 
const PdfObjectFindAt (unsigned idx) const
 
void push_back (const PdfObject &obj)
 
void clear ()
 
size_t size () const
 
bool empty () const
 
void resize (size_t count, const PdfObject &val=PdfObject())
 
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 mm::PdfDataContainer
const PdfObjectGetOwner () const
 
bool IsImmutable () const
 
void SetImmutable (bool immutable)
 
virtual void Write (PdfOutputDevice &device, PdfWriteMode writeMode, const PdfEncrypt *encrypt) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from mm::PdfDataContainer
 PdfDataContainer ()
 
- Protected Member Functions inherited from mm::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/3]

PdfArray::PdfArray ( )

Create an empty array

◆ PdfArray() [2/3]

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]

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

◆ clear()

void PdfArray::clear ( )

Remove all elements from the array

◆ empty()

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

◆ 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

◆ operator=()

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

assignment operator

Parameters
rhsthe array to assign

◆ push_back()

void PdfArray::push_back ( const PdfObject obj)

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 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 ( size_t  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 ( PdfOutputDevice device,
PdfWriteMode  writeMode,
const PdfEncrypt encrypt 
) 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 mm::PdfDataProvider.