Update Parser::is_true() for JSON keys

This commit is contained in:
fvanroie 2022-01-31 05:48:05 +01:00
parent 43dff43a27
commit fc9e14a926
2 changed files with 6 additions and 0 deletions

View File

@ -154,6 +154,11 @@ bool Parser::is_true(const char* s)
!strcmp_P(s, PSTR("1")));
}
bool Parser::is_true(JsonVariant json)
{
return is_true(json.as<std::string>().c_str());
}
bool Parser::is_only_digits(const char* s)
{
size_t digits = 0;

View File

@ -15,6 +15,7 @@ class Parser {
static uint8_t get_action_id(const char* action);
static uint16_t get_sdbm(const char* str);
static bool is_true(const char* s);
static bool is_true(JsonVariant json);
static bool is_only_digits(const char* s);
static int format_bytes(size_t filesize, char* buf, size_t len);
};