diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2020-09-07 12:57:04 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2020-09-07 12:57:04 +0200 |
commit | 0558244645611f314f47e0fa427f7323ce253eaf (patch) | |
tree | 824bcd55ec8577703345106d0a08e167407500a7 /include/lib/ArduinoJson/JsonObjectSubscript.hpp | |
parent | 0248c6352f2117e50fac71dd632a79d8fa4f8737 (diff) |
remove external libraries from main branch
Diffstat (limited to 'include/lib/ArduinoJson/JsonObjectSubscript.hpp')
-rw-r--r-- | include/lib/ArduinoJson/JsonObjectSubscript.hpp | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/include/lib/ArduinoJson/JsonObjectSubscript.hpp b/include/lib/ArduinoJson/JsonObjectSubscript.hpp deleted file mode 100644 index 6ac4763..0000000 --- a/include/lib/ArduinoJson/JsonObjectSubscript.hpp +++ /dev/null @@ -1,110 +0,0 @@ -// ArduinoJson - arduinojson.org -// Copyright Benoit Blanchon 2014-2018 -// MIT License - -#pragma once - -#include "Configuration.hpp" -#include "JsonVariantBase.hpp" -#include "TypeTraits/EnableIf.hpp" - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4522) -#endif - -namespace ArduinoJson { -namespace Internals { - -template <typename TStringRef> -class JsonObjectSubscript - : public JsonVariantBase<JsonObjectSubscript<TStringRef> > { - typedef JsonObjectSubscript<TStringRef> this_type; - - public: - FORCE_INLINE JsonObjectSubscript(JsonObject& object, TStringRef key) - : _object(object), _key(key) {} - - FORCE_INLINE this_type& operator=(const this_type& src) { - _object.set(_key, src); - return *this; - } - - // Set the specified value - // - // operator=(const TValue&); - // TValue = bool, char, long, int, short, float, double, - // std::string, String, JsonArray, JsonObject - template <typename TValue> - FORCE_INLINE typename EnableIf<!IsArray<TValue>::value, this_type&>::type - operator=(const TValue& src) { - _object.set(_key, src); - return *this; - } - // - // operator=(TValue); - // TValue = char*, const char*, const FlashStringHelper* - template <typename TValue> - FORCE_INLINE this_type& operator=(TValue* src) { - _object.set(_key, src); - return *this; - } - - FORCE_INLINE bool success() const { - return _object.containsKey(_key); - } - - template <typename TValue> - FORCE_INLINE typename JsonVariantAs<TValue>::type as() const { - return _object.get<TValue>(_key); - } - - template <typename TValue> - FORCE_INLINE bool is() const { - return _object.is<TValue>(_key); - } - - // Sets the specified value. - // - // bool set(const TValue&); - // TValue = bool, char, long, int, short, float, double, RawJson, JsonVariant, - // std::string, String, JsonArray, JsonObject - template <typename TValue> - FORCE_INLINE typename EnableIf<!IsArray<TValue>::value, bool>::type set( - const TValue& value) { - return _object.set(_key, value); - } - // - // bool set(TValue); - // TValue = char*, const char, const FlashStringHelper* - template <typename TValue> - FORCE_INLINE bool set(const TValue* value) { - return _object.set(_key, value); - } - // - // bool set(TValue, uint8_t decimals); - // TValue = float, double - template <typename TValue> - DEPRECATED("Second argument is not supported anymore") - FORCE_INLINE bool set(const TValue& value, uint8_t) { - return _object.set(_key, value); - } - - private: - JsonObject& _object; - TStringRef _key; -}; - -#if ARDUINOJSON_ENABLE_STD_STREAM -template <typename TStringRef> -inline std::ostream& operator<<(std::ostream& os, - const JsonObjectSubscript<TStringRef>& source) { - return source.printTo(os); -} -#endif -} -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif |