Max OS 0.3
Loading...
Searching...
No Matches
outputStream.cpp
Go to the documentation of this file.
1
10
11using namespace MaxOS;
12using namespace MaxOS::common;
13
22
23OutputStream::~OutputStream() = default;
24
29
30 write_char('\n');
31
32}
33
38
39 // write the text representation of a carriage return to the output stream.
40 write_char('\r');
41
42}
43
48
49}
50
57
58 write(string_to_write.c_str());
59}
60
67
68 int i = 0;
69 while (string_to_write[i] != '\0') {
70
71 switch (string_to_write[i]) {
72
73 case '\n':
74 line_feed();
75 break;
76
77 case '\r':
79 break;
80
81 case '\0':
82 return;
83
84 default:
86 break;
87
88 }
89 i++;
90 }
91}
92
99
100}
101
108
109 write(itoa(10, int_to_write));
110
111}
112
123
135
147
159
171
179
181 return *this;
182}
A stream that can be written to.
A stream that strings can be written to.
OutputStream()
Constructs an OutputStream object that uses strings as the underlying data type.
virtual void carriage_return()
Writes a carriage return to the output stream.
virtual void write_hex(uint64_t hex_to_write)
Writes a hex to the output stream.
OutputStream & operator<<(string string_to_write) override
Writes a string to the output stream.
virtual void write_int(int int_to_write)
Writes an integer to the output stream.
void write(string string_to_write) override
Writes a string to the output stream.
virtual void write_char(char char_to_write)
Writes a character to the output stream.
virtual void clear()
Clears the output stream.
virtual void line_feed()
Writes a newline to the output stream.
Stores the left, top, width and height of a rectangle.
Definition rectangle.h:22
Defines OutputStream and GenericOutputStream classes for writing data to streams.
char * itoa(int base, int64_t number)
Converts integer to string.
Definition string.cpp:703
class MaxOS::String string
Typedef for String.
char * htoa(uint64_t number)
Converts hex to string.
Definition string.cpp:738