mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Renamed JsonKey to JsonString
This commit is contained in:
32
src/ArduinoJson/Strings/String.hpp
Normal file
32
src/ArduinoJson/Strings/String.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
|
||||
class String {
|
||||
public:
|
||||
String() : _data(0) {}
|
||||
String(const char* slot) : _data(slot) {}
|
||||
|
||||
const char* c_str() const {
|
||||
return _data;
|
||||
}
|
||||
|
||||
bool isNull() const {
|
||||
return !_data;
|
||||
}
|
||||
|
||||
friend bool operator==(String lhs, String rhs) {
|
||||
if (lhs._data == rhs._data) return true;
|
||||
if (!lhs._data) return false;
|
||||
if (!rhs._data) return false;
|
||||
return strcmp(lhs._data, rhs._data) == 0;
|
||||
}
|
||||
|
||||
private:
|
||||
const char* _data;
|
||||
};
|
||||
} // namespace ARDUINOJSON_NAMESPACE
|
||||
Reference in New Issue
Block a user