Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
Public Member Functions | Friends | List of all members
hdi::core::ai::Array Class Reference

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

#include <hdicoreaiArray.h>

Public Member Functions

 Array ()
 Constructs an Array object as a new data container. More...
 
 Array (const Array &a_)
 Array copy constructor. More...
 
 Array (const AIArrayRef aiArray_)
 Constructs a new Array object from an AIArrayRef. More...
 
virtual ~Array ()
 Destructs an Array object. More...
 
virtual Arrayoperator= (const Array &rhs_)
 Overloaded assignment operator for Array objects. More...
 
virtual bool operator== (const Array &rhs_) const
 Tests whether a given Array object is the same as another. More...
 
virtual bool operator!= (const Array &rhs_) const
 Tests whether a given Array object is not the same as another. More...
 
virtual AIArrayRef aiArrayRef () const
 Gets the array ref around which the target object is wrapped. More...
 
virtual bool getEntry (const uint32_t index_, Entry &e__) const
 Gets an entry from the array by index. More...
 
virtual bool setEntry (const uint32_t index_, const Entry &entry_)
 Sets an entry in the array by index. More...
 
virtual bool appendEntry (const Entry &entry_)
 Appends an entry to the end of the array. More...
 
virtual bool deleteEntry (const uint32_t index_)
 Removes an entry in the array by index. More...
 
virtual uint32_t count () const
 Gets the count of the array elements. More...
 
virtual bool getArrayEntry (const uint32_t index_, Array &array__) const
 Gets an array entry from the array by index. More...
 
virtual bool setArrayEntry (const uint32_t index_, const Array &value_)
 Sets an array entry in the array by index. More...
 
virtual bool getDictEntry (const uint32_t index_, Dictionary &dict__) const
 Gets a dictionary entry from the array by index. More...
 
virtual bool setDictEntry (const uint32_t index_, const Dictionary &value_)
 Sets a dictionary entry in the array by index. More...
 
virtual bool getBoolEntry (const uint32_t index_, bool &value__) const
 Gets a bool entry from the array by index. More...
 
virtual bool setBoolEntry (const uint32_t index_, const bool value_)
 Sets a bool entry in the array by index. More...
 
virtual bool getIntEntry (const uint32_t index_, int64_t &value__) const
 Gets an integer entry from the array by index. More...
 
virtual bool setIntEntry (const uint32_t index_, const int64_t value_)
 Sets an integer entry in the array by index. More...
 
virtual bool getFloatEntry (const uint32_t index_, double &value__) const
 Gets a floating point entry from the array by index. More...
 
virtual bool setFloatEntry (const uint32_t index_, const double value_)
 Sets a floating point entry in the array by index. More...
 
virtual bool getStringEntry (const uint32_t index_, std::string &value__) const
 Gets a string entry from the array by index. More...
 
virtual bool setStringEntry (const uint32_t index_, const std::string &value_)
 Sets a string entry in the array by index. More...
 
virtual bool getUIDEntry (const uint32_t index_, UID &uid__) const
 Gets a UID entry from the array by index. More...
 
virtual bool setUIDEntry (const uint32_t index_, const UID &value_)
 Sets a UID entry in the array by index. More...
 
virtual bool getArtEntry (const uint32_t index_, Art &art__) const
 Gets an Art entry from the array by index. More...
 
virtual bool setArtEntry (const uint32_t index_, const Art &value_)
 Sets an Art entry in the array by index. More...
 
virtual Array duplicate () const
 Duplicates the target Array object and the data it's wrapped around. More...
 
virtual bool swapEntries (const uint32_t index1_, const uint32_t index2_)
 Swaps entries in the target Array object. More...
 
virtual bool clear ()
 Removes all entries from the array. More...
 

Friends

plugin::IllustratorArray * __accessImpl (const Array &)
 
Array __accessCtor (const plugin::IllustratorArray &)
 

Detailed Description

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

Constructor & Destructor Documentation

hdi::core::ai::Array::Array ( )

Constructs an Array object as a new data container.

Author
GW
Date
08/2013
hdi::core::ai::Array::Array ( const Array a_)

Array copy constructor.

Author
GW
Date
08/2013
Parameters
a_Array object to clone
hdi::core::ai::Array::Array ( const AIArrayRef  aiArray_)

Constructs a new Array object from an AIArrayRef.

Author
GW
Date
08/2015
Parameters
aiArray_Raw Illustrator AIArrayRef
virtual hdi::core::ai::Array::~Array ( )
virtual

Destructs an Array object.

Author
GW
Date
08/2013

Member Function Documentation

virtual AIArrayRef hdi::core::ai::Array::aiArrayRef ( ) const
virtual

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

