From 0558244645611f314f47e0fa427f7323ce253eaf Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 7 Sep 2020 12:57:04 +0200 Subject: remove external libraries from main branch --- include/lib/ArduinoJson/JsonArraySubscript.hpp | 122 ------------------------- 1 file changed, 122 deletions(-) delete mode 100644 include/lib/ArduinoJson/JsonArraySubscript.hpp (limited to 'include/lib/ArduinoJson/JsonArraySubscript.hpp') diff --git a/include/lib/ArduinoJson/JsonArraySubscript.hpp b/include/lib/ArduinoJson/JsonArraySubscript.hpp deleted file mode 100644 index afb4dc1..0000000 --- a/include/lib/ArduinoJson/JsonArraySubscript.hpp +++ /dev/null @@ -1,122 +0,0 @@ -// ArduinoJson - arduinojson.org -// Copyright Benoit Blanchon 2014-2018 -// MIT License - -#pragma once - -#include "Configuration.hpp" -#include "JsonVariantBase.hpp" - -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable : 4522) -#endif - -namespace ArduinoJson { -namespace Internals { -class JsonArraySubscript : public JsonVariantBase { - public: - FORCE_INLINE JsonArraySubscript(JsonArray& array, size_t index) - : _array(array), _index(index) {} - - FORCE_INLINE JsonArraySubscript& operator=(const JsonArraySubscript& src) { - _array.set(_index, src); - return *this; - } - - // Replaces the value - // - // operator=(const TValue&) - // TValue = bool, long, int, short, float, double, RawJson, JsonVariant, - // std::string, String, JsonArray, JsonObject - template - FORCE_INLINE JsonArraySubscript& operator=(const T& src) { - _array.set(_index, src); - return *this; - } - // - // operator=(TValue) - // TValue = char*, const char*, const FlashStringHelper* - template - FORCE_INLINE JsonArraySubscript& operator=(T* src) { - _array.set(_index, src); - return *this; - } - - FORCE_INLINE bool success() const { - return _index < _array.size(); - } - - template - FORCE_INLINE typename JsonVariantAs::type as() const { - return _array.get(_index); - } - - template - FORCE_INLINE bool is() const { - return _array.is(_index); - } - - // Replaces the value - // - // bool set(const TValue&) - // TValue = bool, long, int, short, float, double, RawJson, JsonVariant, - // std::string, String, JsonArray, JsonObject - template - FORCE_INLINE bool set(const TValue& value) { - return _array.set(_index, value); - } - // - // bool set(TValue) - // TValue = char*, const char*, const FlashStringHelper* - template - FORCE_INLINE bool set(TValue* value) { - return _array.set(_index, value); - } - // - // bool set(TValue, uint8_t decimals); - // TValue = float, double - template - DEPRECATED("Second argument is not supported anymore") - FORCE_INLINE bool set(const TValue& value, uint8_t) { - return _array.set(_index, value); - } - - private: - JsonArray& _array; - const size_t _index; -}; - -template -inline JsonArraySubscript JsonVariantSubscripts::operator[]( - size_t index) { - return impl()->template as()[index]; -} - -template -inline const JsonArraySubscript JsonVariantSubscripts::operator[]( - size_t index) const { - return impl()->template as()[index]; -} - -#if ARDUINOJSON_ENABLE_STD_STREAM -inline std::ostream& operator<<(std::ostream& os, - const JsonArraySubscript& source) { - return source.printTo(os); -} -#endif -} - -inline Internals::JsonArraySubscript JsonArray::operator[](size_t index) { - return Internals::JsonArraySubscript(*this, index); -} - -inline const Internals::JsonArraySubscript JsonArray::operator[]( - size_t index) const { - return Internals::JsonArraySubscript(*const_cast(this), index); -} -} - -#ifdef _MSC_VER -#pragma warning(pop) -#endif -- cgit v1.2.3