CASM  1.1.0
A Clusters Approach to Statistical Mechanics
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 612 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* () const
 
pointer operator-> () const
 
bool operator== (const jsonParserIterator &iter) const
 
bool is_end () const
 
bool operator!= (const jsonParserIterator &iter) const
 
jsonParserIteratoroperator++ ()
 
jsonParserIterator operator++ (int)
 
jsonParserIteratoroperator-- ()
 
jsonParserIterator operator-- (int)
 
 operator jsonParser::const_iterator () const
 
std::string name () const
 

Private Attributes

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

Friends

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

Member Typedef Documentation

◆ array_iterator

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 622 of file jsonParser.hh.

◆ difference_type

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

Definition at line 623 of file jsonParser.hh.

◆ iterator_category

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

Definition at line 614 of file jsonParser.hh.

◆ object_iterator

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 618 of file jsonParser.hh.

◆ pointer

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

Definition at line 627 of file jsonParser.hh.

◆ reference

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

Definition at line 626 of file jsonParser.hh.

◆ value_type

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

Definition at line 625 of file jsonParser.hh.

Constructor & Destructor Documentation

◆ jsonParserIterator() [1/5]

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

Definition at line 617 of file jsonParser.cc.

◆ jsonParserIterator() [2/5]

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

Definition at line 620 of file jsonParser.cc.

◆ jsonParserIterator() [3/5]

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

◆ jsonParserIterator() [4/5]

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

◆ jsonParserIterator() [5/5]

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

Member Function Documentation

◆ is_end()

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

Definition at line 701 of file jsonParser.cc.

◆ name()

template<bool IsConst>
std::string CASM::jsonParserIterator< IsConst >::name

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

Definition at line 792 of file jsonParser.cc.

◆ operator jsonParser::const_iterator()

template<bool IsConst>
CASM::jsonParserIterator< IsConst >::operator jsonParser::const_iterator

Definition at line 780 of file jsonParser.cc.

◆ operator!=()

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

Definition at line 714 of file jsonParser.cc.

◆ operator*()

template<bool IsConst>
jsonParserIterator< IsConst >::reference CASM::jsonParserIterator< IsConst >::operator*

Definition at line 653 of file jsonParser.cc.

◆ operator++() [1/2]

template<bool IsConst>
jsonParserIterator< IsConst > & CASM::jsonParserIterator< IsConst >::operator++

Definition at line 720 of file jsonParser.cc.

◆ operator++() [2/2]

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

Definition at line 734 of file jsonParser.cc.

◆ operator--() [1/2]

template<bool IsConst>
jsonParserIterator< IsConst > & CASM::jsonParserIterator< IsConst >::operator--

Definition at line 750 of file jsonParser.cc.

◆ operator--() [2/2]

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

Definition at line 764 of file jsonParser.cc.

◆ operator->()

template<bool IsConst>
jsonParserIterator< IsConst >::pointer CASM::jsonParserIterator< IsConst >::operator->

Definition at line 664 of file jsonParser.cc.

◆ operator=()

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

Definition at line 628 of file jsonParser.cc.

◆ operator==()

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

Definition at line 674 of file jsonParser.cc.

Friends And Related Function Documentation

◆ swap

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

Member Data Documentation

◆ array_iter

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

Definition at line 676 of file jsonParser.hh.

◆ obj_iter

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

Definition at line 674 of file jsonParser.hh.

◆ parser

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

Definition at line 670 of file jsonParser.hh.

◆ type

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

Definition at line 672 of file jsonParser.hh.

◆ val_iter

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

Definition at line 678 of file jsonParser.hh.


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