Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
StdStreamReader.hpp
00001 // ArduinoJson - arduinojson.org 00002 // Copyright Benoit Blanchon 2014-2021 00003 // MIT License 00004 00005 #pragma once 00006 00007 #include <istream> 00008 00009 namespace ARDUINOJSON_NAMESPACE { 00010 00011 template <typename TSource> 00012 struct Reader<TSource, typename enable_if< 00013 is_base_of<std::istream, TSource>::value>::type> { 00014 public: 00015 explicit Reader(std::istream& stream) : _stream(&stream) {} 00016 00017 int read() { 00018 return _stream->get(); 00019 } 00020 00021 size_t readBytes(char* buffer, size_t length) { 00022 _stream->read(buffer, static_cast<std::streamsize>(length)); 00023 return static_cast<size_t>(_stream->gcount()); 00024 } 00025 00026 private: 00027 std::istream* _stream; 00028 }; 00029 } // namespace ARDUINOJSON_NAMESPACE
Generated on Wed Jul 13 2022 01:10:36 by
1.7.2