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

Acts as an array-style container to store any other persistent data types, including arrays and dictionaries, and can itself be stored inside another container type. More...

#include <hdicoreArrayPref.h>

Inheritance diagram for hdi::core::ArrayPref:
Inheritance graph
[legend]
Collaboration diagram for hdi::core::ArrayPref:
Collaboration graph
[legend]

Public Types

typedef std::vector< std::shared_ptr< PrefData > > PrefDataVector
 
- Public Types inherited from hdi::core::PrefData
enum  Type {
  UnknownType = 0 , ArrayType = 10 , ArtboardPointType = 20 , ArtboardRectType = 30 ,
  ArtColorType = 40 , BoolType = 50 , ColorType = 60 , DashStyleType = 70 ,
  DashStyleMapType = 80 , DictionaryType = 90 , FillStyleType = 100 , FillStyleMapType = 110 ,
  FontType = 120 , NumberType = 130 , PathType = 140 , PathStyleType = 150 ,
  PathStyleMapType = 160 , PointType = 170 , RectType = 180 , SizeType = 190 ,
  StringType = 200 , StrokeStyleType = 210 , StrokeStyleMapType = 220 , TransformMatrixType = 230 ,
  CustomTypeOffset = 10000
}
 Describes the type of the data the PrefData object contains; useful for determining which subclass to cast a PrefData object to.
 

Public Member Functions

 ArrayPref (const ArrayPref &array_)
 Constructs a new ArrayPref object from an existing ArrayPref object (copy constructor)
 
 ArrayPref (const PrefDataVector *elements_=NULL, const std::string &name_="")
 Constructs an ArrayPref object, with new data, to be added to a container at a later time.
 
virtual ~ArrayPref ()
 Destructs an ArrayPref object.
 
virtual ArrayPrefoperator= (const ArrayPref &rhs_)
 Allows one ArrayPref object to be assigned from another.
 
virtual ArrayPrefclone () const
 Convenience method to clone an ArrayPref object on the heap.
 
virtual uint32_t count () const
 Gets the count of elements in the top-level of the array.
 
virtual bool element (const uint32_t index_, std::unique_ptr< PrefData > &data__) const
 Gets a single element object from the array data tree.
 
virtual bool pushElement (const PrefData &data_)
 Adds a persistent data object to the end of the array.
 
virtual bool popElement (std::unique_ptr< PrefData > &data__)
 Removes a persistent data object from the end of the array.
 
virtual bool insertElement (const uint32_t index_, const PrefData &data_)
 Inserts a persistent data object at an arbitrary position in the array.
 
virtual bool removeElement (const uint32_t index_, std::unique_ptr< PrefData > &data__)
 Removes a persistent data object from an arbitrary position in the array.
 
virtual void clear ()
 Removes all elements from an array.
 
virtual bool getArrayElement (const uint32_t index_, ArrayPref &array__) const
 Gets a persistent array object from the containing array.
 
virtual bool getOrCreateArrayElement (const uint32_t index_, const PrefDataVector *elements_, ArrayPref &array__)
 Similar to getArrayElement(), except that, if the element does not already exist, it will be created anew with a series of default elements.
 
virtual bool getArtboardPointElement (const uint32_t index_, ArtboardPointPref &abp__) const
 Gets a persistent point object from the array.
 
virtual bool getOrCreateArtboardPointElement (const uint32_t index_, const ArtboardPoint &default_, ArtboardPointPref &abp__)
 Similar to getArtboardPointElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getArtboardRectElement (const uint32_t index_, ArtboardRectPref &abr__) const
 Gets a persistent artboard rect object from the array.
 
virtual bool getOrCreateArtboardRectElement (const uint32_t index_, const ArtboardRect &default_, ArtboardRectPref &abr__)
 Similar to getArtboardRectElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getArtColorElement (const uint32_t index_, ArtColorPref &ac__) const
 Gets a persistent art color object from the array.
 
virtual bool getOrCreateArtColorElement (const uint32_t index_, const ArtColor &default_, ArtColorPref &ac__)
 Similar to getArtColorElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getBoolElement (const uint32_t index_, BoolPref &b__) const
 Gets a persistent bool object from the array.
 
virtual bool getOrCreateBoolElement (const uint32_t index_, const bool default_, BoolPref &b__)
 Similar to getBoolElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getColorElement (const uint32_t index_, ColorPref &c__) const
 Gets a persistent color object from the array.
 
