Line | |
---|
1 | // Copyright Benoit Blanchon 2014-2016
|
---|
2 | // MIT License
|
---|
3 | //
|
---|
4 | // Arduino JSON library
|
---|
5 | // https://github.com/bblanchon/ArduinoJson
|
---|
6 | // If you like this project, please add a star!
|
---|
7 |
|
---|
8 | #pragma once
|
---|
9 |
|
---|
10 | #include "Arduino/String.hpp"
|
---|
11 |
|
---|
12 | namespace ArduinoJson {
|
---|
13 |
|
---|
14 | // Represents a key in a JsonObject
|
---|
15 | class JsonObjectKey {
|
---|
16 | public:
|
---|
17 | JsonObjectKey(const char* key) : _value(key), _needs_copy(false) {}
|
---|
18 | JsonObjectKey(const String& key) : _value(key.c_str()), _needs_copy(true) {}
|
---|
19 |
|
---|
20 | const char* c_str() const { return _value; }
|
---|
21 | bool needs_copy() const { return _needs_copy; }
|
---|
22 |
|
---|
23 | private:
|
---|
24 | const char* _value;
|
---|
25 | bool _needs_copy;
|
---|
26 | };
|
---|
27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.