Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
PrintStream.hpp
Go to the documentation of this file.
1
5#ifndef PrintStream_h
6#define PrintStream_h
7
8#include <AH/Arduino-Wrapper.h> // Print
10
12
15
16typedef Print &manipulator(Print &);
17
18Print &endl(Print &printer);
19Print &flush(Print &printer);
20Print &hex(Print &printer);
21Print &bin(Print &printer);
22Print &dec(Print &printer);
23/* Print &oct(Print &printer); */
24Print &boolalpha(Print &printer);
25Print &noboolalpha(Print &printer);
26Print &leadingzeros(Print &printer);
27Print &noleadingzeros(Print &printer);
28Print &uppercase(Print &printer);
29Print &nouppercase(Print &printer);
30Print &showbase(Print &printer);
31Print &noshowbase(Print &printer);
32
33Print &operator<<(Print &printer, const __FlashStringHelper *s);
34#ifdef ARDUINO
35Print &operator<<(Print &printer, const String &s);
36#endif
37Print &operator<<(Print &printer, const char s[]);
38Print &operator<<(Print &printer, char c);
39Print &operator<<(Print &printer, unsigned char c);
40Print &operator<<(Print &printer, int i);
41Print &operator<<(Print &printer, unsigned int i);
42Print &operator<<(Print &printer, int8_t i);
43Print &operator<<(Print &printer, long i);
44Print &operator<<(Print &printer, unsigned long i);
45Print &operator<<(Print &printer, float f);
46Print &operator<<(Print &printer, double d);
47Print &operator<<(Print &printer, const Printable &p);
48Print &operator<<(Print &printer, bool b);
49
50Print &operator<<(Print &printer, manipulator pf);
51
52struct Setbase {
54};
55Setbase setbase(uint8_t base);
56Print &operator<<(Print &printer, Setbase f);
57
59 int M_n;
60};
61Setprecision setprecision(int n);
62Print &operator<<(Print &printer, Setprecision f);
63
64struct Setbytesep {
66};
67Setbytesep setbytesep(char bytesep);
68Print &operator<<(Print &printer, Setbytesep f);
69
70struct HexDump {
71 HexDump(const uint8_t *data, size_t length) : data(data), length(length) {}
72 template <size_t N>
73 explicit HexDump(const uint8_t (&data)[N]) : HexDump {data, N} {}
74 const uint8_t *data;
75 size_t length;
76};
77
78Print &operator<<(Print &p, HexDump h);
79
81
83
84#ifndef ARDUINO
85
86#include <iomanip>
87#include <iostream>
88
90
91// TODO: check conflicts between Arduino version and C++ STL version
92using std::endl;
93// using std::setbase;
94// using std::setprecision;
95using std::boolalpha;
96using std::dec;
97using std::flush;
98using std::hex;
99using std::noboolalpha;
100using std::noshowbase;
101using std::nouppercase;
102using std::showbase;
103using std::uppercase;
104
105inline std::ostream &operator<<(std::ostream &os, uint8_t u) {
106 // I'm lazy, I should probably implement one for uint8_t to get the leading
107 // zeros right
109}
110
111inline std::ostream &operator<<(std::ostream &os,
112 const __FlashStringHelper *s) {
113 return os << reinterpret_cast<const char *>(s);
114}
115
116std::ostream &operator<<(std::ostream &p, HexDump h);
117
119
120#endif
121
122#include <Settings/NamespaceSettings.hpp>
123
125using AH::operator<<;
126using AH::manipulator;
127using AH::endl;
128using AH::flush;
129using AH::hex;
130using AH::bin;
131using AH::dec;
132using AH::boolalpha;
133using AH::noboolalpha;
134using AH::leadingzeros;
136using AH::uppercase;
137using AH::nouppercase;
138using AH::showbase;
139using AH::noshowbase;
140using AH::setbase;
141using AH::setprecision;
142using AH::setbytesep;
144
145#endif // PrintStream_h
#define END_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
Print & operator<<(Print &os, Cable c)
Definition Cable.cpp:6
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Print & hex(Print &printer)
Print & bin(Print &printer)
Print & nouppercase(Print &printer)
Print & endl(Print &printer)
Print & uppercase(Print &printer)
Print & flush(Print &printer)
Print & showbase(Print &printer)
Print & manipulator(Print &)
Print & boolalpha(Print &printer)
Setbytesep setbytesep(char bytesep)
Print & leadingzeros(Print &printer)
Print & noshowbase(Print &printer)
Print & dec(Print &printer)
Print & noboolalpha(Print &printer)
Print & noleadingzeros(Print &printer)
Setbase setbase(uint8_t base)
Setprecision setprecision(int n)
An array wrapper for easy copying, comparing, and iterating.
Definition Array.hpp:32
const uint8_t * data
HexDump(const uint8_t *data, size_t length)
HexDump(const uint8_t(&data)[N])
uint8_t M_base