![]() |
Max OS 0.3
|
A stream that strings can be written to. More...
#include <outputStream.h>
Public Member Functions | |
| OutputStream () | |
| Constructs an OutputStream object that uses strings as the underlying data type. | |
| virtual void | line_feed () |
| Writes a newline to the output stream. | |
| virtual void | carriage_return () |
| Writes a carriage return to the output stream. | |
| virtual void | clear () |
| Clears the output stream. | |
| void | write (string string_to_write) override |
| Writes a string to the output stream. | |
| void | write (const char *string_to_write) |
| Writes a string to the output stream. | |
| virtual void | write_char (char char_to_write) |
| Writes a character to the output stream. | |
| virtual void | write_int (int int_to_write) |
| Writes an integer 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. | |
| OutputStream & | operator<< (const char *string_to_write) |
| Writes a string to the output stream. | |
| OutputStream & | operator<< (int int_to_write) |
| Writes a integer to the output stream. | |
| OutputStream & | operator<< (uint64_t hex_to_write) |
| Writes a hexadecimal to the output stream. | |
| OutputStream & | operator<< (char char_to_write) |
| Writes a character to the output stream. | |
Public Member Functions inherited from MaxOS::common::GenericOutputStream< string > | |
| GenericOutputStream () | |
| __________________________________________Templates__________________________________________________/// | |
| ~GenericOutputStream () | |
| Destructor of the GenericOutputStream class. | |
| void | on_stream_read (string) override |
| Writes the date that was read from the input stream to the output stream. | |
| void | on_end_of_stream (GenericInputStream< string > *) override |
| Close the stream and remove it from the list of streams when the end of the stream is reached. | |
| virtual void | write (string) |
| write an element to the stream. | |
| virtual void | close () |
| Close the stream. | |
| virtual GenericOutputStream< string > & | operator<< (string) |
| Overload the << operator to write an element to the stream. | |
Public Member Functions inherited from MaxOS::common::InputStreamProcessor< Type, ProcessorType > | |
| InputStreamProcessor () | |
| Creates a new InputStreamProcessor. | |
| InputStreamProcessor (InputStreamEventHandler< ProcessorType > *generic_stream_event_handler) | |
| Creates a new InputStreamProcessor. | |
| ~InputStreamProcessor () | |
| Destroys the InputStreamProcessor. | |
| void | on_end_of_stream (GenericInputStream< Type > *stream) override |
| Called when a stream has finished. Passes the event on to the handlers and then removes the stream from the array of streams. | |
Public Member Functions inherited from MaxOS::common::InputStreamEventHandler< Type > | |
| InputStreamEventHandler () | |
| _______________________________________________TEMPLATES_________________________________________________________________/// | |
| ~InputStreamEventHandler () | |
| Destroys the InputStreamProcessor and disconnects it from all streams. | |
Public Member Functions inherited from MaxOS::common::GenericInputStream< ProcessorType > | |
| GenericInputStream () | |
| Creates a new GenericInputStream. | |
| GenericInputStream (InputStreamEventHandler< ProcessorType > *) | |
| Creates a new GenericInputStream and connects it to the handler. | |
| ~GenericInputStream () | |
| Destroys the GenericInputStream and disconnects all handlers. | |
| void | connect_input_stream_event_handler (InputStreamEventHandler< ProcessorType > *) |
| Adds a inputStreamEventHandler to the list of internetProtocolHandlers. | |
| void | disconnect_input_stream_event_handler (InputStreamEventHandler< ProcessorType > *) |
| Removes a handler from the list of handlers. | |
Additional Inherited Members | |
Protected Attributes inherited from MaxOS::common::InputStreamEventHandler< Type > | |
| common::Vector< GenericInputStream< Type > * > | m_generic_input_streams |
| List of streams being observed by this handler. | |
Protected Attributes inherited from MaxOS::common::GenericInputStream< ProcessorType > | |
| common::Vector< InputStreamEventHandler< ProcessorType > * > | m_input_stream_event_handlers |
| List of streams being observed by this handler. | |
A stream that strings can be written to.
Definition at line 43 of file outputStream.h.
| OutputStream::OutputStream | ( | ) |
Constructs an OutputStream object that uses strings as the underlying data type.
Definition at line 17 of file outputStream.cpp.
|
virtual |
Writes a carriage return to the output stream.
Definition at line 37 of file outputStream.cpp.
References write_char().
Referenced by write().
|
virtual |
|
virtual |
Writes a newline to the output stream.
Definition at line 28 of file outputStream.cpp.
References write_char().
Referenced by write(), and MaxOS::drivers::console::ConsoleStream::write_char().
| OutputStream & OutputStream::operator<< | ( | char | char_to_write | ) |
Writes a character to the output stream.
| char_to_write | The character to write to the output stream. |
Definition at line 166 of file outputStream.cpp.
References write_char().
| OutputStream & OutputStream::operator<< | ( | const char * | string_to_write | ) |
Writes a string to the output stream.
| string_to_write | The string to write to the output stream. |
Definition at line 178 of file outputStream.cpp.
References write().
| OutputStream & OutputStream::operator<< | ( | int | int_to_write | ) |
Writes a integer to the output stream.
| int_to_write | The integer to write to the output stream. |
Definition at line 130 of file outputStream.cpp.
References write_int().
|
override |
Writes a string to the output stream.
| string_to_write | The string to write to the output stream. |
Definition at line 154 of file outputStream.cpp.
References write().
| OutputStream & OutputStream::operator<< | ( | uint64_t | hex_to_write | ) |
Writes a hexadecimal to the output stream.
| hex_to_write | The hex to write to the output stream. |
Definition at line 142 of file outputStream.cpp.
References write_hex().
Writes a string to the output stream.
| string_to_write | The string to write to the output stream. |
Definition at line 66 of file outputStream.cpp.
References carriage_return(), line_feed(), and write_char().
Writes a string to the output stream.
| string_to_write | The string to write to the output stream. |
Definition at line 56 of file outputStream.cpp.
References write().
Referenced by MaxOS::net::EthernetFrameHandler::data_received(), MaxOS::net::InternetProtocolHandler::handle_ethernetframe_payload(), MaxOS::net::TransmissionControlProtocolHandler::handle_internet_protocol_payload(), operator<<(), operator<<(), MaxOS::Logger::printf(), MaxOS::net::EthernetFrameHandler::send_ethernet_frame(), write(), MaxOS::drivers::console::ConsoleStream::write_char(), write_hex(), and write_int().
Writes a character to the output stream.
| char_to_write | The character to write to the output stream. |
Reimplemented in MaxOS::Logger, MaxOS::drivers::SerialConsole, and MaxOS::drivers::console::ConsoleStream.
Definition at line 98 of file outputStream.cpp.
Referenced by carriage_return(), line_feed(), operator<<(), write(), and MaxOS::Logger::write_char().
Writes a hex to the output stream.
| hex_to_write | The hex to write to the output stream. |
Definition at line 118 of file outputStream.cpp.
References htoa(), and write().
Referenced by MaxOS::net::EthernetFrameHandler::data_received(), and operator<<().
Writes an integer to the output stream.
| int_to_write | The integer to write to the output stream. |
Definition at line 107 of file outputStream.cpp.
References itoa(), and write().
Referenced by operator<<().