Mercurial > code
comparison C++/Json.cpp @ 320:b67b2da45bb0
Json:
* Remove uniform initialization
* Add JsonObject::erase, JsonObject::clear
* Add JsonArray::erase, JsonArray::clear
* Fix operator== in iterators
* Add JsonValue::JsonValue(std::nullptr_t)
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 26 Feb 2015 14:21:29 +0100 |
parents | 4c3019385769 |
children |
comparison
equal
deleted
inserted
replaced
314:4c3019385769 | 320:b67b2da45bb0 |
---|---|
45 JsonValue JsonArray::at(int index) const | 45 JsonValue JsonArray::at(int index) const |
46 { | 46 { |
47 auto value = json_array_get(m_handle.get(), index); | 47 auto value = json_array_get(m_handle.get(), index); |
48 | 48 |
49 if (value == nullptr) | 49 if (value == nullptr) |
50 throw JsonError{"index out of bounds"}; | 50 throw JsonError("index out of bounds"); |
51 | 51 |
52 json_incref(value); | 52 json_incref(value); |
53 | 53 |
54 return JsonValue{value}; | 54 return JsonValue{value}; |
55 } | 55 } |