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.
StdStreamWriter.hpp
00001 // ArduinoJson - arduinojson.org 00002 // Copyright Benoit Blanchon 2014-2021 00003 // MIT License 00004 00005 #pragma once 00006 00007 #include <ostream> 00008 00009 namespace ARDUINOJSON_NAMESPACE { 00010 00011 template <typename TDestination> 00012 class Writer< 00013 TDestination, 00014 typename enable_if<is_base_of<std::ostream, TDestination>::value>::type> { 00015 public: 00016 explicit Writer(std::ostream& os) : _os(&os) {} 00017 00018 size_t write(uint8_t c) { 00019 _os->put(static_cast<char>(c)); 00020 return 1; 00021 } 00022 00023 size_t write(const uint8_t* s, size_t n) { 00024 _os->write(reinterpret_cast<const char*>(s), 00025 static_cast<std::streamsize>(n)); 00026 return n; 00027 } 00028 00029 private: 00030 std::ostream* _os; 00031 }; 00032 } // namespace ARDUINOJSON_NAMESPACE
Generated on Wed Jul 13 2022 01:10:36 by
1.7.2