virtual bool getOrCreateColorElement (const uint32_t index_, const Color &default_, ColorPref &c__)
 Similar to getColorElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getDashStyleElement (const uint32_t index_, DashStylePref &ds__)
 Gets a persistent dash style object from the dictionary.
 
virtual bool getOrCreateDashStyleElement (const uint32_t index_, const DashStyle &default_, DashStylePref &ds__)
 Similar to getDashStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getDashStyleMapElement (const uint32_t index_, DashStyleMapPref &ds__)
 Gets a persistent dash style map object from the dictionary.
 
virtual bool getOrCreateDashStyleMapElement (const uint32_t index_, const DashStyle::Map &default_, DashStyleMapPref &ds__)
 Similar to getDashStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getDictElement (const uint32_t index_, DictionaryPref &dict__) const
 Gets a persistent dictionary object from the array.
 
virtual bool getOrCreateDictElement (const uint32_t index_, const PrefDataVector *members_, DictionaryPref &dict__)
 Similar to getDictElement(), except that, if the element does not already exist, it will be created anew with a series of default members.
 
virtual bool getFillStyleElement (const uint32_t index_, FillStylePref &fs__)
 Gets a persistent fill style object from the dictionary.
 
virtual bool getOrCreateFillStyleElement (const uint32_t index_, const FillStyle &default_, FillStylePref &fs__)
 Similar to getFillStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getFillStyleMapElement (const uint32_t index_, FillStyleMapPref &fs__)
 Gets a persistent fill style map object from the dictionary.
 
virtual bool getOrCreateFillStyleMapElement (const uint32_t index_, const FillStyle::Map &default_, FillStyleMapPref &fs__)
 Similar to getFillStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getFontElement (const uint32_t index_, FontPref &font__) const
 Gets a persistent font object from the array.
 
virtual bool getOrCreateFontElement (const uint32_t index_, const Font &defaultFont_, const double defaultSize_, FontPref &font__)
 Similar to getFontElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getTransformMatrixElement (const uint32_t index_, TransformMatrixPref &tm__) const
 Gets a persistent matrix object from the array.
 
virtual bool getOrCreateTransformMatrixElement (const uint32_t index_, const TransformMatrix &default_, TransformMatrixPref &tm__)
 Similar to getTransformMatrixElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getNumberElement (const uint32_t index_, NumberPref &n__) const
 Gets a persistent number object from the array.
 
virtual bool getOrCreateIntElement (const uint32_t index_, const int64_t default_, NumberPref &n__)
 Similar to getNumberElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getOrCreateFloatElement (const uint32_t index_, const double default_, NumberPref &n__)
 Similar to getNumberElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getPathStyleElement (const uint32_t index_, PathStylePref &ps__)
 Gets a persistent path style object from the dictionary.
 
virtual bool getOrCreatePathStyleElement (const uint32_t index_, const PathStyle &default_, PathStylePref &ps__)
 Similar to getPathStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getPathStyleMapElement (const uint32_t index_, PathStyleMapPref &ps__)
 Gets a persistent path style map object from the dictionary.
 
virtual bool getOrCreatePathStyleMapElement (const uint32_t index_, const PathStyle::Map &default_, PathStyleMapPref &ps__)
 Similar to getPathStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getPointElement (const uint32_t index_, PointPref &p__) const
 Gets a persistent point object from the array.
 
virtual bool getOrCreatePointElement (const uint32_t index_, const Point &default_, PointPref &p__)
 Similar to getPointElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getRectElement (const uint32_t index_, RectPref &r__) const
 Gets a persistent rect object from the array.
 
virtual bool getOrCreateRectElement (const uint32_t index_, const Rect &default_, RectPref &r__)
 Similar to getRectElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getSizeElement (const uint32_t index_, SizePref &s__) const
 Gets a persistent size object from the array.
 
virtual bool getOrCreateSizeElement (const uint32_t index_, const Size &default_, SizePref &s__)
 Similar to getSizeElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getStringElement (const uint32_t index_, StringPref &str__) const
 Gets a persistent string object from the array.
 
virtual bool getOrCreateStringElement (const uint32_t index_, const std::string &default_, StringPref &str__)
 Similar to getStringElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getStrokeStyleElement (const uint32_t index_, StrokeStylePref &ss__)
 Gets a persistent stroke style object from the dictionary.
 
