nomlib
Loading...
Searching...
No Matches
nom::ValueIteratorBase Class Reference
Inheritance diagram for nom::ValueIteratorBase:
[legend]

Public Types

enum  IteratorType { Null = 0 , ObjectValues }
typedef ValueIteratorBase SelfType
typedef ValueIteratorBaseRawPtr
typedef nom::size_type DifferenceType
typedef ValueValueTypeReference
typedef ValueValueTypePointer

Public Member Functions

 ValueIteratorBase ()
 Default constructor.
virtual ~ValueIteratorBase ()
 Destructor.
 ValueIteratorBase (const ObjectIterator &rhs)
bool valid () const
 query validity of the object.
ArrayIndex index () const
 Obtain the index of the referenced value.
const char * key () const
 Obtain the current index or member key value.
bool key (const std::string &member) const
 Query if the member key exists at the current position of the iterator object.
bool operator== (const SelfType &rhs) const
bool operator!= (const SelfType &rhs) const
DifferenceType operator- (const SelfType &rhs) const

Protected Member Functions

void copy (const SelfType &rhs)
ValueTypeReference dereference () const
ValueTypePointer pointer () const
void increment ()
void decrement ()
DifferenceType distance (const SelfType &rhs) const

Private Member Functions

enum IteratorType type () const

Private Attributes

ObjectIterator object_
 A pointer to the object type iterator.
enum IteratorType type_

Detailed Description

Definition at line 43 of file ValueIteratorBase.hpp.

Member Typedef Documentation

◆ DifferenceType

typedef nom::size_type nom::ValueIteratorBase::DifferenceType

Definition at line 48 of file ValueIteratorBase.hpp.

◆ RawPtr

typedef ValueIteratorBase* nom::ValueIteratorBase::RawPtr

Definition at line 47 of file ValueIteratorBase.hpp.

◆ SelfType

typedef ValueIteratorBase nom::ValueIteratorBase::SelfType

Definition at line 46 of file ValueIteratorBase.hpp.

◆ ValueTypePointer

typedef Value* nom::ValueIteratorBase::ValueTypePointer

Definition at line 50 of file ValueIteratorBase.hpp.

◆ ValueTypeReference

typedef Value& nom::ValueIteratorBase::ValueTypeReference

Definition at line 49 of file ValueIteratorBase.hpp.

Member Enumeration Documentation

◆ IteratorType

enum nom::ValueIteratorBase::IteratorType

Definition at line 52 of file ValueIteratorBase.hpp.

Member Function Documentation

◆ index()

ArrayIndex nom::ValueIteratorBase::index ( ) const

Obtain the index of the referenced value.

Returns
The array element's index on success, or -1 if the referenced value is not an array element.

◆ key()

const char * nom::ValueIteratorBase::key ( ) const

Obtain the current index or member key value.

Returns
Member key of the referenced value on success, nullptr if not not an object type or the member key is not found.
Todo
Try handling the return of the key (string) or index (integer) more elegantly? (Presently, we are converting index values to a string).

◆ valid()

bool nom::ValueIteratorBase::valid ( ) const

query validity of the object.

Returns
The object is always assumed to be invalid when Value::ValueType::NullValue is the set type (set during construction).

Member Data Documentation

◆ object_

ObjectIterator nom::ValueIteratorBase::object_
private

A pointer to the object type iterator.

Definition at line 109 of file ValueIteratorBase.hpp.

◆ type_

enum IteratorType nom::ValueIteratorBase::type_
private

Definition at line 111 of file ValueIteratorBase.hpp.


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