Mako 7.5.0 API
Loading...
Searching...
No Matches
JawsMako::IPDFDictionary Class Referenceabstract

A simple class representing a mutable dictionary of key-value pairs where the keys are PDF names and the values are PDF objects. More...

#include <pdfobjects.h>

Inheritance diagram for JawsMako::IPDFDictionary:

Public Member Functions

virtual uint32 getSize () const =0
 Get the current size of the dictionary, including currently empty entries.
 
virtual IPDFNamePtr getKeyAtIndex (uint32 index) const =0
 Get the key of the dictionary entry at the given index.
 
virtual IPDFObjectPtr getValueAtIndex (uint32 index) const =0
 Get the value stored in the dictionary entry at the given index.
 
virtual ePDFObjectType getValueTypeAtIndex (uint32 index) const =0
 Get the type of the value stored in the dictionary entry at the given index. An exception is thrown if the dictionary entry is empty.
 
virtual IPDFObjectPtr get (const char *key) const =0
 Get the object stored in the dictionary with the given null-terminated string as key.
 
virtual IPDFObjectPtr get (const RawString &key) const =0
 Get the object stored in the dictionary with the given raw string as key.
 
virtual IPDFObjectPtr get (const IPDFNamePtr &key) const =0
 Get the object stored in the dictionary with the given DF name as key.
 
virtual void put (const char *key, const IPDFObjectPtr &value)=0
 Store an object in the dictionary under the given key.
 
virtual void put (const RawString &key, const IPDFObjectPtr &value)=0
 Store an object in the dictionary under the given key.
 
virtual void put (const IPDFNamePtr &key, const IPDFObjectPtr &value)=0
 Store an object in the dictionary under the given key.
 
virtual void undefine (const char *key)=0
 Remove the object stored under the given key, if it exists.
 
virtual void undefine (const RawString &key)=0
 Remove the object stored under the given key, if it exists.
 
virtual void undefine (const IPDFNamePtr &key)=0
 Remove the object stored under the given key, if it exists.
 
virtual void copy (const IPDFDictionaryPtr &sourceDict, uint32 sourceIndex)=0
 Copy (but not clone) an entry from another dictionary into this dictionary, replacing any currently stored object. Usually more efficient for bulk operations.
 
virtual void putInteger (const IPDFNamePtr &key, int32 integer)=0
 Convenience member to add an Integer to a dictionary.
 
virtual void putReal (const IPDFNamePtr &key, double real)=0
 Convenience member to add a real to a dictionary.
 
virtual bool containsCompositeObject (const IPDFObjectPtr &object) const =0
 Recursively check to see if the dictionary contains the given composite object (That is, a dictionary, stream, or array).
 
virtual Iterator begin ()=0
 Create an iterator to iterate through all the key-value pairs in the dictionary, beginning at the first entry.
 
virtual Iterator end ()=0
 Obtain an interator representing the end of the dictionary.
 
- 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 IPDFDictionaryPtr create (IEDLClassFactory *pFactory, uint32 size=0)
 Create a new PDF dictionary of the given initial capacity.
 
- 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 dictionary of key-value pairs where the keys are PDF names and the values are PDF objects.

A simple class representing a mutable PDF stream. A stream consists of a dictionary paired with an IRAInputStream containing accompanying data.

Member Function Documentation

◆ begin()

virtual Iterator JawsMako::IPDFDictionary::begin ( )
pure virtual

Create an iterator to iterate through all the key-value pairs in the dictionary, beginning at the first entry.

Returns
IPDFDictionary::Iterator an iterator positioned at the start of the dictionary

◆ containsCompositeObject()

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

Recursively check to see if the dictionary 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::IPDFDictionary::copy ( const IPDFDictionaryPtr & sourceDict,
uint32 sourceIndex )
pure virtual

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

Parameters
sourceDictThe dictionary from which to copy.
sourceIndexThe index of the entry in sourceDict to copy.

◆ create()

static JAWSMAKO_API IPDFDictionaryPtr JawsMako::IPDFDictionary::create ( IEDLClassFactory * pFactory,
uint32 size = 0 )
static

Create a new PDF dictionary of the given initial capacity.

Parameters
pFactoryThe JawsMako instance or factory to use to create the dictionary.
sizeThe initial capacity of the dictionary. It may be beneficial to preallocate for performance.
Returns
IPDFDictionaryPtr The created object.