virtual bool getOrCreateStrokeStyleElement (const uint32_t index_, const StrokeStyle &default_, StrokeStylePref &ss__)
 Similar to getStrokeStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
virtual bool getStrokeStyleMapElement (const uint32_t index_, StrokeStyleMapPref &ss__)
 Gets a persistent stroke style map object from the dictionary.
 
virtual bool getOrCreateStrokeStyleMapElement (const uint32_t index_, const StrokeStyle::Map &default_, StrokeStyleMapPref &ss__)
 Similar to getStrokeStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.
 
- Public Member Functions inherited from hdi::core::PrefData
 PrefData ()
 Constructs an empty PrefData object.
 
virtual ~PrefData ()
 Destructs a PrefData object.
 
virtual PrefDataoperator= (const PrefData &rhs_)
 Allows one PrefData object to be assigned from another.
 
virtual PrefDataclone () const =0
 Convenience method to clone a PrefData object, taking its subclass type into account for proper memory management.
 
virtual bool isEmpty () const
 Gets whether the target PrefData object is empty (constructed with the default ctor)
 
virtual bool operator== (const PrefData &rhs_) const
 Tests whether a given PrefData object is the same as another.
 
virtual bool operator!= (const PrefData &rhs_) const
 Tests whether a given PrefData object is not the same as another.
 
virtual Type dataType () const
 Gets the type of persistent data.
 
virtual std::string key () const
 Gets the persistent data object's key.
 
virtual void setKey (const std::string &key_)
 Sets the persistent data object's key.
 
virtual std::string stringify () const
 Recursively serializes the target object as a JSON data (sub)tree, returning the appropriate JSON string.
 

Additional Inherited Members

- Static Public Member Functions inherited from hdi::core::PrefData
static std::unique_ptr< PrefDataparse (const std::string &jsonStr_)
 Parses the given JSON string to a best-fit representation of PrefData subclass objects in a tree.
 
- Protected Member Functions inherited from hdi::core::PrefData
void * __impl () const
 Internal use only.
 
 PrefData (plat::PersistentData *&)
 Internal use only.
 
 PrefData (const PrefData &data_)
 Constructs a new PrefData object from an existing PrefData object (copy constructor)
 
- Protected Attributes inherited from hdi::core::PrefData
void * _data
 Private implementation data.
 

Detailed Description

Acts as an array-style container to store any other persistent data types, including arrays and dictionaries, and can itself be stored inside another container type.

Constructor & Destructor Documentation

◆ ArrayPref() [1/2]

hdi::core::ArrayPref::ArrayPref ( const ArrayPref array_)

Constructs a new ArrayPref object from an existing ArrayPref object (copy constructor)

Author
GW
Date
09/2013
Parameters
array_Existing ArrayPref object

◆ ArrayPref() [2/2]

hdi::core::ArrayPref::ArrayPref ( const PrefDataVector *  elements_ = NULL,
const std::string &  name_ = "" 
)

Constructs an ArrayPref object, with new data, to be added to a container at a later time.

Author
GW
Date
09/2013
Parameters
elements_Initial array elements, if any
name_Name for the data array once it has been added to its container, as UTF-8
Note
The name_ argument can only be "" (omitted) if the object will be added directly to another ArrayPref object.

◆ ~ArrayPref()

virtual hdi::core::ArrayPref::~ArrayPref ( )
virtual

Destructs an ArrayPref object.

Author
GW
Date
09/2013

Member Function Documentation

◆ clear()

virtual void hdi::core::ArrayPref::clear ( )
virtual

Removes all elements from an array.

Author
GW
Date
09/2013

◆ clone()

virtual ArrayPref * hdi::core::ArrayPref::clone ( ) const
virtual

Convenience method to clone an ArrayPref object on the heap.

Author
GW
Date
10/2013
Returns
A pointer to the new ArrayPref object
Note
If you subclass ArrayPref, you MUST overload this method yourself! If you don't and/or your clone() method does not return an instance of your ArrayPref subclass, you will experience "object slicing" when adding the pref to a container.
Warning
The caller must manage the memory for the returned ArrayPref object.

Implements hdi::core::PrefData.

◆ count()

virtual uint32_t hdi::core::ArrayPref::count ( ) const
virtual

Gets the count of elements in the top-level of the array.

