// ArduinoJson - https://arduinojson.org // Copyright Benoit Blanchon 2014-2021 // MIT License #pragma once #include "lib/ArduinoJson/Polyfills/type_traits.hpp" namespace ARDUINOJSON_NAMESPACE { template struct IsCharOrVoid { static const bool value = is_same::value || is_same::value || is_same::value || is_same::value; }; template struct IsCharOrVoid : IsCharOrVoid {}; template struct Reader::value>::type> { const char* _ptr; public: explicit Reader(const void* ptr) : _ptr(ptr ? reinterpret_cast(ptr) : "") {} int read() { return static_cast(*_ptr++); } size_t readBytes(char* buffer, size_t length) { for (size_t i = 0; i < length; i++) buffer[i] = *_ptr++; return length; } }; template struct BoundedReader::value>::type> : public IteratorReader { public: explicit BoundedReader(const void* ptr, size_t len) : IteratorReader(reinterpret_cast(ptr), reinterpret_cast(ptr) + len) {} }; } // namespace ARDUINOJSON_NAMESPACE