Renamed Print::write() into print()

This commit is contained in:
Benoît Blanchon
2014-07-03 13:38:58 +02:00
parent 81c7b9f700
commit 5b1c2047a4
5 changed files with 19 additions and 19 deletions

View File

@ -41,19 +41,19 @@ private:
{
size_t n = 0;
n += p.write("[");
n += p.write('[');
for (int i = 0; i < itemCount; i++)
{
if (i > 0)
{
n += p.write(",");
n += p.write(',');
}
n += items[i].printTo(p);
}
n += p.write("]");
n += p.write(']');
return n;
}

View File

@ -7,7 +7,7 @@
size_t JsonValue::printBoolTo(Print& p) const
{
return p.write(content.asBool ? "true" : "false");
return p.print(content.asBool ? "true" : "false");
}
size_t JsonValue::printDoubleTo(Print& p) const
@ -30,7 +30,7 @@ size_t JsonValue::printPrintableTo(Print& p) const
if (content.asPrintable)
return ((Printable*) content.asPrintable)->printTo(p);
else
return p.write("null");
return p.print("null");
}
size_t JsonValue::printStringTo(Print& p) const
@ -39,7 +39,7 @@ size_t JsonValue::printStringTo(Print& p) const
if (!s)
{
return p.write("null");
return p.print("null");
}
size_t n = 0;
@ -51,31 +51,31 @@ size_t JsonValue::printStringTo(Print& p) const
switch (*s)
{
case '"':
n += p.write("\\\"");
n += p.print("\\\"");
break;
case '\\':
n += p.write("\\\\");
n += p.print("\\\\");
break;
case '\b':
n += p.write("\\b");
n += p.print("\\b");
break;
case '\f':
n += p.write("\\f");
n += p.print("\\f");
break;
case '\n':
n += p.write("\\n");
n += p.print("\\n");
break;
case '\r':
n += p.write("\\r");
n += p.print("\\r");
break;
case '\t':
n += p.write("\\t");
n += p.print("\\t");
break;
default:

View File

@ -14,9 +14,9 @@ class Print
{
public:
virtual size_t write(uint8_t c) = 0;
virtual size_t write(uint8_t) = 0;
size_t write(const char* s);
size_t print(const char[]);
size_t print(double, int = 2);
size_t print(long);
};