9 #ifndef __PDG_ATTRIBUTE_PRIMITIVE_H__
10 #define __PDG_ATTRIBUTE_PRIMITIVE_H__
50 int64 mem = inclusive ?
sizeof(*this) : 0;
51 mem += getDataMemory(Base::myData);
58 return new Self(Base::myData);
74 saveOption(key, Base::myData, edit);
82 if (!value.
import(json_type))
84 for (
auto&& entry: json_type)
85 Base::myData.
append(entry);
94 return dict->importOption(key, Base::myData);
102 return UTarrayDeepMemoryUsage(data,
false);
106 template <
typename T>
113 static void saveOption(
121 static void saveOption(
129 static void saveOption(
bool jsonValue(bool value)
int64 getMemoryUsage(bool inclusive) const override
Returns the total memory usage of the underlying array data.
int64 getMemoryUsage(bool inclusive=false) const
bool loadData(const UT_JSONValue &value) override
Reads array data from the json value.
Class which writes ASCII or binary JSON streams.
bool loadData(const UT_StringHolder &key, const UT_OptionsHolder &dict) override
Reads array data from a dict.
UT_Options & setOptionIArray(const UT_StringHolder &name, const int32 *values, size_t size)
UT_Options & setOptionSArray(const UT_StringHolder &name, const UT_StringHolder *values, size_t size)
Set string array options.
bool saveData(UT_JSONWriter &writer) const override
Saves the array data to the specified json writer.
void update(const OP &op)
PDG_AttributeType
Enumeration of possible attribute types.
An array of UT_StringHolder values.
void saveData(const UT_StringHolder &key, UT_OptionsHolder &dict) const override
Saves the array data to the specified options.
An array of fpreal values.
A map of string to various well defined value types.
SYS_FORCE_INLINE bool import(bool &result) const
Extract a bool (returns false if type is invalid)
PDG_AttributeData * clone() const override
Constructs a new attribue that's copied from this one.
Class to store JSON objects as C++ objects.
PDG_AttributeArray< AttribType, DataType, ArrayType > Self
UT_Options & setOptionFArray(const UT_StringHolder &name, const fpreal32 *values, size_t size)
~PDG_AttributePrimitive() override