HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 523 of file UT_JSONParser.h.

Constructor & Destructor Documentation

UT_JSONParser::iterator::iterator ( void  )
inline

Definition at line 526 of file UT_JSONParser.h.

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

Definition at line 533 of file UT_JSONParser.h.

UT_JSONParser::iterator::~iterator ( )
inline

Definition at line 537 of file UT_JSONParser.h.

Member Function Documentation

void UT_JSONParser::iterator::advance ( )
inline

Definition at line 555 of file UT_JSONParser.h.

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

Definition at line 554 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 605 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 574 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 593 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 614 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 608 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 621 of file UT_JSONParser.h.

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

++iterator

Definition at line 549 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 552 of file UT_JSONParser.h.

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

Definition at line 539 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 631 of file UT_JSONParser.h.

Friends And Related Function Documentation

friend class UT_JSONParser
friend

Definition at line 680 of file UT_JSONParser.h.


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