11 #ifndef __IOSTREAM_HEADER
12 #define __IOSTREAM_HEADER
17 #include "../util/has_print.hpp"
28 end = break_connection;
36 #define TYPEDEF(NAME) typedef typename NAME::NAME ## _type NAME ## _type; NAME ## _type NAME ## _;
45 size_t write(uint8_t) {
49 size_t impl_chooser(
const __FlashStringHelper * arg, Print * printer) {
return printer->print(arg);}
50 size_t impl_chooser(
const String & arg, Print * printer) {
return printer->print(arg);}
51 size_t impl_chooser(
const char arg[], Print * printer) {
return printer->print(arg);}
52 size_t impl_chooser(
char arg, Print * printer) {
return printer->print(arg);}
53 size_t impl_chooser(
const Printable& arg, Print * printer) {
return printer->print(arg);}
55 size_t impl_chooser(
unsigned char arg, Print * printer) {
return printer->print(arg, setbase_);}
56 size_t impl_chooser(
int arg, Print * printer) {
return printer->print(arg, setbase_);}
57 size_t impl_chooser(
unsigned int arg, Print * printer) {
return printer->print(arg, setbase_);}
58 size_t impl_chooser(
long arg, Print * printer) {
return printer->print(arg, setbase_);}
59 size_t impl_chooser(
unsigned long arg, Print * printer) {
return printer->print(arg, setbase_);}
60 size_t impl_chooser(uint64_t arg, Print * printer) {
return printer->print((
unsigned long)arg, setbase_);}
62 size_t impl_chooser(
double arg, Print * printer) {
return printer->print(arg, setprecision_);}
65 void init(
long const & speed = 460800lu) {
67 Serial.setTimeout(100000000L);
80 setw_type
s = impl_chooser(arg,
this);
82 for(setw_type
i = s;
i < setw_; ++
i)
87 impl_chooser(arg, &
Serial);
104 #define IOMANIP_IMPL(NAME) \
105 cout_class & operator<<(NAME const & NAME ## _in) { \
106 NAME ## _ = NAME ## _in(); \
120 else if(option == 1) {
125 else if(option == 2) {
138 operator bool()
const {
150 const uint8_t key_enter = 13;
151 const uint8_t key_space =
' ';
164 uint8_t dot_pos = 0xFF;
174 if(chr == key_enter or chr == key_space) {
179 if(chr >=
'0' and chr <=
'9') {
187 if(dot_pos == 0xFF and chr ==
'.') {
199 for(;dot_pos; --dot_pos)
223 #endif //__IOSTREAM_HEADER
bool end
Definition: iostream.hpp:31
void init(long const &speed=460800lu)
Definition: iostream.hpp:65
disable_if< util::has_print< T >::value, cout_class >::type & operator<<(T const &arg)
Definition: iostream.hpp:79
enable_if< is_arithmetic< T >::value, cin_class >::type const & operator>>(T &in) const
Definition: iostream.hpp:149
void set_silent(bool const &s)
Definition: iostream.hpp:215
Definition: type_traits.hpp:228
#define IOMANIP_IMPL(NAME)
Definition: iostream.hpp:104
endl_class & operator()(bool break_connection)
Definition: iostream.hpp:27
cout_class & operator<<(endl_class &endl_)
Definition: iostream.hpp:95
cin_class()
Definition: iostream.hpp:136
Definition: iostream.hpp:34
#define TYPEDEF(NAME)
Definition: iostream.hpp:36
struct ustd::cin_class cin
#define NONE
Definition: color.hpp:37
Definition: type_traits.hpp:235
enable_if< util::has_print< T >::value, cout_class >::type & operator<<(T const &arg)
Definition: iostream.hpp:74
struct ustd::endl_class endl
char peek() const
Definition: iostream.hpp:209
char read() const
Definition: iostream.hpp:212
size_type available()
Definition: std_serial.hpp:82
cout_class & operator<<(detail::dummy_struct const &)
Definition: iostream.hpp:100
endl_class()
Definition: iostream.hpp:25
cout_class & operator()(uint8_t const &option=2)
Definition: iostream.hpp:116
Definition: type_traits.hpp:169
Definition: iostream.hpp:24
void flush()
Definition: std_serial.hpp:117
Definition: type_traits.hpp:73
char read()
Definition: std_serial.hpp:110
Definition: iostream.hpp:135
cout_class & flush()
Definition: iostream.hpp:91