13ValueIteratorBase::ValueIteratorBase()
14#ifndef JSON_VALUE_USE_INTERNAL_MAP
23 iterator_.array_ = ValueInternalArray::IteratorState();
28#ifndef JSON_VALUE_USE_INTERNAL_MAP
29ValueIteratorBase::ValueIteratorBase(
const Value::ObjectValues::iterator ¤t )
38 iterator_.array_ = state;
45 iterator_.map_ = state;
52#ifndef JSON_VALUE_USE_INTERNAL_MAP
53 return current_->second;
56 return ValueInternalArray::dereference( iterator_.array_ );
57 return ValueInternalMap::value( iterator_.map_ );
65#ifndef JSON_VALUE_USE_INTERNAL_MAP
69 ValueInternalArray::increment( iterator_.array_ );
70 ValueInternalMap::increment( iterator_.map_ );
78#ifndef JSON_VALUE_USE_INTERNAL_MAP
82 ValueInternalArray::decrement( iterator_.array_ );
83 ValueInternalMap::decrement( iterator_.map_ );
91#ifndef JSON_VALUE_USE_INTERNAL_MAP
92# ifdef JSON_USE_CPPTL_SMALLMAP
93 return current_ - other.current_;
100 if ( isNull_ && other.isNull_ )
111 for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it )
119 return ValueInternalArray::distance( iterator_.array_, other.iterator_.
array_ );
120 return ValueInternalMap::distance( iterator_.map_, other.iterator_.
map_ );
128#ifndef JSON_VALUE_USE_INTERNAL_MAP
131 return other.isNull_;
133 return current_ == other.current_;
136 return ValueInternalArray::equals( iterator_.array_, other.iterator_.
array_ );
137 return ValueInternalMap::equals( iterator_.map_, other.iterator_.
map_ );
145#ifndef JSON_VALUE_USE_INTERNAL_MAP
146 current_ = other.current_;
149 iterator_.array_ = other.iterator_.
array_;
150 iterator_.map_ = other.iterator_.
map_;
158#ifndef JSON_VALUE_USE_INTERNAL_MAP
159 const Value::CZString czstring = (*current_).first;
160 if ( czstring.c_str() )
162 if ( czstring.isStaticString() )
164 return Value( czstring.c_str() );
166 return Value( czstring.index() );
169 return Value( ValueInternalArray::indexOf( iterator_.array_ ) );
171 const char *
memberName = ValueInternalMap::key( iterator_.map_, isStatic );
182#ifndef JSON_VALUE_USE_INTERNAL_MAP
183 const Value::CZString czstring = (*current_).first;
184 if ( !czstring.c_str() )
185 return czstring.index();
189 return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) );
198#ifndef JSON_VALUE_USE_INTERNAL_MAP
199 const char *name = (*current_).first.c_str();
200 return name ? name :
"";
203 return ValueInternalMap::key( iterator_.map_ );
222#ifndef JSON_VALUE_USE_INTERNAL_MAP
229 : ValueIteratorBase( state )
234 : ValueIteratorBase( state )
260#ifndef JSON_VALUE_USE_INTERNAL_MAP
267 : ValueIteratorBase( state )
272 : ValueIteratorBase( state )
Lightweight wrapper to tag static string.
const iterator for object and array value.
SelfType & operator=(const ValueIteratorBase &other)
base class for Value iterators.
bool isEqual(const SelfType &other) const
const char * memberName() const
Return the member name of the referenced Value. "" if it is not an objectValue.
ValueInternalMap::IteratorState map_
UInt index() const
Return the index of the referenced Value. -1 if it is not an arrayValue.
void copy(const SelfType &other)
ValueInternalArray::IteratorState array_
difference_type computeDistance(const SelfType &other) const
Value key() const
Return either the index or the member name of the referenced value as a Value.
Iterator for object and array value.
SelfType & operator=(const SelfType &other)