UT_JSONValueMap Class Reference

UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects. More...

#include <UT_JSONValueMap.h>

List of all members.

Public Member Functions

 UT_JSONValueMap ()
 ~UT_JSONValueMap ()
void bumpRef (int d)
 Reference count (for shared maps).
int getRef () const
 Get the number of references to this map.
bool save (UT_JSONWriter &os) const
 Save to an output stream.
int64 getKeys (UT_StringArray &keys) const
 Get the list of keys.
int64 getKeyReferences (UT_StringArray &keys) const
int64 entries () const
 Return the number of entries in the map.
const UT_JSONValueoperator() (int64 i) const
 Access const entry by index.
UT_JSONValueoperator() (int64 i)
 Access entry by index.
const UT_JSONValueoperator() (const char *k) const
 Access const entry by name (may be NULL pointer if k is not a key).
UT_JSONValueoperator() (const char *k)
 Access entry by name (may be NULL pointer if k is not a key).
const UT_JSONValueoperator[] (int64 i) const
 Access const entry by index.
UT_JSONValueoperator[] (int64 i)
 Access entry by index.
const UT_JSONValueoperator[] (const char *k) const
 Access const entry by name (may be NULL pointer if k is not a key).
UT_JSONValueoperator[] (const char *k)
 Access entry by name (may be NULL pointer if k is not a key).
const UT_JSONValueget (int64 i) const
 Access a const entry by index.
UT_JSONValueget (int64 i)
 Access an entry by index.
const UT_JSONValueget (const char *k) const
 Access const entry by name (may be NULL pointer if k is not a key).
UT_JSONValueget (const char *k)
 Access entry by name (may be NULL pointer if k is not a key).
int64 append (const char *key, UT_JSONValue *v)


Detailed Description

UT_JSONValueMap stores a map/dictionary of UT_JSONValue objects.

UT_JSONValueMap stores a map of UT_JSONValue objects. Unlike a standard Houdini UT_SymbolTable, this object maintains the sort order in which objects were added.

See also:
UT_JSONValue, UT_JSONValueArray

Definition at line 38 of file UT_JSONValueMap.h.


Constructor & Destructor Documentation

UT_JSONValueMap::UT_JSONValueMap (  ) 

UT_JSONValueMap::~UT_JSONValueMap (  ) 


Member Function Documentation

int64 UT_JSONValueMap::append ( const char *  key,
UT_JSONValue v 
)

Add key/value pair to the map. If the key already exists, the previous value will be deleted.

void UT_JSONValueMap::bumpRef ( int  d  )  [inline]

Reference count (for shared maps).

Definition at line 44 of file UT_JSONValueMap.h.

int64 UT_JSONValueMap::entries ( void   )  const [inline]

Return the number of entries in the map.

Definition at line 65 of file UT_JSONValueMap.h.

UT_JSONValue* UT_JSONValueMap::get ( const char *  k  ) 

Access entry by name (may be NULL pointer if k is not a key).

const UT_JSONValue* UT_JSONValueMap::get ( const char *  k  )  const

Access const entry by name (may be NULL pointer if k is not a key).

UT_JSONValue* UT_JSONValueMap::get ( int64  i  )  [inline]

Access an entry by index.

Definition at line 88 of file UT_JSONValueMap.h.

const UT_JSONValue* UT_JSONValueMap::get ( int64  i  )  const [inline]

Access a const entry by index.

Definition at line 86 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.

int UT_JSONValueMap::getRef (  )  const [inline]

Get the number of references to this map.

Definition at line 50 of file UT_JSONValueMap.h.

UT_JSONValue* UT_JSONValueMap::operator() ( const char *  k  )  [inline]

Access entry by name (may be NULL pointer if k is not a key).

Definition at line 74 of file UT_JSONValueMap.h.

const UT_JSONValue* UT_JSONValueMap::operator() ( const char *  k  )  const [inline]

Access const entry by name (may be NULL pointer if k is not a key).

Definition at line 72 of file UT_JSONValueMap.h.

UT_JSONValue* UT_JSONValueMap::operator() ( int64  i  )  [inline]

Access entry by index.

Definition at line 70 of file UT_JSONValueMap.h.

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

Access const entry by index.

Definition at line 68 of file UT_JSONValueMap.h.

UT_JSONValue* UT_JSONValueMap::operator[] ( const char *  k  )  [inline]

Access entry by name (may be NULL pointer if k is not a key).

Definition at line 83 of file UT_JSONValueMap.h.

const UT_JSONValue* UT_JSONValueMap::operator[] ( const char *  k  )  const [inline]

Access const entry by name (may be NULL pointer if k is not a key).

Definition at line 81 of file UT_JSONValueMap.h.

UT_JSONValue* UT_JSONValueMap::operator[] ( int64  i  )  [inline]

Access entry by index.

Definition at line 79 of file UT_JSONValueMap.h.

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

Access const entry by index.

Definition at line 77 of file UT_JSONValueMap.h.

bool UT_JSONValueMap::save ( UT_JSONWriter os  )  const

Save to an output stream.


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

Generated on Mon Jan 28 00:49:03 2013 for HDK by  doxygen 1.5.9