Author
GW
Date
09/2013
Returns
Number of elements in the array

◆ element()

virtual bool hdi::core::ArrayPref::element ( const uint32_t  index_,
std::unique_ptr< PrefData > &  data__ 
) const
virtual

Gets a single element object from the array data tree.

Author
GW
Date
09/2013
Parameters
index_Index of the element to get from the top-level of the array data tree
data__Return-by-reference for the element found at the given index
Returns
true if the element could be acquired, false otherwise
Note
The type of the returned object can be determined from its dataType() method, such that correct casting can be accomplished.

◆ getArrayElement()

virtual bool hdi::core::ArrayPref::getArrayElement ( const uint32_t  index_,
ArrayPref array__ 
) const
virtual

Gets a persistent array object from the containing array.

Author
GW
Date
09/2013
Parameters
index_Index of the array JSON node to get from the top-level and return as a neatly-packed persistent data type
array__Return-by-reference for the array element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getArtboardPointElement()

virtual bool hdi::core::ArrayPref::getArtboardPointElement ( const uint32_t  index_,
ArtboardPointPref abp__ 
) const
virtual

Gets a persistent point object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the artboard point JSON node to get from the top-level and return as a neatly-packed persistent data type
abp__Return-by-reference for the artboard point element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getArtboardRectElement()

virtual bool hdi::core::ArrayPref::getArtboardRectElement ( const uint32_t  index_,
ArtboardRectPref abr__ 
) const
virtual

Gets a persistent artboard rect object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the artboard rect JSON node to get from the top-level and return as a neatly-packed persistent data type
abr__Return-by-reference for the artboard rect element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getArtColorElement()

virtual bool hdi::core::ArrayPref::getArtColorElement ( const uint32_t  index_,
ArtColorPref ac__ 
) const
virtual

Gets a persistent art color object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the art color JSON node to get from the top-level and return as a neatly- packed persistent data type
ac__Return-by-reference for the art color element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getBoolElement()

virtual bool hdi::core::ArrayPref::getBoolElement ( const uint32_t  index_,
BoolPref b__ 
) const
virtual

Gets a persistent bool object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the bool JSON node to get from the top-level and return as a neatly- packed persistent data type
b__Return-by-reference for the bool element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getColorElement()

virtual bool hdi::core::ArrayPref::getColorElement ( const uint32_t  index_,
ColorPref c__ 
) const
virtual

Gets a persistent color object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the color JSON node to get from the top-level and return as a neatly- packed persistent data type
c__Return-by-reference for the color element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getDashStyleElement()

virtual bool hdi::core::ArrayPref::getDashStyleElement ( const uint32_t  index_,
DashStylePref ds__ 
)
virtual

Gets a persistent dash style object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the dash style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the dash style element identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getDashStyleMapElement()

virtual bool hdi::core::ArrayPref::getDashStyleMapElement ( const uint32_t  index_,
DashStyleMapPref ds__ 
)
virtual

Gets a persistent dash style map object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the dash style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the dash style map member identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getDictElement()

virtual bool hdi::core::ArrayPref::getDictElement ( const uint32_t  index_,
DictionaryPref dict__ 
) const
virtual

Gets a persistent dictionary object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the dictionary JSON node to get from the top-level and return as a neatly-packed persistent data type
dict__Return-by-reference for the dictionary element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getFillStyleElement()

virtual bool hdi::core::ArrayPref::getFillStyleElement ( const uint32_t  index_,
FillStylePref fs__ 
)
virtual

Gets a persistent fill style object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the fill style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the fill style element identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getFillStyleMapElement()

virtual bool hdi::core::ArrayPref::getFillStyleMapElement ( const uint32_t  index_,
FillStyleMapPref fs__ 
)
virtual

Gets a persistent fill style map object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the fill style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the fill style map member identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getFontElement()

virtual bool hdi::core::ArrayPref::getFontElement ( const uint32_t  index_,
FontPref font__ 
) const
virtual

Gets a persistent font object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the font JSON node to get from the top-level and return as a neatly- packed persistent data type
font__Return-by-reference for the font element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getNumberElement()

virtual bool hdi::core::ArrayPref::getNumberElement ( const uint32_t  index_,
NumberPref n__ 
) const
virtual

Gets a persistent number object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the number JSON node to get from the top-level and return as a neatly- packed persistent data type
n__Return-by-reference for the number element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getOrCreateArrayElement()

