Free Electron
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Json::ValueIteratorBase Class Reference

base class for Value iterators. More...

#include <value.h>

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

Public Types

using iterator_category = std::bidirectional_iterator_tag
 
using size_t = unsigned int
 
using difference_type = int
 
using SelfType = ValueIteratorBase
 

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. More...
 
UInt index () const
 Return the index of the referenced Value, or -1 if it is not an arrayValue. More...
 
String name () const
 Return the member name of the referenced Value, or "" if it is not an objectValue. More...
 
char const * memberName () const
 Return the member name of the referenced Value. More...
 
char const * memberName (char const **end) const
 Return the member name of the referenced Value, or NULL if it is not an objectValue. More...
 
 ValueIteratorBase (const Value::ObjectValues::iterator &current)
 

Protected Member Functions

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

Private Attributes

Value::ObjectValues::iterator current_
 
bool isNull_ {true}
 

Detailed Description

base class for Value iterators.

Member Function Documentation

◆ deref()

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

Internal utility functions to assist with implementing other iterator functions. The const and non-const versions of the "deref" protected methods expose the protected current_ member variable in a way that can often be optimized away by the compiler.

◆ index()

UInt Json::ValueIteratorBase::index ( ) const

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

◆ key()

Value Json::ValueIteratorBase::key ( ) const

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

◆ memberName() [1/2]

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.

◆ memberName() [2/2]

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.

◆ name()

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.

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