JsonCpp project page JsonCpp home page

Json::ValueIteratorBase Class Reference

base class for Value iterators. More...

#include <json/value.h>

Inherited by Json::ValueConstIterator, and Json::ValueIterator.

Collaboration diagram for Json::ValueIteratorBase:
Collaboration graph
[legend]

List of all members.

Public Types

typedef
std::bidirectional_iterator_tag 
iterator_category
typedef unsigned int size_t
typedef int difference_type
typedef ValueIteratorBase SelfType

Public Member Functions

bool operator== (const SelfType &other) const
bool operator!= (const SelfType &other) const
difference_type operator- (const SelfType &other) const
Value key () const
 Return either the index or the member name of the referenced value as a Value.
UInt index () const
 Return the index of the referenced Value, or -1 if it is not an arrayValue.
std::string name () const
 Return the member name of the referenced Value, or "" if it is not an objectValue.
char const * memberName () const
 Return the member name of the referenced Value.
char const * memberName (char const **end) const
 Return the member name of the referenced Value, or NULL if it is not an objectValue.
 ValueIteratorBase ()
 ValueIteratorBase (const Value::ObjectValues::iterator &current)

Protected Member Functions

Valuederef () const
void increment ()
void decrement ()
difference_type computeDistance (const SelfType &other) const
bool isEqual (const SelfType &other) const
void copy (const SelfType &other)

Detailed Description

base class for Value iterators.

Definition at line 655 of file value.h.


Member Typedef Documentation

Reimplemented in Json::ValueIterator.

Definition at line 659 of file value.h.

typedef std::bidirectional_iterator_tag Json::ValueIteratorBase::iterator_category

Definition at line 657 of file value.h.

Reimplemented in Json::ValueConstIterator, and Json::ValueIterator.

Definition at line 660 of file value.h.

typedef unsigned int Json::ValueIteratorBase::size_t

Reimplemented in Json::ValueIterator.

Definition at line 658 of file value.h.


Constructor & Destructor Documentation

Json::ValueIteratorBase::ValueIteratorBase (  ) 

Definition at line 18 of file json_valueiterator.inl.

Json::ValueIteratorBase::ValueIteratorBase ( const Value::ObjectValues::iterator &  current  )  [explicit]

Definition at line 22 of file json_valueiterator.inl.


Member Function Documentation

ValueIteratorBase::difference_type Json::ValueIteratorBase::computeDistance ( const SelfType other  )  const [protected]

Definition at line 39 of file json_valueiterator.inl.

Referenced by operator-().

Here is the caller graph for this function:

void Json::ValueIteratorBase::copy ( const SelfType other  )  [protected]

Definition at line 73 of file json_valueiterator.inl.

Referenced by Json::ValueIterator::operator=(), and Json::ValueConstIterator::operator=().

Here is the caller graph for this function:

void Json::ValueIteratorBase::decrement (  )  [protected]

Definition at line 34 of file json_valueiterator.inl.

Value & Json::ValueIteratorBase::deref (  )  const [protected]

Definition at line 26 of file json_valueiterator.inl.

void Json::ValueIteratorBase::increment (  )  [protected]

Definition at line 30 of file json_valueiterator.inl.

UInt Json::ValueIteratorBase::index (  )  const

Return the index of the referenced Value, or -1 if it is not an arrayValue.

Definition at line 88 of file json_valueiterator.inl.

bool Json::ValueIteratorBase::isEqual ( const SelfType other  )  const [protected]

Definition at line 66 of file json_valueiterator.inl.

Value Json::ValueIteratorBase::key (  )  const

Return either the index or the member name of the referenced value as a Value.

Definition at line 78 of file json_valueiterator.inl.

char const * Json::ValueIteratorBase::memberName ( char const **  end  )  const

Return the member name of the referenced Value, or NULL if it is not an objectValue.

Note:
Better version than memberName(). Allows embedded nulls.

Definition at line 108 of file json_valueiterator.inl.

char const * Json::ValueIteratorBase::memberName (  )  const

Return the member name of the referenced Value.

"" if it is not an objectValue.

Deprecated:
This cannot be used for UTF-8 strings, since there can be embedded nulls.

Definition at line 103 of file json_valueiterator.inl.

Referenced by name().

Here is the caller graph for this function:

std::string Json::ValueIteratorBase::name (  )  const

Return the member name of the referenced Value, or "" if it is not an objectValue.

Note:
Avoid `c_str()` on result, as embedded zeroes are possible.

Definition at line 95 of file json_valueiterator.inl.

References memberName().

bool Json::ValueIteratorBase::operator!= ( const SelfType other  )  const [inline]

Definition at line 664 of file value.h.

difference_type Json::ValueIteratorBase::operator- ( const SelfType other  )  const [inline]

Definition at line 666 of file value.h.

References computeDistance().

bool Json::ValueIteratorBase::operator== ( const SelfType other  )  const [inline]

Definition at line 662 of file value.h.


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