HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_JSONValueArray Class Reference

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_JSONValueArraymakeUnique () 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_JSONValueoperator() (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_JSONValueoperator[] (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_JSONValueget (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_JSONValueArrayappendArrayChild ()
 Adds a new array child to this map. More...
 
UT_JSONValueMapappendMapChild ()
 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
 

Detailed Description

UT_JSONValueArray stores a list of UT_JSONValue objects.

UT_JSONValueArray stores a list of UT_JSONValue objects.

See Also
UT_JSONValue, UT_JSONValueMap
Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 34 of file UT_JSONValueArray.h.

Member Typedef Documentation

Constructor & Destructor Documentation

UT_JSONValueArray::UT_JSONValueArray ( )
UT_JSONValueArray::~UT_JSONValueArray ( )

Member Function Documentation

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.

const_iterator UT_JSONValueArray::begin ( void  ) const
inline

Definition at line 156 of file UT_JSONValueArray.h.

void UT_JSONValueArray::bumpRef ( int  d)
inline

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)

template<typename... ARGS>
AppendResult UT_JSONValueArray::emplace ( ARGS &&...  args)
inline

Emplace an element in the array.

Definition at line 127 of file UT_JSONValueArray.h.

const_iterator UT_JSONValueArray::end ( void  ) const
inline

Definition at line 157 of file UT_JSONValueArray.h.

SYS_FORCE_INLINE int64 UT_JSONValueArray::entries ( ) const
inline

Return the number of entries in the array.

Examples:
mocapstream/MocapStreamRokokoHDK.C.

Definition at line 69 of file UT_JSONValueArray.h.

SYS_FORCE_INLINE const UT_JSONValue* UT_JSONValueArray::get ( int64  i) const
inline

Access a const entry by index.

Definition at line 80 of file UT_JSONValueArray.h.

SYS_FORCE_INLINE UT_JSONValue* UT_JSONValueArray::get ( int64  i)
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.

Examples:
mocapstream/MocapStreamRokokoHDK.C.
SYS_NO_DISCARD_RESULT UT_JSONValueMap* UT_JSONValueArray::getObject ( int64  i)

Access an object by index.

SYS_FORCE_INLINE int UT_JSONValueArray::getRef ( ) const
inline

Get the number of references to this array.

Definition at line 46 of file UT_JSONValueArray.h.

SYS_HashType UT_JSONValueArray::hash ( ) const
bool UT_JSONValueArray::import ( int64 result,
int64  size 
) 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).

bool UT_JSONValueArray::import ( fpreal64 result,
int64  size 
) const

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).

bool UT_JSONValueArray::import ( UT_Array< int64 > &  array) const

Import an array of integer values (fails if the elements of the array cannot be interpreted as an integer).

bool UT_JSONValueArray::import ( UT_Array< fpreal64 > &  array) const

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).

bool UT_JSONValueArray::operator!= ( const UT_JSONValueArray arr) const
inline

Check equality

Definition at line 58 of file UT_JSONValueArray.h.

SYS_FORCE_INLINE const UT_JSONValue* UT_JSONValueArray::operator() ( int64  i) const
inline

Access a const entry by index.

Definition at line 71 of file UT_JSONValueArray.h.

SYS_FORCE_INLINE UT_JSONValue* UT_JSONValueArray::operator() ( int64  i)
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

SYS_FORCE_INLINE const UT_JSONValue* UT_JSONValueArray::operator[] ( int64  i) const
inline

Access a const entry by index.

Definition at line 75 of file UT_JSONValueArray.h.

SYS_FORCE_INLINE UT_JSONValue* UT_JSONValueArray::operator[] ( int64  i)
inline

Access an entry by index.

Definition at line 77 of file UT_JSONValueArray.h.

void UT_JSONValueArray::remove ( int64  index)

Remove and delete an element by index.

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.

SYS_FORCE_INLINE int64 UT_JSONValueArray::size ( void  ) const
inline

Return size of the array.

Definition at line 67 of file UT_JSONValueArray.h.


The documentation for this class was generated from the following file: