forked from bblanchon/ArduinoJson
Made EscapedString pure static
This commit is contained in:
@ -14,20 +14,6 @@ namespace ArduinoJson
|
||||
class EscapedString
|
||||
{
|
||||
public:
|
||||
|
||||
EscapedString(const char* s)
|
||||
: rawString(s)
|
||||
{
|
||||
}
|
||||
|
||||
size_t printTo(Print& p) const
|
||||
{
|
||||
return printTo(rawString, p);
|
||||
}
|
||||
|
||||
private:
|
||||
const char* rawString;
|
||||
|
||||
static size_t printTo(const char*, Print&);
|
||||
};
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ size_t JsonObjectBase::printTo(Print& p) const
|
||||
const KeyValuePair* current = items;
|
||||
for (int i = count; i > 0; i--)
|
||||
{
|
||||
n += EscapedString(current->key).printTo(p);
|
||||
n += EscapedString::printTo(current->key, p);
|
||||
n += p.write(':');
|
||||
n += current->value.printTo(p);
|
||||
|
||||
|
@ -31,5 +31,5 @@ size_t JsonValue::printPrintableTo(const Content& c, Print& p)
|
||||
|
||||
size_t JsonValue::printStringTo(const Content& c, Print& p)
|
||||
{
|
||||
return EscapedString(c.asString).printTo(p);
|
||||
return EscapedString::printTo(c.asString, p);
|
||||
}
|
@ -83,8 +83,7 @@ namespace JsonGeneratorTests
|
||||
void whenInputIs(const char* input)
|
||||
{
|
||||
StringBuilder sb(buffer, sizeof(buffer));
|
||||
EscapedString escapedString = input;
|
||||
returnValue = escapedString.printTo(sb);
|
||||
returnValue = EscapedString::printTo(input, sb);
|
||||
}
|
||||
|
||||
void outputMustBe(const char* expected)
|
||||
|
Reference in New Issue
Block a user