diff --git a/JsonListener.h b/JsonListener.h index 26c0d85..7cfb197 100644 --- a/JsonListener.h +++ b/JsonListener.h @@ -25,7 +25,11 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p #pragma once +#ifdef ARDUINO #include +#else +#include "MockArduino.h" +#endif class JsonListener { private: diff --git a/JsonStreamingParser.cpp b/JsonStreamingParser.cpp index 95fd05b..3ae687f 100644 --- a/JsonStreamingParser.cpp +++ b/JsonStreamingParser.cpp @@ -36,7 +36,7 @@ void JsonStreamingParser::reset() { unicodeBufferPos = 0; characterCounter = 0; } - + void JsonStreamingParser::setListener(JsonListener* listener) { myListener = listener; } @@ -434,7 +434,7 @@ void JsonStreamingParser::endDocument() { void JsonStreamingParser::endTrue() { buffer[bufferPos] = '\0'; String value = String(buffer); - if (value.equals("true")) { + if (value == "true") { myListener->value("true"); } else { // throw new ParsingError($this->_line_number, $this->_char_number, @@ -447,7 +447,7 @@ void JsonStreamingParser::endTrue() { void JsonStreamingParser::endFalse() { buffer[bufferPos] = '\0'; String value = String(buffer); - if (value.equals("false")) { + if (value == "false") { myListener->value("false"); } else { // throw new ParsingError($this->_line_number, $this->_char_number, @@ -460,7 +460,7 @@ void JsonStreamingParser::endFalse() { void JsonStreamingParser::endNull() { buffer[bufferPos] = '\0'; String value = String(buffer); - if (value.equals("null")) { + if (value == "null") { myListener->value("null"); } else { // throw new ParsingError($this->_line_number, $this->_char_number, diff --git a/JsonStreamingParser.h b/JsonStreamingParser.h index 377e846..01ad895 100644 --- a/JsonStreamingParser.h +++ b/JsonStreamingParser.h @@ -25,7 +25,11 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p #pragma once +#ifdef ARDUINO #include +#else +#include "MockArduino.h" +#endif #include "JsonListener.h" #define STATE_START_DOCUMENT 0