| 741 | |
| 742 | |
| 743 | JSON::iterator JSON::iterator::begin() const |
| 744 | { |
| 745 | ElementType type = getType(); |
| 746 | |
| 747 | if (type != TYPE_ARRAY && type != TYPE_OBJECT) |
| 748 | throw JSONException("JSON: not array or object when calling begin() method."); |
| 749 | |
| 750 | //std::cerr << "begin()\t" << data() << std::endl; |
| 751 | |
| 752 | Pos pos = ptr_begin + 1; |
| 753 | checkPos(pos); |
| 754 | if (*pos == '}' || *pos == ']') |
| 755 | return end(); |
| 756 | |
| 757 | return JSON(pos, ptr_end, level + 1); |
| 758 | } |
| 759 | |
| 760 | JSON::iterator JSON::iterator::end() const |
| 761 | { |
no test coverage detected