Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion JsonListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p

#pragma once

#include <Arduino.h>
#include "crossplatform.h"

class JsonListener {
private:
Expand Down
2 changes: 1 addition & 1 deletion JsonStreamingParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ See more at http://blog.squix.ch and https://github.com/squix78/json-streaming-p

#pragma once

#include <Arduino.h>
#include "crossplatform.h"
#include "JsonListener.h"

#define STATE_START_DOCUMENT 0
Expand Down
35 changes: 35 additions & 0 deletions crossplatform.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef __MULTIPLATFORM_H__
#define __MULTIPLATFORM_H__

#ifdef ARDUINO
#include <Arduino.h>
#else

#include <string>
// #include <string.h>

template<typename T> inline T min(T a, T b){
return a > b ? b : a;
}
template<typename T> inline T max(T a, T b){
return a > b ? a : b;
}

typedef bool boolean;

class String : public std::string {
public:
String(const char* c_str) : std::string(c_str) {}
String(std::string str) : std::string(str) {}

boolean equals(String other){
return compare(other) == 0;
}

String operator +(String other){
return String(this->append(other));
}
};

#endif // ARDUINO
#endif // __MULTIPLATFORM_H__