mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Extracted StringReader and StringWriter from JsonParser
Split `Internals/` folder into `Data/`, `Deserialization/`, `Serialization/`
This commit is contained in:
36
include/ArduinoJson/Deserialization/StringWriter.hpp
Normal file
36
include/ArduinoJson/Deserialization/StringWriter.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright Benoit Blanchon 2014-2016
|
||||
// MIT License
|
||||
//
|
||||
// Arduino JSON library
|
||||
// https://github.com/bblanchon/ArduinoJson
|
||||
// If you like this project, please add a star!
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace ArduinoJson {
|
||||
namespace Internals {
|
||||
|
||||
// Parse JSON string to create JsonArrays and JsonObjects
|
||||
// This internal class is not indended to be used directly.
|
||||
// Instead, use JsonBuffer.parseArray() or .parseObject()
|
||||
class StringWriter {
|
||||
public:
|
||||
StringWriter(char *buffer) : _ptr(buffer) {}
|
||||
|
||||
const char *startString() {
|
||||
return _ptr;
|
||||
}
|
||||
|
||||
void stopString() {
|
||||
*_ptr++ = 0;
|
||||
}
|
||||
|
||||
void append(char c) {
|
||||
*_ptr++ = c;
|
||||
}
|
||||
|
||||
private:
|
||||
char *_ptr;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user