1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-09 05:22:48 +03:00

improved coverage

This commit is contained in:
Niels Lohmann
2018-03-20 22:39:08 +01:00
parent 1e38ffc014
commit 9e1abb4842
12 changed files with 412 additions and 180 deletions

View File

@@ -105,21 +105,12 @@ struct json_sax
*/
virtual bool end_array() = 0;
/*!
@brief a binary value was read
@param[in] val byte vector
@return whether parsing should proceed
@note examples are CBOR type 2 strings, MessagePack bin, and maybe UBJSON
array<uint8t>
*/
virtual bool binary(const std::vector<uint8_t>& val) = 0;
/*!
@brief a parse error occurred
@param[in] position the position in the input where the error occurs
@param[in] last_token the last read token
@param[in] error_msg a detailed error message
@return whether parsing should proceed
@return whether parsing should proceed (must return false)
*/
virtual bool parse_error(std::size_t position,
const std::string& last_token,
@@ -225,11 +216,6 @@ class json_sax_dom_parser : public json_sax<BasicJsonType>
return true;
}
bool binary(const std::vector<uint8_t>&) override
{
return true;
}
bool parse_error(std::size_t, const std::string&,
const detail::exception& ex) override
{
@@ -430,11 +416,6 @@ class json_sax_dom_callback_parser : public json_sax<BasicJsonType>
return true;
}
bool binary(const std::vector<uint8_t>&) override
{
return true;
}
bool parse_error(std::size_t, const std::string&,
const detail::exception& ex) override
{
@@ -580,11 +561,6 @@ class json_sax_acceptor : public json_sax<BasicJsonType>
return true;
}
bool binary(const std::vector<uint8_t>&) override
{
return true;
}
bool parse_error(std::size_t, const std::string&, const detail::exception&) override
{
return false;