Skip to content

Commit

Permalink
Merge pull request squix78#2 from descarte1/non-arduino
Browse files Browse the repository at this point in the history
Non arduino
  • Loading branch information
descarte1 authored Dec 6, 2016
2 parents 74e868e + 1d2d2a7 commit 822f89a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions JsonListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p

#pragma once

#ifdef ARDUINO
#include <Arduino.h>
#else
#include "MockArduino.h"
#endif

class JsonListener {
private:
Expand Down
8 changes: 4 additions & 4 deletions JsonStreamingParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void JsonStreamingParser::reset() {
unicodeBufferPos = 0;
characterCounter = 0;
}

void JsonStreamingParser::setListener(JsonListener* listener) {
myListener = listener;
}
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions JsonStreamingParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p

#pragma once

#ifdef ARDUINO
#include <Arduino.h>
#else
#include "MockArduino.h"
#endif
#include "JsonListener.h"

#define STATE_START_DOCUMENT 0
Expand Down

0 comments on commit 822f89a

Please sign in to comment.