Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
|
Base class for persistent data objects, stored via JSON. More...
#include <hdicorePrefData.h>
Public Types | |
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 | |
PrefData () | |
Constructs an empty PrefData object. | |
virtual | ~PrefData () |
Destructs a PrefData object. | |
virtual PrefData & | operator= (const PrefData &rhs_) |
Allows one PrefData object to be assigned from another. | |
virtual PrefData * | clone () 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. | |
Static Public Member Functions | |
static std::unique_ptr< PrefData > | parse (const std::string &jsonStr_) |
Parses the given JSON string to a best-fit representation of PrefData subclass objects in a tree. | |
Protected Member Functions | |
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 | |
void * | _data |
Private implementation data. | |
Friends | |
plat::PersistentData * | __accessImpl (const PrefData &) |
PrefData * | __accessCtor (plat::PersistentData *&) |
Base class for persistent data objects, stored via JSON.
hdi::core::PrefData::PrefData | ( | ) |
Constructs an empty PrefData object.
|
virtual |
Destructs a PrefData object.
|
protected |
Internal use only.
|
protected |
|
protected |
Internal use only.
|
pure virtual |
Convenience method to clone a PrefData object, taking its subclass type into account for proper memory management.
Implemented in hdi::core::ArrayPref, hdi::core::ArtboardPointPref, hdi::core::ArtboardRectPref, hdi::core::ArtColorPref, hdi::core::BoolPref, hdi::core::ColorPref, hdi::core::DashStyleMapPref, hdi::core::DashStylePref, hdi::core::DictionaryPref, hdi::core::FillStyleMapPref, hdi::core::FillStylePref, hdi::core::FontPref, hdi::core::NumberPref, hdi::core::PathStyleMapPref, hdi::core::PathStylePref, hdi::core::PointPref, hdi::core::RectPref, hdi::core::SizePref, hdi::core::StringPref, hdi::core::StrokeStyleMapPref, hdi::core::StrokeStylePref, and hdi::core::TransformMatrixPref.
|
virtual |
Gets the type of persistent data.
Reimplemented in hdi::core::DashStyleMapPref, hdi::core::DashStylePref, hdi::core::FillStyleMapPref, hdi::core::FillStylePref, hdi::core::PathStyleMapPref, hdi::core::PathStylePref, hdi::core::StrokeStyleMapPref, and hdi::core::StrokeStylePref.
|
virtual |
|
virtual |
Gets the persistent data object's key.
|
virtual |
Tests whether a given PrefData object is not the same as another.
rhs_ | PrefData to compare against (righthand side of inequality operator) |
Allows one PrefData object to be assigned from another.
rhs_ | Righthand side of the = operator; the object to copy values from |
|
virtual |
Tests whether a given PrefData object is the same as another.
rhs_ | PrefData to compare against (righthand side of equality operator) |
|
static |
|
virtual |
Sets the persistent data object's key.
key_ | New key/name for the object, as UTF-8 |
|
virtual |
Recursively serializes the target object as a JSON data (sub)tree, returning the appropriate JSON string.