mirror of
https://github.com/nlohmann/json.git
synced 2025-07-25 13:41:56 +03:00
use abstract sax class in parser tests
This commit is contained in:
@ -129,68 +129,68 @@ class SaxEventLogger
|
||||
bool errored = false;
|
||||
};
|
||||
|
||||
class SaxCountdown
|
||||
class SaxCountdown : public nlohmann::json::json_sax_t
|
||||
{
|
||||
public:
|
||||
explicit SaxCountdown(const int count) : events_left(count)
|
||||
{}
|
||||
|
||||
bool null()
|
||||
bool null() override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool boolean(bool)
|
||||
bool boolean(bool) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool number_integer(json::number_integer_t)
|
||||
bool number_integer(json::number_integer_t) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool number_unsigned(json::number_unsigned_t)
|
||||
bool number_unsigned(json::number_unsigned_t) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool number_float(json::number_float_t, const std::string&)
|
||||
bool number_float(json::number_float_t, const std::string&) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool string(std::string&)
|
||||
bool string(std::string&) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool start_object(std::size_t)
|
||||
bool start_object(std::size_t) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool key(std::string&)
|
||||
bool key(std::string&) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool end_object()
|
||||
bool end_object() override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool start_array(std::size_t)
|
||||
bool start_array(std::size_t) override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool end_array()
|
||||
bool end_array() override
|
||||
{
|
||||
return events_left-- > 0;
|
||||
}
|
||||
|
||||
bool parse_error(std::size_t, const std::string&, const json::exception&)
|
||||
bool parse_error(std::size_t, const std::string&, const json::exception&) override
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user