| 161 | |
| 162 | |
| 163 | void ParserImpl::handleObject() |
| 164 | { |
| 165 | if (_depth != JSON_UNLIMITED_DEPTH && _currentDepth >= _depth) |
| 166 | throw JSONException("Maximum allowed JSON depth exceeded"); |
| 167 | ++_currentDepth; |
| 168 | |
| 169 | json_type tok = json_peek(_pJSON); |
| 170 | while (tok != JSON_OBJECT_END && checkError()) |
| 171 | { |
| 172 | json_next(_pJSON); |
| 173 | size_t length; |
| 174 | const char * bytes = json_get_string(_pJSON, &length); |
| 175 | if (_pHandler) _pHandler->key(std::string(bytes, length)); |
| 176 | handle(); |
| 177 | tok = json_peek(_pJSON); |
| 178 | } |
| 179 | |
| 180 | if (tok == JSON_OBJECT_END) handle(); |
| 181 | else throw JSONException("JSON object end not found"); |
| 182 | |
| 183 | --_currentDepth; |
| 184 | } |
| 185 | |
| 186 | |
| 187 | void ParserImpl::handle() |
nothing calls this directly
no test coverage detected