19 #ifndef JSON_VALUE_USE_INTERNAL_MAP 28 iterator_.array_ = ValueInternalArray::IteratorState();
33 #ifndef JSON_VALUE_USE_INTERNAL_MAP 43 iterator_.array_ = state;
50 iterator_.map_ = state;
57 #ifndef JSON_VALUE_USE_INTERNAL_MAP 58 return current_->second;
61 return ValueInternalArray::dereference( iterator_.array_ );
62 return ValueInternalMap::value( iterator_.map_ );
70 #ifndef JSON_VALUE_USE_INTERNAL_MAP 74 ValueInternalArray::increment( iterator_.array_ );
75 ValueInternalMap::increment( iterator_.map_ );
83 #ifndef JSON_VALUE_USE_INTERNAL_MAP 87 ValueInternalArray::decrement( iterator_.array_ );
88 ValueInternalMap::decrement( iterator_.map_ );
96 #ifndef JSON_VALUE_USE_INTERNAL_MAP 97 # ifdef JSON_USE_CPPTL_SMALLMAP 98 return current_ - other.current_;
105 if ( isNull_ && other.isNull_ )
116 for ( Value::ObjectValues::iterator it = current_; it != other.current_; ++it )
124 return ValueInternalArray::distance( iterator_.array_, other.iterator_.
array_ );
125 return ValueInternalMap::distance( iterator_.map_, other.iterator_.
map_ );
133 #ifndef JSON_VALUE_USE_INTERNAL_MAP 136 return other.isNull_;
138 return current_ == other.current_;
141 return ValueInternalArray::equals( iterator_.array_, other.iterator_.
array_ );
142 return ValueInternalMap::equals( iterator_.map_, other.iterator_.
map_ );
150 #ifndef JSON_VALUE_USE_INTERNAL_MAP 151 current_ = other.current_;
152 isNull_ = other.isNull_;
155 iterator_.array_ = other.iterator_.
array_;
156 iterator_.map_ = other.iterator_.
map_;
164 #ifndef JSON_VALUE_USE_INTERNAL_MAP 165 const Value::CZString czstring = (*current_).first;
166 if ( czstring.c_str() )
168 if ( czstring.isStaticString() )
170 return Value( czstring.c_str() );
172 return Value( czstring.index() );
175 return Value( ValueInternalArray::indexOf( iterator_.array_ ) );
177 const char *
memberName = ValueInternalMap::key( iterator_.map_, isStatic );
180 return Value( memberName );
188 #ifndef JSON_VALUE_USE_INTERNAL_MAP 189 const Value::CZString czstring = (*current_).first;
190 if ( !czstring.c_str() )
191 return czstring.index();
195 return Value::UInt( ValueInternalArray::indexOf( iterator_.array_ ) );
204 #ifndef JSON_VALUE_USE_INTERNAL_MAP 205 const char *name = (*current_).first.c_str();
206 return name ? name :
"";
209 return ValueInternalMap::key( iterator_.map_ );
228 #ifndef JSON_VALUE_USE_INTERNAL_MAP 266 #ifndef JSON_VALUE_USE_INTERNAL_MAP
base class for Value iterators.
Lightweight wrapper to tag static string.
ValueInternalMap::IteratorState map_
bool isEqual(const SelfType &other) const
difference_type computeDistance(const SelfType &other) const
void copy(const SelfType &other)
const iterator for object and array value.
SelfType & operator=(const SelfType &other)
JSON (JavaScript Object Notation).
SelfType & operator=(const ValueIteratorBase &other)
UInt index() const
Return the index of the referenced Value. -1 if it is not an arrayValue.
Value key() const
Return either the index or the member name of the referenced value as a Value.
Iterator for object and array value.
ValueInternalArray::IteratorState array_
const char * memberName() const
Return the member name of the referenced Value.