Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Friends | List of all members
hdi::core::ai::Dictionary Class Reference

Embodies Illustrator's dictionary storage containers; can be placed inside an array, or another dictionary. More...

#include <hdicoreaiDictionary.h>

Classes

class  Iterator
 Allows for iteration through the members of a dictionary, a la std::vector iteration. More...
 

Public Types

typedef std::unique_ptr< IteratorIteratorUP
 
typedef std::shared_ptr< IteratorIteratorSP
 
typedef std::weak_ptr< IteratorIteratorWP
 

Public Member Functions

 Dictionary ()
 Constructs a Dictionary object as a new data container.
 
 Dictionary (const Dictionary &d_)
 Dictionary copy constructor.
 
 Dictionary (const AIDictionaryRef aiDict_)
 Constructs a new Dictionary object from an AIDictionaryRef.
 
virtual ~Dictionary ()
 Destructs a Dictionary object.
 
virtual Dictionaryoperator= (const Dictionary &rhs_)
 Overloaded assignment operator for Dictionary objects.
 
virtual bool operator== (const Dictionary &rhs_) const
 Tests whether a given Dictionary object is the same as another.
 
virtual bool operator!= (const Dictionary &rhs_) const
 Tests whether a given Dictionary object is not the same as another.
 
virtual AIDictionaryRef aiDictionaryRef () const
 Gets the dictionary ref around which the target object is wrapped.
 
virtual bool getEntry (const std::string &keyName_, Entry &entry__) const
 Gets an entry from the array by name.
 
virtual bool setEntry (const std::string &keyName_, const Entry &entry_)
 Sets an entry in the dictionary by key name.
 
virtual bool deleteEntry (const std::string &keyName_)
 Removes an entry in the dictionary by key name.
 
virtual bool getArrayEntry (const std::string &keyName_, Array &array__) const
 Gets an array entry from the dictionary by name.
 
virtual bool setArrayEntry (const std::string &keyName_, const Array &array_)
 Sets an array entry in the dictionary by name.
 
virtual bool getBoolEntry (const std::string &keyName_, bool &value__) const
 Gets a bool entry from the dictionary by name.
 
virtual bool setBoolEntry (const std::string &keyName_, const bool value_)
 Sets a bool entry in the dictionary by name.
 
virtual bool getDictEntry (const std::string &keyName_, Dictionary &dict__) const
 Gets a dictionary entry from the dictionary by name.
 
virtual bool setDictEntry (const std::string &keyName_, const Dictionary &dict_)
 Sets a dictionary entry in the dictionary by name.
 
virtual bool getIntEntry (const std::string &keyName_, int64_t &value__) const
 Gets an integer entry from the dictionary by name.
 
virtual bool setIntEntry (const std::string &keyName_, const int64_t value_)
 Sets an integer entry in the dictionary by name.
 
virtual bool getFloatEntry (const std::string &keyName_, double &value__) const
 Gets a floating point entry from the dictionary by name.
 
virtual bool setFloatEntry (const std::string &keyName_, const double value_)
 Sets a floating point entry in the dictionary by name.
 
virtual bool getStringEntry (const std::string &keyName_, std::string &value__) const
 Gets a string entry from the dictionary by name.
 
virtual bool setStringEntry (const std::string &keyName_, const std::string &value_)
 Sets a string entry in the dictionary by name.
 
virtual bool getUIDEntry (const std::string &keyName_, UID &uid__) const
 Gets a UID entry from the dictionary by name.
 
virtual bool setUIDEntry (const std::string &keyName_, const UID &value_)
 Sets a UID entry in the dictionary by key.
 
virtual bool getArtEntry (const std::string &keyName_, Art &art__) const
 Gets an Art entry from the dictionary by name.
 
virtual bool setArtEntry (const std::string &keyName_, const Art &value_)
 Sets an Art entry in the dictionary by key.
 
virtual bool hasKey (const std::string &keyName_) const
 Tests whether the dictionary has an entry with a particular key.
 
virtual bool clear ()
 Removes all entries from the dictionary.
 
Iterator begin () const
 Gets an iterator for the entries in the dictionary, starting with the first.
 

Friends

aip::IllustratorDictionary * __accessImpl (const Dictionary &)
 
Dictionary __accessCtor (const aip::IllustratorDictionary &)
 

Detailed Description

Embodies Illustrator's dictionary storage containers; can be placed inside an array, or another dictionary.

Constructor & Destructor Documentation

◆ Dictionary() [1/3]

hdi::core::ai::Dictionary::Dictionary ( )

Constructs a Dictionary object as a new data container.

Author
GW
Date
08/2013

◆ Dictionary() [2/3]

hdi::core::ai::Dictionary::Dictionary ( const Dictionary d_)