virtual bool hdi::core::ArrayPref::getOrCreateArrayElement ( const uint32_t  index_,
const PrefDataVector *  elements_,
ArrayPref array__ 
)
virtual

Similar to getArrayElement(), except that, if the element does not already exist, it will be created anew with a series of default elements.

Author
GW
Date
09/2013
Parameters
index_Index of the array JSON node to get from the top-level and return
elements_Default elements for the array, in case it didn't already exist (NULL, or an empty vector, for none)
array__Return-by-reference for the array element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise
Note
The order of the default elements in the array will match that of the passed elements_ argument.

◆ getOrCreateArtboardPointElement()

virtual bool hdi::core::ArrayPref::getOrCreateArtboardPointElement ( const uint32_t  index_,
const ArtboardPoint default_,
ArtboardPointPref abp__ 
)
virtual

Similar to getArtboardPointElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the artboard point JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
abp__Return-by-reference for the artboard point element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateArtboardRectElement()

virtual bool hdi::core::ArrayPref::getOrCreateArtboardRectElement ( const uint32_t  index_,
const ArtboardRect default_,
ArtboardRectPref abr__ 
)
virtual

Similar to getArtboardRectElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the artboard rect JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
abr__Return-by-reference for the artboard rect element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateArtColorElement()

virtual bool hdi::core::ArrayPref::getOrCreateArtColorElement ( const uint32_t  index_,
const ArtColor default_,
ArtColorPref ac__ 
)
virtual

Similar to getArtColorElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the art color JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
ac__Return-by-reference for the art color element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateBoolElement()

virtual bool hdi::core::ArrayPref::getOrCreateBoolElement ( const uint32_t  index_,
const bool  default_,
BoolPref b__ 
)
virtual

Similar to getBoolElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the bool JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
b__Return-by-reference for the bool element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateColorElement()

virtual bool hdi::core::ArrayPref::getOrCreateColorElement ( const uint32_t  index_,
const Color default_,
ColorPref c__ 
)
virtual

Similar to getColorElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the color JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the color element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateDashStyleElement()

virtual bool hdi::core::ArrayPref::getOrCreateDashStyleElement ( const uint32_t  index_,
const DashStyle default_,
DashStylePref ds__ 
)
virtual

Similar to getDashStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the dash style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the dash style element identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateDashStyleMapElement()

virtual bool hdi::core::ArrayPref::getOrCreateDashStyleMapElement ( const uint32_t  index_,
const DashStyle::Map default_,
DashStyleMapPref ds__ 
)
virtual

Similar to getDashStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the dash style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the dash style map member identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateDictElement()

virtual bool hdi::core::ArrayPref::getOrCreateDictElement ( const uint32_t  index_,
const PrefDataVector *  members_,
DictionaryPref dict__ 
)
virtual

Similar to getDictElement(), except that, if the element does not already exist, it will be created anew with a series of default members.

Author
GW
Date
09/2013
Parameters
index_Index of the dictionary JSON node to get from the top-level and return
members_Default members for the dictionary, in case it didn't already exist (NULL, or an empty vector, for none)
dict__Return-by-reference for the dictionary element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise
Note
The names of the elements in the dictionary will match that of the individual members in the passed members_ argument.

◆ getOrCreateFillStyleElement()

virtual bool hdi::core::ArrayPref::getOrCreateFillStyleElement ( const uint32_t  index_,
const FillStyle default_,
FillStylePref fs__ 
)
virtual

Similar to getFillStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the fill style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the fill style element identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateFillStyleMapElement()

virtual bool hdi::core::ArrayPref::getOrCreateFillStyleMapElement ( const uint32_t  index_,
const FillStyle::Map default_,
FillStyleMapPref fs__ 
)
virtual

Similar to getFillStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the fill style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the fill style map member identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateFloatElement()

virtual bool hdi::core::ArrayPref::getOrCreateFloatElement ( const uint32_t  index_,
const double  default_,
NumberPref n__ 
)
virtual

Similar to getNumberElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the number JSON node to get from the top-level and return
default_Default double value for the element, in case it didn't already exist
n__Return-by-reference for the number element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateFontElement()

virtual bool hdi::core::ArrayPref::getOrCreateFontElement ( const uint32_t  index_,
const Font defaultFont_,
const double  defaultSize_,
FontPref font__ 
)
virtual

