HDK
|
UT_JSONValueArray stores a list of UT_JSONValue objects. More...
#include <UT_JSONValueArray.h>
Classes | |
struct | AppendResult |
Public Types | |
using | const_iterator = UT_Array< UT_JSONValue * >::const_iterator |
Public Member Functions | |
UT_JSONValueArray () | |
~UT_JSONValueArray () | |
void | bumpRef (int d) |
Reference count (for shared arrays). More... | |
SYS_FORCE_INLINE int | getRef () const |
Get the number of references to this array. More... | |
bool | save (UT_JSONWriter &os) const |
Save to an output stream. More... | |
void | dump () const |
Dump to stdout (same as save to std::cout) More... | |
SYS_HashType | hash () const |
UT_JSONValueArray * | makeUnique () const |
SYS_FORCE_INLINE int64 | size () const |
Return size of the array. More... | |
SYS_FORCE_INLINE int64 | entries () const |
Return the number of entries in the array. More... | |
SYS_FORCE_INLINE const UT_JSONValue * | operator() (int64 i) const |
Access a const entry by index. More... | |
SYS_FORCE_INLINE UT_JSONValue * | operator() (int64 i) |
Access an entry by index. More... | |
SYS_FORCE_INLINE const UT_JSONValue * | operator[] (int64 i) const |
Access a const entry by index. More... | |
SYS_FORCE_INLINE UT_JSONValue * | operator[] (int64 i) |
Access an entry by index. More... | |
SYS_FORCE_INLINE const UT_JSONValue * | get (int64 i) const |
Access a const entry by index. More... | |
SYS_FORCE_INLINE UT_JSONValue * | get (int64 i) |
Access an entry by index. More... | |
SYS_NO_DISCARD_RESULT const UT_JSONValueMap * | getObject (int64 i) const |
Access a const object by index. More... | |
SYS_NO_DISCARD_RESULT UT_JSONValueMap * | getObject (int64 i) |
Access an object by index. More... | |
SYS_NO_DISCARD_RESULT const UT_JSONValueArray * | getArray (int64 i) const |
Access a const array by index. More... | |
SYS_NO_DISCARD_RESULT UT_JSONValueArray * | getArray (int64 i) |
Access an array by index. More... | |
bool | import (int64 *result, int64 size) const |
bool | import (fpreal64 *result, int64 size) const |
bool | import (UT_Array< int64 > &array) const |
bool | import (UT_Array< fpreal64 > &array) const |
bool | import (UT_StringArray &array) const |
AppendResult | append (const UT_JSONValue &v) |
Add an element to the array. More... | |
template<typename... ARGS> | |
AppendResult | emplace (ARGS &&...args) |
Emplace an element in the array. More... | |
void | remove (int64 index) |
Remove and delete an element by index. More... | |
void | remove (const UT_JSONFindResult &v) |
Remove and delete an element. More... | |
void | removeLast () |
Remove and delete the last added element. More... | |
void | clear () |
Remove and delete all elements. More... | |
AppendResult | insertBefore (const UT_JSONValue &v, const UT_JSONFindResult &after_value) |
Inserts a value v before the given element after_value. More... | |
UT_JSONValueArray * | appendArrayChild () |
Adds a new array child to this map. More... | |
UT_JSONValueMap * | appendMapChild () |
Adds a new map child to this map. More... | |
const_iterator | begin () const |
const_iterator | end () const |
bool | operator== (const UT_JSONValueArray &arr) const |
bool | operator!= (const UT_JSONValueArray &arr) const |
UT_JSONValueArray stores a list of UT_JSONValue objects.
UT_JSONValueArray stores a list of UT_JSONValue objects.
Definition at line 34 of file UT_JSONValueArray.h.
Definition at line 155 of file UT_JSONValueArray.h.
UT_JSONValueArray::UT_JSONValueArray | ( | ) |
UT_JSONValueArray::~UT_JSONValueArray | ( | ) |
AppendResult UT_JSONValueArray::append | ( | const UT_JSONValue & | v | ) |
Add an element to the array.
UT_JSONValueArray* UT_JSONValueArray::appendArrayChild | ( | ) |
Adds a new array child to this map.
UT_JSONValueMap* UT_JSONValueArray::appendMapChild | ( | ) |
Adds a new map child to this map.
|
inline |
Definition at line 156 of file UT_JSONValueArray.h.
Reference count (for shared arrays).
Definition at line 40 of file UT_JSONValueArray.h.
void UT_JSONValueArray::clear | ( | ) |
Remove and delete all elements.
void UT_JSONValueArray::dump | ( | ) | const |
Dump to stdout (same as save to std::cout)
|
inline |
Emplace an element in the array.
Definition at line 127 of file UT_JSONValueArray.h.
|
inline |
Definition at line 157 of file UT_JSONValueArray.h.
|
inline |
Return the number of entries in the array.
Definition at line 69 of file UT_JSONValueArray.h.
|
inline |
Access a const entry by index.
Definition at line 80 of file UT_JSONValueArray.h.
|
inline |
Access an entry by index.
Definition at line 82 of file UT_JSONValueArray.h.
SYS_NO_DISCARD_RESULT const UT_JSONValueArray* UT_JSONValueArray::getArray | ( | int64 | i | ) | const |
Access a const array by index.
SYS_NO_DISCARD_RESULT UT_JSONValueArray* UT_JSONValueArray::getArray | ( | int64 | i | ) |
Access an array by index.
SYS_NO_DISCARD_RESULT const UT_JSONValueMap* UT_JSONValueArray::getObject | ( | int64 | i | ) | const |
Access a const object by index.
SYS_NO_DISCARD_RESULT UT_JSONValueMap* UT_JSONValueArray::getObject | ( | int64 | i | ) |
Access an object by index.
|
inline |
Get the number of references to this array.
Definition at line 46 of file UT_JSONValueArray.h.
SYS_HashType UT_JSONValueArray::hash | ( | ) | const |
Import an array of integer values (fails if the array size is too small or if one of the elements of the array cannot be interpreted as an integer).
Import an array of float values (fails if the array size is too small or if one of the elements of the array cannot be interpreted as an integer).
Import an array of integer values (fails if the elements of the array cannot be interpreted as an integer).
Import an array of real values (fails if the elements of the array cannot be interpreted as such).
bool UT_JSONValueArray::import | ( | UT_StringArray & | array | ) | const |
Import an array of string values (fails if the elements of the array cannot be interpreted as such).
AppendResult UT_JSONValueArray::insertBefore | ( | const UT_JSONValue & | v, |
const UT_JSONFindResult & | after_value | ||
) |
Inserts a value v before the given element after_value.
UT_JSONValueArray* UT_JSONValueArray::makeUnique | ( | ) | const |
Arrays are typically stored as shared pointers. This method will make a unique copy. May return "this" (if the reference count is already unique).
|
inline |
Check equality
Definition at line 58 of file UT_JSONValueArray.h.
|
inline |
Access a const entry by index.
Definition at line 71 of file UT_JSONValueArray.h.
|
inline |
Access an entry by index.
Definition at line 73 of file UT_JSONValueArray.h.
bool UT_JSONValueArray::operator== | ( | const UT_JSONValueArray & | arr | ) | const |
Check equality
|
inline |
Access a const entry by index.
Definition at line 75 of file UT_JSONValueArray.h.
|
inline |
Access an entry by index.
Definition at line 77 of file UT_JSONValueArray.h.
void UT_JSONValueArray::remove | ( | const UT_JSONFindResult & | v | ) |
Remove and delete an element.
void UT_JSONValueArray::removeLast | ( | ) |
Remove and delete the last added element.
bool UT_JSONValueArray::save | ( | UT_JSONWriter & | os | ) | const |
Save to an output stream.
|
inline |
Return size of the array.
Definition at line 67 of file UT_JSONValueArray.h.