This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
MIDI Control Surface library for Arduino
PrintStream.hpp
Go to the documentation of this file.
1 
5 #ifndef PrintStream_h
6 #define PrintStream_h
7 
8 #include <Arduino.h>
9 typedef Print &manipulator(Print &);
10 
11 Print &endl(Print &printer);
12 Print &flush(Print &printer);
13 Print &hex(Print &printer);
14 Print &bin(Print &printer);
15 Print &dec(Print &printer);
16 /* Print &oct(Print &printer); */
17 Print &boolalpha(Print &printer);
18 Print &noboolalpha(Print &printer);
19 Print &leadingzeros(Print &printer);
20 Print &noleadingzeros(Print &printer);
21 Print &uppercase(Print &printer);
22 Print &nouppercase(Print &printer);
23 Print &showbase(Print &printer);
24 Print &noshowbase(Print &printer);
25 
26 Print &operator<<(Print &printer, const __FlashStringHelper *s);
27 #ifdef ARDUINO
28 Print &operator<<(Print &printer, const String &s);
29 #endif
30 Print &operator<<(Print &printer, const char s[]);
31 Print &operator<<(Print &printer, char c);
32 Print &operator<<(Print &printer, unsigned char c);
33 Print &operator<<(Print &printer, int i);
34 Print &operator<<(Print &printer, unsigned int i);
35 Print &operator<<(Print &printer, int8_t i);
36 Print &operator<<(Print &printer, long i);
37 Print &operator<<(Print &printer, unsigned long i);
38 Print &operator<<(Print &printer, double d);
39 Print &operator<<(Print &printer, const Printable &p);
40 Print &operator<<(Print &printer, bool b);
41 
42 Print &operator<<(Print &printer, manipulator pf);
43 
44 struct Setbase { uint8_t M_base; };
45 Setbase setbase(uint8_t base);
46 Print &operator<<(Print &printer, Setbase f);
47 
48 struct Setprecision { int M_n; };
50 Print &operator<<(Print &printer, Setprecision f);
51 
52 struct Setbytesep { char M_bytesep; };
53 Setbytesep setbytesep(char bytesep);
54 Print &operator<<(Print &printer, Setbytesep f);
55 
56 
57 #ifndef ARDUINO
58 
59 #include <iostream>
60 #include <iomanip>
61 
62 // TODO: check conflicts between Arduino version and C++ STL version
63 using std::endl;
64 // using std::setbase;
65 // using std::setprecision;
66 using std::dec;
67 using std::hex;
68 using std::flush;
69 using std::boolalpha;
70 using std::noboolalpha;
71 using std::uppercase;
72 using std::nouppercase;
73 using std::showbase;
74 using std::noshowbase;
75 
76 inline std::ostream &operator<<(std::ostream &os, uint8_t u) {
77  // I'm lazy, I should probably implement one for uint8_t to get the leading
78  // zeros right
79  return os << (unsigned short)u;
80 }
81 
82 #endif
83 
84 #endif // PrintStream_h
setprecision
Setprecision setprecision(int n)
Definition: PrintStream.cpp:193
manipulator
Print & manipulator(Print &)
PrintStream library
Definition: PrintStream.hpp:9
uppercase
Print & uppercase(Print &printer)
Definition: PrintStream.cpp:35
setbase
Setbase setbase(uint8_t base)
Definition: PrintStream.cpp:177
Setbytesep::M_bytesep
char M_bytesep
Definition: PrintStream.hpp:52
Setbytesep
Definition: PrintStream.hpp:52
noleadingzeros
Print & noleadingzeros(Print &printer)
Definition: PrintStream.cpp:95
Setbase
Definition: PrintStream.hpp:44
boolalpha
Print & boolalpha(Print &printer)
Definition: PrintStream.cpp:82
noshowbase
Print & noshowbase(Print &printer)
Definition: PrintStream.cpp:50
flush
Print & flush(Print &printer)
Definition: PrintStream.cpp:55
setbytesep
Setbytesep setbytesep(char bytesep)
Definition: PrintStream.cpp:185
bin
Print & bin(Print &printer)
Definition: PrintStream.cpp:72
showbase
Print & showbase(Print &printer)
Definition: PrintStream.cpp:45
leadingzeros
Print & leadingzeros(Print &printer)
Definition: PrintStream.cpp:91
operator<<
Print & operator<<(Print &printer, const __FlashStringHelper *s)
Definition: PrintStream.cpp:99
endl
Print & endl(Print &printer)
Definition: PrintStream.cpp:27
Setbase::M_base
uint8_t M_base
Definition: PrintStream.hpp:44
nouppercase
Print & nouppercase(Print &printer)
Definition: PrintStream.cpp:40
dec
Print & dec(Print &printer)
Definition: PrintStream.cpp:77
noboolalpha
Print & noboolalpha(Print &printer)
Definition: PrintStream.cpp:86
Setprecision
Definition: PrintStream.hpp:48
Setprecision::M_n
int M_n
Definition: PrintStream.hpp:48
hex
Print & hex(Print &printer)
Definition: PrintStream.cpp:62