Similar to getFontElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the font JSON node to get from the top-level and return
defaultFont_Default font for the element, in case it didn't already exist
defaultSize_Default font size for the element, in case it didn't already exist
font__Return-by-reference for the font element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateIntElement()

virtual bool hdi::core::ArrayPref::getOrCreateIntElement ( const uint32_t  index_,
const int64_t  default_,
NumberPref n__ 
)
virtual

Similar to getNumberElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the number JSON node to get from the top-level and return
default_Default integer value for the element, in case it didn't already exist
n__Return-by-reference for the number element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreatePathStyleElement()

virtual bool hdi::core::ArrayPref::getOrCreatePathStyleElement ( const uint32_t  index_,
const PathStyle default_,
PathStylePref ps__ 
)
virtual

Similar to getPathStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the path style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the path style element identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreatePathStyleMapElement()

virtual bool hdi::core::ArrayPref::getOrCreatePathStyleMapElement ( const uint32_t  index_,
const PathStyle::Map default_,
PathStyleMapPref ps__ 
)
virtual

Similar to getPathStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the path style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the path style map member identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreatePointElement()

virtual bool hdi::core::ArrayPref::getOrCreatePointElement ( const uint32_t  index_,
const Point default_,
PointPref p__ 
)
virtual

Similar to getPointElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the point JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
p__Return-by-reference for the point element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateRectElement()

virtual bool hdi::core::ArrayPref::getOrCreateRectElement ( const uint32_t  index_,
const Rect default_,
RectPref r__ 
)
virtual

Similar to getRectElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the rect JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
r__Return-by-reference for the rect element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateSizeElement()

virtual bool hdi::core::ArrayPref::getOrCreateSizeElement ( const uint32_t  index_,
const Size default_,
SizePref s__ 
)
virtual

Similar to getSizeElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the size JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
s__Return-by-reference for the size element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateStringElement()

virtual bool hdi::core::ArrayPref::getOrCreateStringElement ( const uint32_t  index_,
const std::string &  default_,
StringPref str__ 
)
virtual

Similar to getStringElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the string JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist, as UTF-8
str__Return-by-reference for the string element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateStrokeStyleElement()

virtual bool hdi::core::ArrayPref::getOrCreateStrokeStyleElement ( const uint32_t  index_,
const StrokeStyle default_,
StrokeStylePref ss__ 
)
virtual

Similar to getStrokeStyleElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the stroke style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the stroke style element identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateStrokeStyleMapElement()

virtual bool hdi::core::ArrayPref::getOrCreateStrokeStyleMapElement ( const uint32_t  index_,
const StrokeStyle::Map default_,
StrokeStyleMapPref ss__ 
)
virtual

Similar to getStrokeStyleMapElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
11/2015
Parameters
key_UTF8 name/key of the stroke style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
default_Default value for the element, in case it didn't already exist
c__Return-by-reference for the stroke style map member identified by key_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getOrCreateTransformMatrixElement()

virtual bool hdi::core::ArrayPref::getOrCreateTransformMatrixElement ( const uint32_t  index_,
const TransformMatrix default_,
TransformMatrixPref tm__ 
)
virtual

Similar to getTransformMatrixElement(), except that, if the element does not already exist, it will be created anew with a default value.

Author
GW
Date
09/2013
Parameters
index_Index of the matrix JSON node to get from the top-level and return
default_Default value for the element, in case it didn't already exist
tm__Return-by-reference for the transformation matrix element located at index_ (or created anew)
Returns
true if the element could be acquired or created, false otherwise

◆ getPathStyleElement()

virtual bool hdi::core::ArrayPref::getPathStyleElement ( const uint32_t  index_,
PathStylePref ps__ 
)
virtual

Gets a persistent path style object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the path style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the path style element identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getPathStyleMapElement()

virtual bool hdi::core::ArrayPref::getPathStyleMapElement ( const uint32_t  index_,
PathStyleMapPref ps__ 
)
virtual

Gets a persistent path style map object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the path style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the path style map member identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getPointElement()

virtual bool hdi::core::ArrayPref::getPointElement ( const uint32_t  index_,
PointPref p__ 
) const
virtual

Gets a persistent point object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the point JSON node to get from the top-level and return as a neatly- packed persistent data type
p__Return-by-reference for the point element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getRectElement()

