Mako 7.4.0 API
Loading...
Searching...
No Matches
JawsMako::IPDFArray Class Referenceabstract

A simple class representing a mutable array of other PDF objects. More...

#include <pdfobjects.h>

Inheritance diagram for JawsMako::IPDFArray:

Public Member Functions

virtual uint32 getSize () const =0
 Get the current size of the array.
 
virtual IPDFObjectPtr get (uint32 index) const =0
 Get the object stored at the given index. An exception will be thrown if the index is out of range.
 
virtual ePDFObjectType getTypeAtIndex (uint32 index) const =0
 Get the type of the object stored at the given index. An exception will be thrown if the index is out of range.
 
virtual void put (uint32 index, const IPDFObjectPtr &value)=0
 Store the given object in the array at the given index, replacing the currently stored object. If the index is outside the array, it will be resized to suit. An exception will be thrown if the index is out of range.
 
virtual void insert (uint32 index, const IPDFObjectPtr &value)=0
 Insert the given object in the array at the given index, moving the following objects forward to make room. An exception will be thrown if the index is out of range.
 
virtual void remove (uint32 index)=0
 Remove the object at the given index from the array, decreasing the size of the array by 1. An exception will be thrown if the index is out of range.
 
virtual void append (const IPDFObjectPtr &value)=0
 Convenience member to append an object to the end of the array.
 
virtual void copy (uint32 destIndex, const IPDFArrayPtr &sourceArray, uint32 sourceIndex)=0
 Copy (but not clone) an entry from another array into an existing posision in this array, replacing any currently stored object. Usually more efficient for bulk operations.
 
virtual bool getNumbers (CDoubleVect &numbers)=0
 If the array consists entirely of numbers, retrieve those numbers.
 
virtual bool getBox (FBox &box)=0
 If the array consists of four numbers, retrieve those numbers as a box (left, bottom, right, top)
 
virtual int32 getInteger (uint32 index) const =0
 Convenience member to obtain an integer from the array at the given index. An exception will be thrown if the index is out of range or the object is not an integer.
 
virtual bool containsCompositeObject (const IPDFObjectPtr &object) const =0
 Recursively check to see if the array contains the given composite object (That is, a dictionary, stream, or array).
 
- Public Member Functions inherited from JawsMako::IPDFObject
virtual ePDFObjectType getType () const =0
 Get the type of this PDF object.
 
virtual IPDFObjectPtr clone () const =0
 Create a clone of this PDF object if appropriate. Note that simple immutable objects are not actually cloned and instead the same object is returned.
 
virtual IPDFObjectPtr deepClone () const =0
 Create a deep clone of this PDF object if appropriate. Note that simple immutable objects are not actually cloned and instead the same object is returned. If the object is composite (an IPDFArray, IPDFDictionary or IPDFStream) then the object will be cloned as well as the consituent objects in a recursive fashion.
 
virtual bool getIsExecutable () const =0
 Get whether or not the object is considered executable, such as an executable name, array, or operator.
 
virtual bool containsReferences () const =0
 Get whether or not the object contains indirect references to other objects (that is, does the object or any constituent object contain IPDFReference or IPDFFarReference objects).
 
virtual void emitPostScriptCode (const IOutputStreamPtr &dest) const =0
 Convert the object to PostScript code and write to the given stream. Only allowed for objects that are representable in PostScript.
 
virtual bool getNumber (double &number) const =0
 If the object is a number (a real or integer) obtain that number.
 
virtual bool getNumber (float &number) const =0
 If the object is a number (a real or integer) within the range of a 32-bit float, obtain that number. If the object is an integer, thiw will fail if the integer cannot be represented exactly in a single precision float.
 
virtual bool getNumber (int32 &number) const =0
 If the object is an integer (a integral real or integer) within the range of a 32-bit integer, obtain that number.
 
virtual bool getString (RawString &string) const =0
 If the object is a string or a name, retrieve the raw string data.
 
- Public Member Functions inherited from IRCObject
virtual void addRef () const =0
 Increases the reference count of the actual object pointed to. This would take place during an assignment or copying.
 
virtual bool decRef () const =0
 Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to.
 
virtual int32 getRefCount () const =0
 Retrieve the current reference count of the actual object pointed to.
 
- Public Member Functions inherited from JawsMako::IHashable
virtual uint64 hash () const
 Obtain a 64-bit hash of the receiving object.
 
virtual void updateHash (uint64 &hash) const =0
 Update the given hash to include the receiver.
 

Static Public Member Functions

static JAWSMAKO_API IPDFArrayPtr create (uint32 size=0, bool executable=false)
 Create a new PDF array of the given initial size.
 
static JAWSMAKO_API IPDFArrayPtr create (const CPDFObjectVect &objects, bool executable=false)
 Create a new PDF array from a vector of IPDFObjects.
 
static JAWSMAKO_API IPDFArrayPtr createFromNumbers (const CDoubleVect &numbers)
 Create from a vector of numbers.
 
static JAWSMAKO_API IPDFArrayPtr createFromNumbersArray (const double *numbers, uint32 numNumbers)
 Create from an array of numbers.
 
static JAWSMAKO_API IPDFArrayPtr createFromFBox (const FBox &box)
 Create from an FBox.
 
- Static Public Member Functions inherited from JawsMako::IPDFObject
static JAWSMAKO_API IPDFObjectPtr createNumber (double number)
 If the given number is an integer, create an IPDFInteger, otherwise create an IPDFReal.
 

Additional Inherited Members

- Protected Member Functions inherited from IRCObject
virtual ~IRCObject ()
 Virtual destructor.
 