Dictionary copy constructor.

Author
GW
Date
08/2013
Parameters
d_Dictionary object to clone

◆ Dictionary() [3/3]

hdi::core::ai::Dictionary::Dictionary ( const AIDictionaryRef  aiDict_)

Constructs a new Dictionary object from an AIDictionaryRef.

Author
GW
Date
08/2015
Parameters
aiDict_Raw Illustrator AIDictionaryRef

◆ ~Dictionary()

virtual hdi::core::ai::Dictionary::~Dictionary ( )
virtual

Destructs a Dictionary object.

Author
GW
Date
08/2013

Member Function Documentation

◆ aiDictionaryRef()

virtual AIDictionaryRef hdi::core::ai::Dictionary::aiDictionaryRef ( ) const
virtual

Gets the dictionary ref around which the target object is wrapped.

Author
GW
Date
11/2013
Returns
AIDictionaryRef for the target object
Note
The caller should not release the returned AIDictionaryRef (its reference count is not increased before being returned).
Generally, you shouldn't need to call this method. Only use it if you know what you're doing. If a specific piece of functionality provided by Illustrator is not handled by this class (or related classes), then it should probably be added to the hdi_core library.

◆ begin()

Iterator hdi::core::ai::Dictionary::begin ( ) const

Gets an iterator for the entries in the dictionary, starting with the first.

Author
GW
Date
08/2013
Returns
A new iterator for the target dictionary
// For example:
for(hdi::core::Dictionary::Iterator iter = someDict.begin(); !iter.atEnd(); ++iter)
{
// Do stuff with either iter.key() or iter.value()
}

◆ clear()

virtual bool hdi::core::ai::Dictionary::clear ( )
virtual

Removes all entries from the dictionary.

Author
GW
Date
08/2013
Returns
true if the dictionary was cleared, false otherwise

◆ deleteEntry()

virtual bool hdi::core::ai::Dictionary::deleteEntry ( const std::string &  keyName_)
virtual

Removes an entry in the dictionary by key name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the entry to delete, as UTF-8
Returns
true if the entry was deleted, false otherwise

◆ getArrayEntry()

virtual bool hdi::core::ai::Dictionary::getArrayEntry ( const std::string &  keyName_,
Array array__ 
) const
virtual

Gets an array entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the array entry, as UTF-8
array__Return-by-reference for the indicated array entry
Returns
true if the array entry could be acquired, false otherwise

◆ getArtEntry()

virtual bool hdi::core::ai::Dictionary::getArtEntry ( const std::string &  keyName_,
Art art__ 
) const
virtual

Gets an Art entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the Art entry, as UTF-8
art__Return-by-reference for the indicated Art entry
Returns
true if the Art entry could be acquired, false otherwise

◆ getBoolEntry()

virtual bool hdi::core::ai::Dictionary::getBoolEntry ( const std::string &  keyName_,
bool &  value__ 
) const
virtual

Gets a bool entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the bool entry, as UTF-8
value__Return-by-reference for the indicated bool entry
Returns
true if the bool entry could be acquired, false otherwise

◆ getDictEntry()

virtual bool hdi::core::ai::Dictionary::getDictEntry ( const std::string &  keyName_,
Dictionary dict__ 
) const
virtual

Gets a dictionary entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the dictionary entry, as UTF-8
dict__Return-by-reference for the indicated dictionary entry
Returns
true if the dictionary entry could be acquired, false otherwise

◆ getEntry()

virtual bool hdi::core::ai::Dictionary::getEntry ( const std::string &  keyName_,
Entry entry__ 
) const
virtual

Gets an entry from the array by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the entry in question, as UTF-8
entry__Return-by-reference for an Entry object representing the dictionary entry with the provided key name
Returns
true if the entry could be acquired, false otherwise

◆ getFloatEntry()

virtual bool hdi::core::ai::Dictionary::getFloatEntry ( const std::string &  keyName_,
double &  value__ 
) const
virtual

Gets a floating point entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the floating point entry, as UTF-8
value__Return-by-reference for the indicated floating point entry
Returns
true if the floating point entry could be acquired, false otherwise

◆ getIntEntry()

virtual bool hdi::core::ai::Dictionary::getIntEntry ( const std::string &  keyName_,
int64_t &  value__ 
) const
virtual

Gets an integer entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the integer entry, as UTF-8
value__Return-by-reference for the indicated integer entry
Returns
true if the integer entry could be acquired, false otherwise

◆ getStringEntry()

virtual bool hdi::core::ai::Dictionary::getStringEntry ( const std::string &  keyName_,
std::string &  value__ 
) const
virtual