virtual bool hdi::core::ArrayPref::getRectElement ( const uint32_t  index_,
RectPref r__ 
) const
virtual

Gets a persistent rect object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the rect JSON node to get from the top-level and return as a neatly- packed persistent data type
r__Return-by-reference for the rect element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getSizeElement()

virtual bool hdi::core::ArrayPref::getSizeElement ( const uint32_t  index_,
SizePref s__ 
) const
virtual

Gets a persistent size object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the size JSON node to get from the top-level and return as a neatly- packed persistent data type
s__Return-by-reference for the size element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getStringElement()

virtual bool hdi::core::ArrayPref::getStringElement ( const uint32_t  index_,
StringPref str__ 
) const
virtual

Gets a persistent string object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the string JSON node to get from the top-level and return as a neatly- packed persistent data type
str__Return-by-reference for the string element located at index_
Returns
true if the element could be acquired, false otherwise

◆ getStrokeStyleElement()

virtual bool hdi::core::ArrayPref::getStrokeStyleElement ( const uint32_t  index_,
StrokeStylePref ss__ 
)
virtual

Gets a persistent stroke style object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the stroke style JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the stroke style element identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getStrokeStyleMapElement()

virtual bool hdi::core::ArrayPref::getStrokeStyleMapElement ( const uint32_t  index_,
StrokeStyleMapPref ss__ 
)
virtual

Gets a persistent stroke style map object from the dictionary.

Author
GW
Date
11/2015
Parameters
index_Index of the stroke style map JSON node to get from the top-level and return as a neatly-packed PrefData subclass
ds__Return-by-reference for the stroke style map member identified by key_
Returns
true if the element could be acquired, false otherwise

◆ getTransformMatrixElement()

virtual bool hdi::core::ArrayPref::getTransformMatrixElement ( const uint32_t  index_,
TransformMatrixPref tm__ 
) const
virtual

Gets a persistent matrix object from the array.

Author
GW
Date
09/2013
Parameters
index_Index of the matrix JSON node to get from the top-level and return as a neatly- packed persistent data type
tm__Return-by-reference for the transformation matrix element located at index_
Returns
true if the element could be acquired, false otherwise

◆ insertElement()

virtual bool hdi::core::ArrayPref::insertElement ( const uint32_t  index_,
const PrefData data_ 
)
virtual

Inserts a persistent data object at an arbitrary position in the array.

Author
GW
Date
09/2013
Parameters
index_Desired index for the new data element
data_New data element to insert in the array
Returns
true if the element was inserted successfully, or false otherwise
Note
Index_ must be in the range [0,n], where n is the count of objects already in the array.

◆ operator=()

virtual ArrayPref & hdi::core::ArrayPref::operator= ( const ArrayPref rhs_)
virtual

Allows one ArrayPref object to be assigned from another.

Author
GW
Date
09/2013
Parameters
rhs_Righthand side of the = operator; the object to copy values from
Returns
The target ArrayPref object, but with its value updated to match that of rhs_

◆ popElement()

virtual bool hdi::core::ArrayPref::popElement ( std::unique_ptr< PrefData > &  data__)
virtual

Removes a persistent data object from the end of the array.

Author
GW
Date
09/2013
Parameters
data__Return-by-reference for the PrefData object for the element that was removed
Returns
true if the element could be popped and acquired, false otherwise
Note
The type of the returned object can be determined from its dataType() method, such that correct casting can be accomplished.

◆ pushElement()

virtual bool hdi::core::ArrayPref::pushElement ( const PrefData data_)
virtual

Adds a persistent data object to the end of the array.

Author
GW
Date
09/2013
Parameters
data_New data element to add to the end of the array
Returns
true if the element was added, or false otherwise

◆ removeElement()

virtual bool hdi::core::ArrayPref::removeElement ( const uint32_t  index_,
std::unique_ptr< PrefData > &  data__ 
)
virtual

Removes a persistent data object from an arbitrary position in the array.

Author
GW
Date
09/2013
Parameters
index_Index of the desired data element to be removed
data__Return-by-reference for the PrefData object for the element that was removed
Returns
true if the element could be removed and acquired, false otherwise
Note
The type of the returned object can be determined from its dataType() method, such that correct casting can be accomplished.
Index_ must be in the range [0,n], where n is the count of objects already in the array.
All elements located after index_ will have their index decremented