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

Traverse an array object in the parser. More...

#include <UT_JSONParser.h>

Public Member Functions

 iterator ()
 
 iterator (const iterator &src)
 
 ~iterator ()
 
const iteratoroperator= (const iterator &src)
 
iteratoroperator++ ()
 ++iterator More...
 
iteratoroperator++ (int)
 
bool atEnd () const
 
void advance ()
 
template<typename T >
bool getKey (T &key)
 
template<typename T >
bool getLowerKey (T &key)
 Get a lower case map key (for case insensitive maps) More...
 
bool getErrorState () const
 
UT_JID getUniformArrayType () const
 Return the uniform array type (UT_JID_NULL if not uniform array) More...
 
int64 getUniformArraySize () const
 Return the number of elements in the uniform array (0 if empty) More...
 
int64 getUniformArrayUnreadSize () const
 
template<typename T >
bool readUniformArray (T *buffer, int64 size)
 

Friends

class UT_JSONParser
 

Detailed Description

Traverse an array object in the parser.

This class will iterate over an array. There is no object associated with the array, it's up to the caller to load the objects

There is no rewind() operation available on this iterator

for (it = UT_JSONParser::beginMap(); !it.atEnd(); ++it)
or
for (it = UT_JSONParser::beginArray(); !it.atEnd(); ++it)

Definition at line 527 of file UT_JSONParser.h.

Constructor & Destructor Documentation

UT_JSONParser::iterator::iterator ( void  )
inline

Definition at line 530 of file UT_JSONParser.h.

UT_JSONParser::iterator::iterator ( const iterator src)
inline

Definition at line 537 of file UT_JSONParser.h.

UT_JSONParser::iterator::~iterator ( )
inline

Definition at line 541 of file UT_JSONParser.h.

Member Function Documentation

void UT_JSONParser::iterator::advance ( )
inline

Definition at line 559 of file UT_JSONParser.h.

bool UT_JSONParser::iterator::atEnd ( ) const
inline
Examples:
SOP/SOP_BouncyAgent.C.

Definition at line 558 of file UT_JSONParser.h.

bool UT_JSONParser::iterator::getErrorState ( ) const
inline

The error state records whether any errors were encountered during the iterator's parse operations.

Definition at line 609 of file UT_JSONParser.h.

template<typename T >
bool UT_JSONParser::iterator::getKey ( T key)
inline

Get the key from the map. If we're iterating over an array, this assumes that the next array element will be a string token. This allows for "ordered" maps to be stored in an array of tuples (string,value)

The T template can be either UT_WorkBuffer or UT_StringHolder

Definition at line 578 of file UT_JSONParser.h.

template<typename T >
bool UT_JSONParser::iterator::getLowerKey ( T key)
inline

Get a lower case map key (for case insensitive maps)

Definition at line 597 of file UT_JSONParser.h.

int64 UT_JSONParser::iterator::getUniformArraySize ( ) const
inline

Return the number of elements in the uniform array (0 if empty)

Definition at line 618 of file UT_JSONParser.h.

UT_JID UT_JSONParser::iterator::getUniformArrayType ( ) const
inline

Return the uniform array type (UT_JID_NULL if not uniform array)

Definition at line 612 of file UT_JSONParser.h.

int64 UT_JSONParser::iterator::getUniformArrayUnreadSize ( ) const
inline

Return the remaining number of elements in the uniform array (0 if empty)

Definition at line 625 of file UT_JSONParser.h.

iterator& UT_JSONParser::iterator::operator++ ( )
inline

++iterator

Definition at line 553 of file UT_JSONParser.h.

iterator& UT_JSONParser::iterator::operator++ ( int  )
inline

Caution: The post-increment operator has side effects and is equivalent to the iterator after the increment is performed.

Definition at line 556 of file UT_JSONParser.h.

const iterator& UT_JSONParser::iterator::operator= ( const iterator src)
inline

Definition at line 543 of file UT_JSONParser.h.

template<typename T >
bool UT_JSONParser::iterator::readUniformArray ( T buffer,
int64  size 
)
inline

Read uniform array straight into a buffer. This template only works for int8, int16, int32, int64, fpreal16, fpreal32, fpreal64.

Definition at line 635 of file UT_JSONParser.h.

Friends And Related Function Documentation

friend class UT_JSONParser
friend

Definition at line 684 of file UT_JSONParser.h.


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