CASM
AClustersApproachtoStatisticalMechanics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
CASM::jsonParserIterator< IsConst > Class Template Reference

#include <jsonParser.hh>

Detailed Description

template<bool IsConst>
class CASM::jsonParserIterator< IsConst >

jsonParser bidirectional Iterator class Can iterate over a JSON object or JSON array or JSON value (though this is only one value) When iterating over a JSON object, can return the 'name' of the current 'name':value pair being pointed at

Definition at line 17 of file jsonParser.hh.

Public Types

typedef std::forward_iterator_tag iterator_category
 
typedef std::conditional
< IsConst,
json_spirit::mObject::const_iterator,
json_spirit::mObject::iterator >
::type 
object_iterator
 
typedef std::conditional
< IsConst,
json_spirit::mArray::const_iterator,
json_spirit::mArray::iterator >
::type 
array_iterator
 
typedef int difference_type
 
typedef std::conditional
< IsConst, const jsonParser,
jsonParser >::type 
value_type
 
typedef value_typereference
 
typedef value_typepointer
 

Public Member Functions

 jsonParserIterator ()
 
 jsonParserIterator (const jsonParserIterator &iter)
 
jsonParserIteratoroperator= (jsonParserIterator iter)
 
 jsonParserIterator (pointer j, const object_iterator &iter)
 
 jsonParserIterator (pointer j, const array_iterator &iter)
 
 jsonParserIterator (pointer j, const int &iter)
 
reference operator* ()
 
pointer operator-> ()
 
bool operator== (const jsonParserIterator &iter)
 
bool operator!= (const jsonParserIterator &iter)
 
jsonParserIteratoroperator++ ()
 
jsonParserIterator operator++ (int)
 
jsonParserIteratoroperator-- ()
 
jsonParserIterator operator-- (int)
 
 operator jsonParser::const_iterator ()
 
std::string name ()
 When iterating over a JSON object, returns the 'name' of the 'name':value pair the iterator is pointing at. More...
 

Private Attributes

pointer parser
 
json_spirit::Value_type type
 
object_iterator obj_iter
 
array_iterator array_iter
 
int val_iter
 

Friends

void swap (jsonParserIterator &a, jsonParserIterator &b)
 

Member Typedef Documentation

template<bool IsConst>
typedef std::conditional<IsConst, json_spirit::mArray::const_iterator, json_spirit::mArray::iterator>::type CASM::jsonParserIterator< IsConst >::array_iterator

Definition at line 521 of file jsonParser.hh.

template<bool IsConst>
typedef int CASM::jsonParserIterator< IsConst >::difference_type

Definition at line 522 of file jsonParser.hh.

template<bool IsConst>
typedef std::forward_iterator_tag CASM::jsonParserIterator< IsConst >::iterator_category

Definition at line 519 of file jsonParser.hh.

template<bool IsConst>
typedef std::conditional<IsConst, json_spirit::mObject::const_iterator, json_spirit::mObject::iterator>::type CASM::jsonParserIterator< IsConst >::object_iterator

Definition at line 520 of file jsonParser.hh.

template<bool IsConst>
typedef value_type* CASM::jsonParserIterator< IsConst >::pointer

Definition at line 525 of file jsonParser.hh.

template<bool IsConst>
typedef value_type& CASM::jsonParserIterator< IsConst >::reference

Definition at line 524 of file jsonParser.hh.

template<bool IsConst>
typedef std::conditional<IsConst, const jsonParser, jsonParser>::type CASM::jsonParserIterator< IsConst >::value_type

Definition at line 523 of file jsonParser.hh.

Constructor & Destructor Documentation

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::jsonParserIterator ( )
inline

Definition at line 528 of file jsonParser.hh.

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::jsonParserIterator ( const jsonParserIterator< IsConst > &  iter)
inline

Definition at line 530 of file jsonParser.hh.

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::jsonParserIterator ( pointer  j,
const object_iterator iter 
)
inline

Definition at line 539 of file jsonParser.hh.

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::jsonParserIterator ( pointer  j,
const array_iterator iter 
)
inline

Definition at line 543 of file jsonParser.hh.

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::jsonParserIterator ( pointer  j,
const int &  iter 
)
inline

Definition at line 547 of file jsonParser.hh.

Member Function Documentation

template<bool IsConst>
std::string CASM::jsonParserIterator< IsConst >::name ( )
inline

When iterating over a JSON object, returns the 'name' of the 'name':value pair the iterator is pointing at.

Definition at line 662 of file jsonParser.hh.

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::operator jsonParser::const_iterator ( )
inline

Definition at line 652 of file jsonParser.hh.

template<bool IsConst>
bool CASM::jsonParserIterator< IsConst >::operator!= ( const jsonParserIterator< IsConst > &  iter)
inline

Definition at line 582 of file jsonParser.hh.

template<bool IsConst>
reference CASM::jsonParserIterator< IsConst >::operator* ( )
inline

Definition at line 551 of file jsonParser.hh.

template<bool IsConst>
jsonParserIterator& CASM::jsonParserIterator< IsConst >::operator++ ( )
inline

Definition at line 586 of file jsonParser.hh.

template<bool IsConst>
jsonParserIterator CASM::jsonParserIterator< IsConst >::operator++ ( int  )
inline

Definition at line 601 of file jsonParser.hh.

template<bool IsConst>
jsonParserIterator& CASM::jsonParserIterator< IsConst >::operator-- ( )
inline

Definition at line 619 of file jsonParser.hh.

template<bool IsConst>
jsonParserIterator CASM::jsonParserIterator< IsConst >::operator-- ( int  )
inline

Definition at line 634 of file jsonParser.hh.

template<bool IsConst>
pointer CASM::jsonParserIterator< IsConst >::operator-> ( )
inline

Definition at line 560 of file jsonParser.hh.

template<bool IsConst>
jsonParserIterator& CASM::jsonParserIterator< IsConst >::operator= ( jsonParserIterator< IsConst >  iter)
inline

Definition at line 534 of file jsonParser.hh.

template<bool IsConst>
bool CASM::jsonParserIterator< IsConst >::operator== ( const jsonParserIterator< IsConst > &  iter)
inline

Definition at line 570 of file jsonParser.hh.

Friends And Related Function Documentation

template<bool IsConst>
void swap ( jsonParserIterator< IsConst > &  a,
jsonParserIterator< IsConst > &  b 
)
friend

Definition at line 669 of file jsonParser.hh.

Member Data Documentation

template<bool IsConst>
array_iterator CASM::jsonParserIterator< IsConst >::array_iter
private

Definition at line 688 of file jsonParser.hh.

template<bool IsConst>
object_iterator CASM::jsonParserIterator< IsConst >::obj_iter
private

Definition at line 686 of file jsonParser.hh.

template<bool IsConst>
pointer CASM::jsonParserIterator< IsConst >::parser
private

Definition at line 682 of file jsonParser.hh.

template<bool IsConst>
json_spirit::Value_type CASM::jsonParserIterator< IsConst >::type
private

Definition at line 684 of file jsonParser.hh.

template<bool IsConst>
int CASM::jsonParserIterator< IsConst >::val_iter
private

Definition at line 690 of file jsonParser.hh.


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