Skip to content

Commit

Permalink
resolves #19
Browse files Browse the repository at this point in the history
  • Loading branch information
jpihl committed Nov 5, 2019
1 parent 611f50c commit 494fe35
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bourne/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,28 @@ bool json::operator!=(const json& other) const
json& json::at(const std::string& key)
{
assert(is_object());
assert(has_key(key));
return m_internal.m_map->at(key);
}

const json& json::at(const std::string& key) const
{
assert(is_object());
assert(has_key(key));
return m_internal.m_map->at(key);
}

json& json::at(uint32_t index)
{
assert(is_array());
assert(index < size());
return m_internal.m_array->at(index);
}

const json& json::at(uint32_t index) const
{
assert(is_array());
assert(index < size());
return m_internal.m_array->at(index);
}

Expand Down

0 comments on commit 494fe35

Please sign in to comment.