From fbfa61eadf896ed2cd2c3f7e2a9f9e6ab2f773bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Blanchon?= Date: Thu, 5 Jan 2017 21:36:19 +0100 Subject: [PATCH] Updated API Reference (markdown) --- API-Reference.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/API-Reference.md b/API-Reference.md index 05d766e..7793ed3 100644 --- a/API-Reference.md +++ b/API-Reference.md @@ -722,9 +722,19 @@ Therefore, it's recommended to have a JSON input in a `char[]` or a `char*`. ##### Signatures ```c++ -JsonArray& parseArray(char* json, uint8_t nestingLimit=10); // <- recommended +// The first overload, which accepts a modifiable array of chars, is the most efficient +// since it allows the zero-copy feature. +JsonArray& parseArray(char* json, uint8_t nestingLimit=10); + +// The three following overloads, which accept read-only strings, require a bigger JsonBuffer +// because parts of the JSON input has to be copied. JsonArray& parseArray(const char* json, uint8_t nestingLimit=10); JsonArray& parseArray(const String& json, uint8_t nestingLimit=10); +JsonArray& parseArray(const std::string& json, uint8_t nestingLimit=10); + +// The two last overloads, which accept input streams, make copy of the input too. +JsonArray& parseArray(Stream& json, uint8_t nestingLimit=10); +JsonArray& parseArray(std::istream& json, uint8_t nestingLimit=10); ``` ##### Arguments @@ -763,9 +773,19 @@ Therefore, it's recommended to have a JSON input in a `char[]` or a `char*`. ##### Signatures ```c++ -JsonObject& parseObject(char* json, uint8_t nestingLimit=10); // <- recommended +// The first overload, which accepts a modifiable array of chars, is the most efficient +// since it allows the zero-copy feature. +JsonObject& parseObject(char* json, uint8_t nestingLimit=10); + +// The three following overloads, which accept read-only strings, require a bigger JsonBuffer +// because parts of the JSON input has to be copied. JsonObject& parseObject(const char* json, uint8_t nestingLimit=10); JsonObject& parseObject(const String& json, uint8_t nestingLimit=10); +JsonObject& parseObject(const std::string& json, uint8_t nestingLimit=10); + +// The two last overloads, which accept input streams, make copy of the input too. +JsonObject& parseObject(Stream& json, uint8_t nestingLimit=10); +JsonObject& parseObject(std::istream& json, uint8_t nestingLimit=10); ``` ##### Arguments