Author
GW
Date
11/2013
Returns
AIArrayRef for the target object
Note
The caller should not release the returned AIArrayRef (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.
virtual bool hdi::core::ai::Array::appendEntry ( const Entry entry_)
virtual

Appends an entry to the end of the array.

Author
GW
Date
08/2013
Parameters
entry_Entry to append to the array
Returns
true if the entry was appended, false otherwise
virtual bool hdi::core::ai::Array::clear ( )
virtual

Removes all entries from the array.

Author
GW
Date
08/2013
Returns
true if the array was cleared, false otherwise
virtual uint32_t hdi::core::ai::Array::count ( ) const
virtual

Gets the count of the array elements.

Author
GW
Date
08/2013
Returns
The count of the elements in the target array
virtual bool hdi::core::ai::Array::deleteEntry ( const uint32_t  index_)
virtual

Removes an entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the entry to delete
Returns
true if the entry was deleted, false otherwise
virtual Array hdi::core::ai::Array::duplicate ( ) const
virtual

Duplicates the target Array object and the data it's wrapped around.

Author
GW
Date
08/2013
Returns
An Array object representing a duplicate of the original target array
virtual bool hdi::core::ai::Array::getArrayEntry ( const uint32_t  index_,
Array array__ 
) const
virtual

Gets an array entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the array entry
array__Return-by-reference for the indicated array entry
Returns
true if the array entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getArtEntry ( const uint32_t  index_,
Art art__ 
) const
virtual

Gets an Art entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the Art entry
art__Return-by-reference for the indicated Art entry
Returns
true if the Art entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getBoolEntry ( const uint32_t  index_,
bool &  value__ 
) const
virtual

Gets a bool entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the bool entry
value__Return-by-reference for the indicated bool entry
Returns
true if the bool entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getDictEntry ( const uint32_t  index_,
Dictionary dict__ 
) const
virtual

Gets a dictionary entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the dictionary entry
dict__Return-by-reference for the indicated dictionary entry
Returns
true if the dictionary entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getEntry ( const uint32_t  index_,
Entry e__ 
) const
virtual

Gets an entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the entry in question
e__Return-by-reference for the Entry object representing the array entry at the provided index
Returns
true if the entry can be acquired, false otherwise
virtual bool hdi::core::ai::Array::getFloatEntry ( const uint32_t  index_,
double &  value__ 
) const
virtual

Gets a floating point entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the floating point entry
value__Return-by-reference for the indicated floating point entry
Returns
true if the floating point entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getIntEntry ( const uint32_t  index_,
int64_t &  value__ 
) const
virtual

Gets an integer entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the integer entry
value__Return-by-reference for the indicated integer entry
Returns
true if the integer entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getStringEntry ( const uint32_t  index_,
std::string &  value__ 
) const
virtual

Gets a string entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the string entry
value__Return-by-reference for the indicated UTF-8 string entry
Returns
true if the string entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::getUIDEntry ( const uint32_t  index_,
UID uid__ 
) const
virtual

Gets a UID entry from the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the UID entry
uid__Return-by-reference for the indicated UID entry
Returns
true if the UID entry could be acquired, false otherwise
virtual bool hdi::core::ai::Array::operator!= ( const Array rhs_) const
virtual

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

Author
GW
Date
08/2013
Parameters
rhs_Array to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different arrays, false otherwise
virtual Array& hdi::core::ai::Array::operator= ( const Array rhs_)
virtual

Overloaded assignment operator for Array objects.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the assignment operator; existing Array object that the target should reference instead
Returns
The lefthand side of the assignment operator, but now referencing the same array data as the righthand side
virtual bool hdi::core::ai::Array::operator== ( const Array rhs_) const
virtual

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

Author
GW
Date
08/2013
Parameters
rhs_Array to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same array, false otherwise
virtual bool hdi::core::ai::Array::setArrayEntry ( const uint32_t  index_,
const Array value_ 
)
virtual

Sets an array entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the array entry
value_New value for the array entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setArtEntry ( const uint32_t  index_,
const Art value_ 
)
virtual

Sets an Art entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the Art entry
value_New value for the Art entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setBoolEntry ( const uint32_t  index_,
const bool  value_ 
)
virtual

Sets a bool entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the bool entry
value_New value for the bool entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setDictEntry ( const uint32_t  index_,
const Dictionary value_ 
)
virtual

Sets a dictionary entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the dictionary entry
value_New value for the dictionary entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setEntry ( const uint32_t  index_,
const Entry entry_ 
)
virtual

Sets an entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the entry in question
entry_Entry to set on the array
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setFloatEntry ( const uint32_t  index_,
const double  value_ 
)
virtual

Sets a floating point entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the floating-point entry
value_New value for the floating-point entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
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.
Illustrator 16 and below saves all floating point values as floats (not doubles), so anything larger than FLT_MAX or smaller than -FLT_MAX is adjusted accordingly.
virtual bool hdi::core::ai::Array::setIntEntry ( const uint32_t  index_,
const int64_t  value_ 
)
virtual

Sets an integer entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the integer entry
value_New value for the integer entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setStringEntry ( const uint32_t  index_,
const std::string &  value_ 
)
virtual

Sets a string entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the string entry
value_New value for the UTF-8 string entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::setUIDEntry ( const uint32_t  index_,
const UID value_ 
)
virtual

Sets a UID entry in the array by index.

Author
GW
Date
08/2013
Parameters
index_Index of the UID entry
value_New value for the UID entry
Returns
true if the entry was set, false otherwise
Precondition
An entry at the provided index must already exist in the array; to add a new entry, use the appendEntry() method.
virtual bool hdi::core::ai::Array::swapEntries ( const uint32_t  index1_,
const uint32_t  index2_ 
)
virtual

Swaps entries in the target Array object.

Author
GW
Date
08/2013
Parameters
index1_Index of entry to swap with entry at index2_
index2_Index of entry to swap with entry at index1_
Returns
true if the swap was performed