HDK
|
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects. More...
#include <UT_JSONValueMap.h>
Classes | |
class | iterator |
Public Types | |
using | const_iterator = const iterator |
Friends | |
class | iterator |
UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.
UT_JSONValueMap stores a map of UT_JSONValue objects. Unlike a standard Houdini UT_StringMap, this object maintains the sort order in which objects were added.
Definition at line 44 of file UT_JSONValueMap.h.
Definition at line 248 of file UT_JSONValueMap.h.
UT_JSONValueMap::UT_JSONValueMap | ( | ) |
UT_JSONValueMap::~UT_JSONValueMap | ( | ) |
UT_JSONValueArray* UT_JSONValueMap::addArrayChild | ( | const UT_StringHolder & | map_key | ) |
Adds a new array child to this map.
UT_JSONValueMap* UT_JSONValueMap::addMapChild | ( | const UT_StringHolder & | map_key | ) |
Adds a new map child to this map.
int64 UT_JSONValueMap::append | ( | const UT_StringHolder & | key, |
UT_JSONValue * | v | ||
) |
Add key/value pair to the map. If the key already exists, the previous value will be deleted.
Definition at line 246 of file UT_JSONValueMap.h.
Reference count (for shared maps).
Definition at line 50 of file UT_JSONValueMap.h.
void UT_JSONValueMap::clear | ( | ) |
Clear the entries in the map.
void UT_JSONValueMap::dump | ( | ) | const |
Dump to stdout (same as save to std::cout)
Definition at line 247 of file UT_JSONValueMap.h.
|
inline |
Return the number of entries in the map.
Definition at line 74 of file UT_JSONValueMap.h.
|
inline |
Access a const entry by index.
Definition at line 107 of file UT_JSONValueMap.h.
|
inline |
Access an entry by index.
Definition at line 110 of file UT_JSONValueMap.h.
SYS_NO_DISCARD_RESULT const UT_JSONValue* UT_JSONValueMap::get | ( | const UT_StringRef & | k | ) | const |
Access const entry by name (may be NULL pointer if k is not a key)
SYS_NO_DISCARD_RESULT UT_JSONValue* UT_JSONValueMap::get | ( | const UT_StringRef & | k | ) |
Access entry by name (may be NULL pointer if k is not a key)
SYS_NO_DISCARD_RESULT int32 UT_JSONValueMap::get | ( | const UT_StringRef & | key, |
int32 | def_value | ||
) | const |
Access entry by name. If not found the default value is returned.
SYS_NO_DISCARD_RESULT int64 UT_JSONValueMap::get | ( | const UT_StringRef & | key, |
int64 | def_value | ||
) | const |
Access entry by name. If not found the default value is returned.
SYS_NO_DISCARD_RESULT UT_StringHolder UT_JSONValueMap::get | ( | const UT_StringRef & | key, |
const UT_StringRef & | def_value | ||
) | const |
Access entry by name. If not found the default value is returned.
SYS_NO_DISCARD_RESULT UT_StringArray UT_JSONValueMap::get | ( | const UT_StringRef & | key, |
const UT_StringArray & | def_value | ||
) | const |
Access entry by name. If not found the default value is returned.
SYS_NO_DISCARD_RESULT const UT_JSONValueArray* UT_JSONValueMap::getArray | ( | const UT_StringRef & | k | ) | const |
Access const array entry by name (may be NULL pointer if k is not a key) This is a convenience function to get() if we know the key is an array.
SYS_NO_DISCARD_RESULT UT_JSONValueArray* UT_JSONValueMap::getArray | ( | const UT_StringRef & | k | ) |
Access array entry by name (may be NULL pointer if k is not a key) This is a convenience function to get() if we know the key is an array.
|
inline |
Access entry by name. If not found a json value exception is thrown.
Definition at line 127 of file UT_JSONValueMap.h.
int64 UT_JSONValueMap::getKeyReferences | ( | UT_StringArray & | keys | ) | const |
Get a list of the keys. However, rather than duplicating the string values, this method simply keeps shallow references. While it's more efficient, it's also relies on the fact that the map will not change while the string array exists.
int64 UT_JSONValueMap::getKeys | ( | UT_StringArray & | keys | ) | const |
Get the list of keys.
SYS_NO_DISCARD_RESULT const UT_JSONValueMap* UT_JSONValueMap::getObject | ( | const UT_StringRef & | k | ) | const |
Access const object entry by name (may be NULL pointer if k is not a key) This is a convenience function to get() if we know the key is an object.
SYS_NO_DISCARD_RESULT UT_JSONValueMap* UT_JSONValueMap::getObject | ( | const UT_StringRef & | k | ) |
Access object entry by name (may be NULL pointer if k is not a key) This is a convenience function to get() if we know the key is an object.
|
inline |
Get the number of references to this map.
Definition at line 56 of file UT_JSONValueMap.h.
SYS_NO_DISCARD_RESULT SYS_HashType UT_JSONValueMap::hash | ( | ) | const |
bool UT_JSONValueMap::import | ( | const UT_StringRef & | key, |
T & | result | ||
) | const |
Key/Value imports. See UT_JSONValue for all available import types. Returns false if the key isn't in the map, or if the import from the UT_JSONValue fails.
|
inline |
Check equality
Definition at line 180 of file UT_JSONValueMap.h.
|
inline |
Access const entry by index.
Definition at line 81 of file UT_JSONValueMap.h.
|
inline |
Access entry by index.
Definition at line 84 of file UT_JSONValueMap.h.
|
inline |
Access const entry by name (may be NULL pointer if k is not a key)
Definition at line 87 of file UT_JSONValueMap.h.
|
inline |
Access entry by name (may be NULL pointer if k is not a key)
Definition at line 90 of file UT_JSONValueMap.h.
SYS_NO_DISCARD_RESULT bool UT_JSONValueMap::operator== | ( | const UT_JSONValueMap & | arr | ) | const |
Check equality
|
inline |
Access const entry by index.
Definition at line 94 of file UT_JSONValueMap.h.
|
inline |
Access entry by index.
Definition at line 97 of file UT_JSONValueMap.h.
|
inline |
Access const entry by name (may be NULL pointer if k is not a key)
Definition at line 100 of file UT_JSONValueMap.h.
|
inline |
Access entry by name (may be NULL pointer if k is not a key)
Definition at line 103 of file UT_JSONValueMap.h.
void UT_JSONValueMap::remove | ( | const UT_StringHolder & | key | ) |
Remove key/value pair from the map. Do nothing if the key does not exist.
void UT_JSONValueMap::rename | ( | const UT_StringHolder & | old_key, |
const UT_StringHolder & | new_key | ||
) |
Rename a key in the map. Do nothing if the old key does not exist. If the old key exists and another entry uses the new key then remove the other entry and rename the entry with the old key.
bool UT_JSONValueMap::save | ( | UT_JSONWriter & | os | ) | const |
Save to an output stream.
Definition at line 262 of file UT_JSONValueMap.h.