![]() |
pCon.planner Plugin SDK
Version 8.9
|
A dictionary stores arbitrary data as key value pairs. More...
Public Types | |
enum | ValueType { ValueType::Undefined, ValueType::Boolean, ValueType::Integer, ValueType::Double, ValueType::String, ValueType::Vec2d, ValueType::Vec3d, ValueType::ByteArray, ValueType::Dictionary, ValueType::EntityRef } |
Determines the type of a value in a dictionary. More... | |
Public Member Functions | |
bool | Has (System::String^ pKey) |
Returns if the dictionary contains a value with the given key. More... | |
void | Delete (System::String^ pKey) |
Deletes entry with given key from dictionary. More... | |
void | Clear () |
Deletes all entries from dictionary. More... | |
bool | Get (System::String^ pKey,[Out] System::String^ %pValue) |
Get string with given key. More... | |
void | Set (System::String^ pKey, System::String^ pValue) |
Set string with given key. More... | |
bool | Get (System::String^ pKey,[Out] array< unsigned char >^%pData) |
Get binary data with given key. More... | |
void | Set (System::String^ pKey, array< unsigned char >^pData) |
Set binary data with given key. More... | |
bool | Get (System::String^ pKey,[Out] bool% pValue) |
Get boolean value with given key. More... | |
void | Set (System::String^ pKey, bool pValue) |
Set boolean value with given key. More... | |
bool | Get (System::String^ pKey,[Out] int% pValue) |
Get integer value with given key. More... | |
void | Set (System::String^ pKey, int pValue) |
Set integer value with given key. More... | |
bool | Get (System::String^ pKey,[Out] System::Drawing::Color% pValue) |
Get color with given key. More... | |
void | Set (System::String^ pKey, System::Drawing::Color pValue) |
Set color with given key. More... | |
bool | Get (System::String^ pKey,[Out] double% pValue) |
Get double value with given key. More... | |
void | Set (System::String^ pKey, double pValue) |
Set double value with given key. More... | |
bool | Get (System::String^ pKey,[Out] GeVec2d% pValue) |
Get 2d vector with given key. More... | |
void | Set (System::String^ pKey, GeVec2d pValue) |
Set 2d vector with given key. More... | |
bool | Get (System::String^ pKey,[Out] GeVec3d% pValue) |
Get 3d vector with given key. More... | |
void | Set (System::String^ pKey, GeVec3d pValue) |
Set 3d vector with given key. More... | |
bool | Get (System::String^ pKey,[Out] DbEntity^ %pEntityRef) |
Returns entity reference with given key. More... | |
void | Set (System::String^ pKey, DbEntity^ pEntityRef) |
Sets entity reference with given key. More... | |
bool | Get (System::String^ pKey,[Out] IList< DbEntity^ >^%pEntityRefs) |
Returns an array of entity references with given key. More... | |
void | Set (System::String^ pKey, IEnumerable< DbEntity^ >^pEntityRefs) |
Sets a collection of entity references with given key. More... | |
DbDictionary^ | GetDictionary (System::String^ pKey, bool pCreate) |
Returns subsidiary dictionary with given key. More... | |
IList< System::String^ >^ | GetAllKeys () |
Returns keys of all entries in this dictionary. More... | |
ValueType | GetValueType (System::String^ pKey) |
Returns the value type of an entry. More... | |
void | CopyFrom (DbDictionary^ pOther, bool pOverwrite) |
Copies all entries from other dictionary to this dictionary. More... | |
A dictionary stores arbitrary data as key value pairs.
Keys are unique within a dictionary.
|
strong |
Determines the type of a value in a dictionary.
Enumerator | |
---|---|
Undefined |
value type is undefined |
Boolean |
value is of type boolean |
Integer |
value is a 32bit integer |
Double |
value is of type double |
String |
value is of type string |
Vec2d |
value is of type GeVec2d |
Vec3d |
value is of type GeVec3d |
ByteArray |
value is a byte array |
Dictionary |
value is a subsidiary dictionary |
EntityRef |
value is of type DbEntity |
void X3g::Plugin::DbDictionary::Clear | ( | ) |
Deletes all entries from dictionary.
void X3g::Plugin::DbDictionary::CopyFrom | ( | DbDictionary^ | pOther, |
bool | pOverwrite | ||
) |
Copies all entries from other dictionary to this dictionary.
pOverwrite determines if existing values should be overwritten.
Note that CopyFrom doesn't delete any entries. So if you want to replace the whole content of a dictionary you may have to clear it first. Entries from subsidiary dictionaries are also copied by the same rules.
void X3g::Plugin::DbDictionary::Delete | ( | System::String^ | pKey) |
Deletes entry with given key from dictionary.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] System::String^ % | pValue | ||
) |
Get string with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] array< unsigned char >^% | pData | ||
) |
Get binary data with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] bool% | pValue | ||
) |
Get boolean value with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] int% | pValue | ||
) |
Get integer value with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] System::Drawing::Color% | pValue | ||
) |
Get color with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] double% | pValue | ||
) |
Get double value with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] GeVec2d% | pValue | ||
) |
Get 2d vector with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] GeVec3d% | pValue | ||
) |
Get 3d vector with given key.
Returns false if the value doesn't exist.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] DbEntity^ % | pEntityRef | ||
) |
Returns entity reference with given key.
Null if entity no longer exists.
bool X3g::Plugin::DbDictionary::Get | ( | System::String^ | pKey, |
[Out] IList< DbEntity^ >^% | pEntityRefs | ||
) |
Returns an array of entity references with given key.
IList< System::String^ > X3g::Plugin::DbDictionary::GetAllKeys | ( | ) |
Returns keys of all entries in this dictionary.
DbDictionary X3g::Plugin::DbDictionary::GetDictionary | ( | System::String^ | pKey, |
bool | pCreate | ||
) |
Returns subsidiary dictionary with given key.
Allows to create dictionary if it doesn't exist.
DbDictionary::ValueType X3g::Plugin::DbDictionary::GetValueType | ( | System::String^ | pKey) |
Returns the value type of an entry.
Returns ValueType::Undefined if value doesn't exist.
bool X3g::Plugin::DbDictionary::Has | ( | System::String^ | pKey) |
Returns if the dictionary contains a value with the given key.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
System::String^ | pValue | ||
) |
Set string with given key.
Overwrites existing values.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
array< unsigned char >^ | pData | ||
) |
Set binary data with given key.
Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
bool | pValue | ||
) |
Set boolean value with given key.
Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
int | pValue | ||
) |
Set integer value with given key.
Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
System::Drawing::Color | pValue | ||
) |
Set color with given key.
Color is stored as 32bit integer. Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
double | pValue | ||
) |
Set double value with given key.
Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
GeVec2d | pValue | ||
) |
Set 2d vector with given key.
Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
GeVec3d | pValue | ||
) |
Set 3d vector with given key.
Overwrites existing value.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
DbEntity^ | pEntityRef | ||
) |
Sets entity reference with given key.
Overwrites existing reference.
The dictionary doesn't take ownership of the entity but keeps a reference only. The stored reference will automatically be nulled if referenced entity is erased.
void X3g::Plugin::DbDictionary::Set | ( | System::String^ | pKey, |
IEnumerable< DbEntity^ >^ | pEntityRefs | ||
) |
Sets a collection of entity references with given key.
Overwrites existing references.
The dictionary doesn't take ownership of the entities but keeps references only. The stored references will automatically be nulled if referenced entities are erased.