| 2747 | } |
| 2748 | |
| 2749 | Value::const_iterator Value::begin() const { |
| 2750 | switch (type_) { |
| 2751 | #ifdef JSON_VALUE_USE_INTERNAL_MAP |
| 2752 | case arrayValue: |
| 2753 | if (value_.array_) { |
| 2754 | ValueInternalArray::IteratorState it; |
| 2755 | value_.array_->makeBeginIterator(it); |
| 2756 | return const_iterator(it); |
| 2757 | } |
| 2758 | break; |
| 2759 | case objectValue: |
| 2760 | if (value_.map_) { |
| 2761 | ValueInternalMap::IteratorState it; |
| 2762 | value_.map_->makeBeginIterator(it); |
| 2763 | return const_iterator(it); |
| 2764 | } |
| 2765 | break; |
| 2766 | #else |
| 2767 | case arrayValue: |
| 2768 | case objectValue: |
| 2769 | if (value_.map_) |
| 2770 | return const_iterator(value_.map_->begin()); |
| 2771 | break; |
| 2772 | #endif |
| 2773 | default: |
| 2774 | break; |
| 2775 | } |
| 2776 | return const_iterator(); |
| 2777 | } |
| 2778 | |
| 2779 | Value::const_iterator Value::end() const { |
| 2780 | switch (type_) { |