mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-16 20:12:16 +02:00
40 lines
810 B
C++
40 lines
810 B
C++
// Copyright Benoit Blanchon 2014
|
|
// MIT License
|
|
//
|
|
// Arduino JSON library
|
|
// https://github.com/bblanchon/ArduinoJson
|
|
|
|
#pragma once
|
|
|
|
#include "../ForwardDeclarations.hpp"
|
|
#include "../JsonBuffer.hpp"
|
|
|
|
namespace ArduinoJson {
|
|
namespace Internals {
|
|
|
|
class JsonParser {
|
|
public:
|
|
JsonParser(JsonBuffer *buffer, char *json) : _buffer(buffer), _ptr(json) {}
|
|
|
|
JsonArray parseArray();
|
|
JsonObject parseObject();
|
|
JsonValue parseValue();
|
|
|
|
private:
|
|
bool isEnd() { return *_ptr == 0; }
|
|
|
|
bool skip(char charToSkip);
|
|
void skipSpaces();
|
|
|
|
void parseValueTo(JsonValue);
|
|
inline void parseBooleanTo(JsonValue &destination);
|
|
inline void parseNullTo(JsonValue &destination);
|
|
inline void parseNumberTo(JsonValue &destination);
|
|
inline const char *parseString();
|
|
|
|
JsonBuffer *_buffer;
|
|
char *_ptr;
|
|
};
|
|
}
|
|
}
|