Detailed Description

A simple class representing a mutable array of other PDF objects.

Member Function Documentation

◆ append()

virtual void JawsMako::IPDFArray::append ( const IPDFObjectPtr & value)
pure virtual

Convenience member to append an object to the end of the array.

Parameters
valueThe object to append.

◆ containsCompositeObject()

virtual bool JawsMako::IPDFArray::containsCompositeObject ( const IPDFObjectPtr & object) const
pure virtual

Recursively check to see if the array contains the given composite object (That is, a dictionary, stream, or array).

Parameters
objectThe object to search for.
Returns
bool True if the given object was found.

◆ copy()

virtual void JawsMako::IPDFArray::copy ( uint32 destIndex,
const IPDFArrayPtr & sourceArray,
uint32 sourceIndex )
pure virtual

Copy (but not clone) an entry from another array into an existing posision in this array, replacing any currently stored object. Usually more efficient for bulk operations.

Parameters
destIndexThe destination index to store the object.
sourceArrayThe array object from which to copy.
sourceIndexThe index of the entry in sourceArray to copy.

◆ create() [1/2]

static JAWSMAKO_API IPDFArrayPtr JawsMako::IPDFArray::create ( const CPDFObjectVect & objects,
bool executable = false )
static

Create a new PDF array from a vector of IPDFObjects.

Parameters
objectsThe objects to assign to the array.
executableIf this array should be marked executable (that is, a PDF/PS procedure).
Returns
IPDFArrayPtr The created object.

◆ create() [2/2]

static JAWSMAKO_API IPDFArrayPtr JawsMako::IPDFArray::create ( uint32 size = 0,
bool executable = false )
static

Create a new PDF array of the given initial size.

Parameters
sizeThe initial size of the array. It will be populated with IPDFNull objects.
executableIf this array should be marked executable (that is, a PDF/PS procedure).
Returns
IPDFArrayPtr The created object.

◆ createFromFBox()

static JAWSMAKO_API IPDFArrayPtr JawsMako::IPDFArray::createFromFBox ( const FBox & box)
static

Create from an FBox.

Parameters
boxThe box to use.
Returns
IPDFArray The created object.

◆ createFromNumbers()

static JAWSMAKO_API IPDFArrayPtr JawsMako::IPDFArray::createFromNumbers ( const CDoubleVect & numbers)
static

Create from a vector of numbers.

Parameters
numbersThe numbers to assign to the array.
Returns
IPDFArray The created object.

◆ createFromNumbersArray()

static JAWSMAKO_API IPDFArrayPtr JawsMako::IPDFArray::createFromNumbersArray ( const double * numbers,
uint32 numNumbers )
static

Create from an array of numbers.

Parameters
numbersThe numbers to assign to the array.
numNumbersThe number of numbers in the array. Integers will be created where possible.
Returns
IPDFArray The created object.

◆ get()

virtual IPDFObjectPtr JawsMako::IPDFArray::get ( uint32 index) const
pure virtual

Get the object stored at the given index. An exception will be thrown if the index is out of range.

Parameters
indexThe index of the desired object.
Returns
IPDFObjectPtr The retrieved object.

◆ getBox()

virtual bool JawsMako::IPDFArray::getBox ( FBox & box)
pure virtual

If the array consists of four numbers, retrieve those numbers as a box (left, bottom, right, top)

Parameters
boxThe FBox to receive the numbers.
Returns
bool True if the array was four numbers, fails otherwise.

◆ getInteger()

virtual int32 JawsMako::IPDFArray::getInteger ( uint32 index) const
pure virtual

Convenience member to obtain an integer from the array at the given index. An exception will be thrown if the index is out of range or the object is not an integer.

Parameters
indexThe index of the object to query.
Returns
int32 The integer value of the object.

◆ getNumbers()

virtual bool JawsMako::IPDFArray::getNumbers ( CDoubleVect & numbers)
pure virtual

If the array consists entirely of numbers, retrieve those numbers.

Parameters
numbersA reference to a vector to receive the numbers.
Returns
bool True if the array was entirely numbers, fails otherwise (in which case numbers will be empty).

◆ getSize()

virtual uint32 JawsMako::IPDFArray::getSize ( ) const
pure virtual

Get the current size of the array.

Returns
uint32 The size.

◆ getTypeAtIndex()

virtual ePDFObjectType JawsMako::IPDFArray::getTypeAtIndex ( uint32 index) const
pure virtual

Get the type of the object stored at the given index. An exception will be thrown if the index is out of range.

Parameters
indexThe index of the desired object.
Returns
ePDFObjectType The type of the stored object.

◆ insert()

virtual void JawsMako::IPDFArray::insert ( uint32 index,
const IPDFObjectPtr & value )
pure virtual

Insert the given object in the array at the given index, moving the following objects forward to make room. An exception will be thrown if the index is out of range.

Parameters
indexThe index at which to store the object.
valueThe object to insert.

◆ put()

virtual void JawsMako::IPDFArray::put ( uint32 index,
const IPDFObjectPtr & value )
pure virtual

Store the given object in the array at the given index, replacing the currently stored object. If the index is outside the array, it will be resized to suit. An exception will be thrown if the index is out of range.

Parameters
indexThe index at which to store the object.
valueThe object to store.

◆ remove()

virtual void JawsMako::IPDFArray::remove ( uint32 index)
pure virtual

Remove the object at the given index from the array, decreasing the size of the array by 1. An exception will be thrown if the index is out of range.

Parameters
indexThe index of the object to remove.

The documentation for this class was generated from the following file: