mirror of
https://github.com/nlohmann/json.git
synced 2025-07-13 20:21:48 +03:00
Merge branch 'develop' into feature/release_information
This commit is contained in:
18
src/json.hpp
18
src/json.hpp
@ -1,11 +1,11 @@
|
||||
/*
|
||||
__ _____ _____ _____
|
||||
__| | __| | | | JSON for Modern C++
|
||||
| | |__ | | | | | | version 2.0.9
|
||||
| | |__ | | | | | | version 2.0.10
|
||||
|_____|_____|_____|_|___| https://github.com/nlohmann/json
|
||||
|
||||
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
|
||||
Copyright (c) 2013-2016 Niels Lohmann <http://nlohmann.me>.
|
||||
Copyright (c) 2013-2017 Niels Lohmann <http://nlohmann.me>.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -940,8 +940,7 @@ class basic_json
|
||||
{
|
||||
if (t == value_t::null)
|
||||
{
|
||||
// echo "JSON for Modern C++" | sha1sum
|
||||
throw std::domain_error("961c151d2e87f2686a955a9be24d316f1362bf21 2.0.10");
|
||||
throw std::domain_error("961c151d2e87f2686a955a9be24d316f1362bf21 2.0.10"); // LCOV_EXCL_LINE
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -7203,13 +7202,10 @@ class basic_json
|
||||
*/
|
||||
static basic_json from_cbor_internal(const std::vector<uint8_t>& v, size_t& idx)
|
||||
{
|
||||
// make sure reading 1 byte is safe
|
||||
check_length(v.size(), 1, idx);
|
||||
|
||||
// store and increment index
|
||||
const size_t current_idx = idx++;
|
||||
|
||||
switch (v[current_idx])
|
||||
switch (v.at(current_idx))
|
||||
{
|
||||
// Integer 0x00..0x17 (0..23)
|
||||
case 0x00:
|
||||
@ -7390,7 +7386,7 @@ class basic_json
|
||||
case 0x7f: // UTF-8 string (indefinite length)
|
||||
{
|
||||
std::string result;
|
||||
while (v[idx] != 0xff)
|
||||
while (v.at(idx) != 0xff)
|
||||
{
|
||||
string_t s = from_cbor_internal(v, idx);
|
||||
result += s;
|
||||
@ -7486,7 +7482,7 @@ class basic_json
|
||||
case 0x9f: // array (indefinite length)
|
||||
{
|
||||
basic_json result = value_t::array;
|
||||
while (v[idx] != 0xff)
|
||||
while (v.at(idx) != 0xff)
|
||||
{
|
||||
result.push_back(from_cbor_internal(v, idx));
|
||||
}
|
||||
@ -7586,7 +7582,7 @@ class basic_json
|
||||
case 0xbf: // map (indefinite length)
|
||||
{
|
||||
basic_json result = value_t::object;
|
||||
while (v[idx] != 0xff)
|
||||
while (v.at(idx) != 0xff)
|
||||
{
|
||||
std::string key = from_cbor_internal(v, idx);
|
||||
result[key] = from_cbor_internal(v, idx);
|
||||
|
Reference in New Issue
Block a user