◆ end()

virtual Iterator JawsMako::IPDFDictionary::end ( )
pure virtual

Obtain an interator representing the end of the dictionary.

Returns
IPDFDictionary::Iterator the iterator at the end of the dictionary

◆ get() [1/3]

virtual IPDFObjectPtr JawsMako::IPDFDictionary::get ( const char * key) const
pure virtual

Get the object stored in the dictionary with the given null-terminated string as key.

Returns
IPDFObjectPtr The object stored under the given key, or NULL if there is no such object.

◆ get() [2/3]

virtual IPDFObjectPtr JawsMako::IPDFDictionary::get ( const IPDFNamePtr & key) const
pure virtual

Get the object stored in the dictionary with the given DF name as key.

Returns
IPDFObjectPtr The object stored under the given key, or NULL if there is no such object.

◆ get() [3/3]

virtual IPDFObjectPtr JawsMako::IPDFDictionary::get ( const RawString & key) const
pure virtual

Get the object stored in the dictionary with the given raw string as key.

Returns
IPDFObjectPtr The object stored under the given key, or NULL if there is no such object.

◆ getKeyAtIndex()

virtual IPDFNamePtr JawsMako::IPDFDictionary::getKeyAtIndex ( uint32 index) const
pure virtual

Get the key of the dictionary entry at the given index.

Returns
IPDFNamePtr The key at the given index, or NULL if the dictionary entry is empty.

◆ getSize()

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

Get the current size of the dictionary, including currently empty entries.

Returns
uint32 The size.

◆ getValueAtIndex()

virtual IPDFObjectPtr JawsMako::IPDFDictionary::getValueAtIndex ( uint32 index) const
pure virtual

Get the value stored in the dictionary entry at the given index.

Returns
IPDFObjectPtr The object at the given index, or NULL if the dictionary entry is empty.

◆ getValueTypeAtIndex()

virtual ePDFObjectType JawsMako::IPDFDictionary::getValueTypeAtIndex ( uint32 index) const
pure virtual

Get the type of the value stored in the dictionary entry at the given index. An exception is thrown if the dictionary entry is empty.

Returns
ePDFObjectType The type of the object at the given index, or NULL if the dictionary slot is empty.

◆ put() [1/3]

virtual void JawsMako::IPDFDictionary::put ( const char * key,
const IPDFObjectPtr & value )
pure virtual

Store an object in the dictionary under the given key.

Parameters
keyThe null-terminated string to use as key.
valueThe PDF object to store.

◆ put() [2/3]

virtual void JawsMako::IPDFDictionary::put ( const IPDFNamePtr & key,
const IPDFObjectPtr & value )
pure virtual

Store an object in the dictionary under the given key.

Parameters
keyThe name object to use as key.
valueThe PDF object to store.

◆ put() [3/3]

virtual void JawsMako::IPDFDictionary::put ( const RawString & key,
const IPDFObjectPtr & value )
pure virtual

Store an object in the dictionary under the given key.

Parameters
keyThe raw string to use as key.
valueThe PDF object to store.

◆ putInteger()

virtual void JawsMako::IPDFDictionary::putInteger ( const IPDFNamePtr & key,
int32 integer )
pure virtual

Convenience member to add an Integer to a dictionary.

Parameters
keyThe name object to use as key.
integerThe integer value to store.

◆ putReal()

virtual void JawsMako::IPDFDictionary::putReal ( const IPDFNamePtr & key,
double real )
pure virtual

Convenience member to add a real to a dictionary.

Parameters
keyThe name object to use as key.
realThe floating point value to store.

◆ undefine() [1/3]

virtual void JawsMako::IPDFDictionary::undefine ( const char * key)
pure virtual

Remove the object stored under the given key, if it exists.

Parameters
keyThe null-terminated string to use as key.

◆ undefine() [2/3]

virtual void JawsMako::IPDFDictionary::undefine ( const IPDFNamePtr & key)
pure virtual

Remove the object stored under the given key, if it exists.

Parameters
keyThe name object to use as key.

◆ undefine() [3/3]

virtual void JawsMako::IPDFDictionary::undefine ( const RawString & key)
pure virtual

Remove the object stored under the given key, if it exists.

Parameters
keyThe raw string to use as key.

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