Gets a string entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the string entry, as UTF-8
value__Return-by-reference for the indicated string entry, as UTF-8
Returns
true if the string entry could be acquired, false otherwise

◆ getUIDEntry()

virtual bool hdi::core::ai::Dictionary::getUIDEntry ( const std::string &  keyName_,
UID uid__ 
) const
virtual

Gets a UID entry from the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the UID entry, as UTF-8
uid__Return-by-reference for the indicated UID entry
Returns
true if the UID entry could be acquired, false otherwise

◆ hasKey()

virtual bool hdi::core::ai::Dictionary::hasKey ( const std::string &  keyName_) const
virtual

Tests whether the dictionary has an entry with a particular key.

Author
GW
Date
08/2013
Parameters
keyName_Name of the entry in question, as UTF-8
Returns
true if the dictionary contains the key, false otherwise

◆ operator!=()

virtual bool hdi::core::ai::Dictionary::operator!= ( const Dictionary rhs_) const
virtual

Tests whether a given Dictionary object is not the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Dictionary to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different dicts, false otherwise

◆ operator=()

virtual Dictionary & hdi::core::ai::Dictionary::operator= ( const Dictionary rhs_)
virtual

Overloaded assignment operator for Dictionary objects.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the assignment operator; existing Dictionary object that the target should reference instead
Returns
The lefthand side of the assignment operator, but now referencing the same dictionary data as the righthand side

◆ operator==()

virtual bool hdi::core::ai::Dictionary::operator== ( const Dictionary rhs_) const
virtual

Tests whether a given Dictionary object is the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Dictionary to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same dict, false otherwise

◆ setArrayEntry()

virtual bool hdi::core::ai::Dictionary::setArrayEntry ( const std::string &  keyName_,
const Array array_ 
)
virtual

Sets an array entry in the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the array entry, as UTF-8
array_New value for the array entry
Returns
true if the entry was set, false otherwise

◆ setArtEntry()

virtual bool hdi::core::ai::Dictionary::setArtEntry ( const std::string &  keyName_,
const Art value_ 
)
virtual

Sets an Art entry in the dictionary by key.

Author
GW
Date
08/2013
Parameters
keyName_Name of the art entry, as UTF-8
value_New value for the art entry
Returns
true if the entry was set, false otherwise

◆ setBoolEntry()

virtual bool hdi::core::ai::Dictionary::setBoolEntry ( const std::string &  keyName_,
const bool  value_ 
)
virtual

Sets a bool entry in the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the bool entry, as UTF-8
value_New value for the bool entry
Returns
true if the entry was set, false otherwise

◆ setDictEntry()

virtual bool hdi::core::ai::Dictionary::setDictEntry ( const std::string &  keyName_,
const Dictionary dict_ 
)
virtual

Sets a dictionary entry in the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the dictionary entry, as UTF-8
dict_New value for the dictionary entry
Returns
true if the entry was set, false otherwise

◆ setEntry()

virtual bool hdi::core::ai::Dictionary::setEntry ( const std::string &  keyName_,
const Entry entry_ 
)
virtual

Sets an entry in the dictionary by key name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the entry in question, as UTF-8
entry_Entry to set on the dictionary
Returns
true if the entry was set, false otherwise

◆ setFloatEntry()

virtual bool hdi::core::ai::Dictionary::setFloatEntry ( const std::string &  keyName_,
const double  value_ 
)
virtual

Sets a floating point entry in the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the floating point entry, as UTF-8
value_New value for the floating point entry
Returns
true if the entry was set, false otherwise
Note
This method compensates for values that are NaN by converting them to 0, and compensates for values that are -infinity or infinity by converting them to -FLT_MAX or FLT_MAX, respectively.

◆ setIntEntry()

virtual bool hdi::core::ai::Dictionary::setIntEntry ( const std::string &  keyName_,
const int64_t  value_ 
)
virtual

Sets an integer entry in the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the integer entry, as UTF-8
value_New value for the integer entry
Returns
true if the entry was set, false otherwise

◆ setStringEntry()

virtual bool hdi::core::ai::Dictionary::setStringEntry ( const std::string &  keyName_,
const std::string &  value_ 
)
virtual

Sets a string entry in the dictionary by name.

Author
GW
Date
08/2013
Parameters
keyName_Name of the string entry, as UTF-8
value_New value for the string entry, as UTF-8
Returns
true if the entry was set, false otherwise

◆ setUIDEntry()

virtual bool hdi::core::ai::Dictionary::setUIDEntry ( const std::string &  keyName_,
const UID value_ 
)
virtual

Sets a UID entry in the dictionary by key.

Author
GW
Date
08/2013
Parameters
keyName_Name of the UID entry, as UTF-8
value_New value for the UID entry
Returns
true if the entry was set, false otherwise