Changed ::String to ArduinoJson::String (issue #275)

This commit is contained in:
Benoit Blanchon
2016-05-06 08:44:31 +02:00
parent 78728c6547
commit c5d19a4dbd
15 changed files with 41 additions and 18 deletions

View File

@ -1,6 +1,12 @@
ArduinoJson: change log
=======================
HEAD
----
* Changed `::String` to `ArduinoJson::String` (issue #275)
* Changed `::Print` to `ArduinoJson::Print` too
v5.3.0
------

View File

@ -22,6 +22,11 @@
#define ARDUINOJSON_USE_INT64 0
#endif
// arduino has its own implementation of String to replace std::string
#ifndef ARDUINOJSON_USE_ARDUINO_STRING
#define ARDUINOJSON_USE_ARDUINO_STRING 1
#endif
// arduino doesn't support STL stream
#ifndef ARDUINOJSON_ENABLE_STD_STREAM
#define ARDUINOJSON_ENABLE_STD_STREAM 0
@ -62,6 +67,11 @@
#endif
#endif
// on a computer, we can use std::string
#ifndef ARDUINOJSON_USE_ARDUINO_STRING
#define ARDUINOJSON_USE_ARDUINO_STRING 0
#endif
// on a computer, we can assume that the STL is there
#ifndef ARDUINOJSON_ENABLE_STD_STREAM
#define ARDUINOJSON_ENABLE_STD_STREAM 1

View File

@ -7,7 +7,7 @@
#pragma once
#include "../Arduino/Print.hpp"
#include "../Print.hpp"
namespace ArduinoJson {
namespace Internals {

View File

@ -7,8 +7,8 @@
#pragma once
#include "../Arduino/Print.hpp"
#include "../Arduino/String.hpp"
#include "../Print.hpp"
#include "../String.hpp"
namespace ArduinoJson {
namespace Internals {

View File

@ -7,7 +7,7 @@
#pragma once
#include "../Arduino/Print.hpp"
#include "../Print.hpp"
namespace ArduinoJson {
namespace Internals {

View File

@ -7,7 +7,7 @@
#pragma once
#include "../Arduino/Print.hpp"
#include "../Print.hpp"
namespace ArduinoJson {
namespace Internals {

View File

@ -7,10 +7,10 @@
#pragma once
#include "../Arduino/Print.hpp"
#include "../Polyfills/isNaN.hpp"
#include "../Polyfills/isInfinity.hpp"
#include "../Polyfills/isNaN.hpp"
#include "../Polyfills/normalize.hpp"
#include "../Print.hpp"
#include "Encoding.hpp"
#include "ForceInline.hpp"
#include "JsonFloat.hpp"

View File

@ -7,7 +7,7 @@
#pragma once
#include "../Arduino/Print.hpp"
#include "../Print.hpp"
namespace ArduinoJson {
namespace Internals {

View File

@ -11,7 +11,7 @@
#if ARDUINOJSON_ENABLE_STD_STREAM
#include "../Arduino/Print.hpp"
#include "../Print.hpp"
#include <ostream>

View File

@ -11,7 +11,7 @@
#include <stdint.h> // for uint8_t
#include <string.h>
#include "Arduino/String.hpp"
#include "String.hpp"
#include "JsonVariant.hpp"
#if defined(__clang__)

View File

@ -7,7 +7,7 @@
#pragma once
#include "Arduino/String.hpp"
#include "String.hpp"
#include "Internals/JsonBufferAllocated.hpp"
#include "Internals/JsonPrintable.hpp"
#include "Internals/List.hpp"

View File

@ -7,7 +7,7 @@
#pragma once
#include "Arduino/String.hpp"
#include "String.hpp"
namespace ArduinoJson {

View File

@ -12,6 +12,7 @@
#include <stddef.h>
#include <stdint.h>
namespace ArduinoJson {
// This class reproduces Arduino's Print class
class Print {
public:
@ -29,6 +30,7 @@ class Print {
size_t println() { return write('\r') + write('\n'); }
};
}
#else

View File

@ -7,13 +7,18 @@
#pragma once
#ifndef ARDUINO
#include "Configuration.hpp"
#include <string>
typedef std::string String;
#else
#if ARDUINOJSON_USE_ARDUINO_STRING
#include <WString.h>
#else
#include <string>
namespace ArduinoJson {
typedef std::string String;
}
#endif

View File

@ -5,8 +5,8 @@
// https://github.com/bblanchon/ArduinoJson
// If you like this project, please add a star!
#include <ArduinoJson.h>
#include <gtest/gtest.h>
#include <ArduinoJson/Internals/StaticStringBuilder.hpp>
using namespace ArduinoJson::Internals;