|
LRAUV
revA
|
This is a very abstract class that can be implemented by classes that want to send stream output. More...
#include <OutStream.h>

Public Member Functions | |
| virtual | ~OutStream () |
| Destructor. More... | |
| virtual OutStream & | write (const char *buffer, size_t num)=0 |
| writes num bytes from buffer to the output buffer/stream More... | |
| virtual OutStream & | writeHex (const char *buffer, size_t num) |
| writes num bytes from buffer to the output buffer/stream as hex chars More... | |
| virtual bool | isWritable ()=0 |
| indicates whether the stream can actually be written to. More... | |
| virtual OutStream & | write (const char *buffer) |
| writes zero-terminated buffer to the output buffer/stream More... | |
| virtual OutStream & | writeHex (const char *buffer) |
| writes zero-terminated buffer to the output buffer/stream More... | |
| OutStream & | operator<< (const Str buffer) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const char buffer[]) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const char byte) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const signed char byte) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const unsigned char byte) |
| write a Str, using stream operator More... | |
| OutStream & | operator<< (const int number) |
| write a Str, using stream operator More... | |
| OutStream & | writeChar (const signed char value) |
| writes a single byte to the output buffer/stream More... | |
| OutStream & | writeCharHex (const signed char byte) |
| writes a single signed char to the output buffer/stream as 2 hex chars More... | |
| OutStream & | writeUCharHex (const unsigned char byte) |
| writes a single unsigned char to the output buffer/stream as 2 hex chars More... | |
| OutStream & | writeInteger (const int number, const unsigned int radix=10) |
| writes an integer as a base-radix string More... | |
| OutStream & | writeNumber (const double number, const unsigned int radix=10) |
| OutStream & | writeShort (const short value) |
| writes a single short to the output buffer/stream More... | |
| OutStream & | writeShortHex (const short word) |
| writes a single short to the output buffer/stream as 4 hex chars More... | |
| OutStream & | writeUShortHex (const unsigned short word) |
| writes a single unsigned short to the output buffer/stream as 4 hex chars More... | |
| OutStream & | writeUShortCompact (const unsigned short &value) |
| writes an unsigned short integer as 1 to 3 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 16 bit value, encoded in 3 bytes More... | |
| OutStream & | writeInt24 (const int medInt) |
| writes a 3-byte integer to the output buffer/stream only works on little-endian machines! More... | |
| OutStream & | writeInt (const int value) |
| writes a 4-byte integer to the output buffer/stream More... | |
| OutStream & | writeLongLong (const long long value) |
| writes a 8-byte integer to the output buffer/stream More... | |
| OutStream & | writeLongLongCompact (const long long &value) |
| writes a signed long long integer as 1 to 9 bytes, encoded as follows: 0xxxxxxx - 7 bit value, encoded in 1 byte 10xxxxxx+1byte - 14 bit value, encoded in 2 bytes 110xxxxx+2bytes - 21 bit value, encoded in 3 bytes 1110xxxx+3bytes - 28 bit value, encoded in 4 bytes 11110xxx+4bytes - 35 bit value, encoded in 5 bytes 111110xx+5bytes - 42 bit value, encoded in 6 bytes 1111110x+6bytes - 49 bit value, encoded in 7 bytes 11111110+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes More... | |
| OutStream & | writeFloat (const float value) |
| writes a 4-byte float to the output buffer/stream More... | |
| OutStream & | writeFloat2 (const float value) |
| writes a 2-byte float to the output buffer/stream More... | |
| OutStream & | writeFloat3 (const float value) |
| writes a 3-byte float to the output buffer/stream More... | |
| OutStream & | writeDouble (const double value) |
| writes a 8-byte double to the output buffer/stream More... | |
| OutStream & | writeDouble6 (const double value) |
| size_t | bytesWritten () |
Protected Member Functions | |
| OutStream () | |
| Protected Constructor for abstract class. More... | |
Protected Attributes | |
| size_t | lastWritten_ |
Static Protected Attributes | |
| static const unsigned char | HEX_CHARS [] = "0123456789ABCDEF" |
Private Member Functions | |
| OutStream (const OutStream &old) | |
This is a very abstract class that can be implemented by classes that want to send stream output.
Provides basic input functions such as write(), as well as specialized functions for reading in data formats such as writeCharHex, etc.
Part of an attempt to avoid the standard template library
|
inlinevirtual |
Destructor.
|
inlineprotected |
Protected Constructor for abstract class.
|
private |
|
inline |
References lastWritten_.
Referenced by MtxIOStream::append(), MissionStateLogger::LogArgWrite(), MissionStateLogger::NewRun(), MissionStateLogger::SetActive(), MissionStateLogger::SetRepeatIndex(), MappedIOStream_Test::test1Write(), StrIOStream_Test::testWrite(), UChar::toStream(), Short::toStream(), UShort::toStream(), Double4::toStream(), Float3::toStream(), Float2::toStream(), Double6::toStream(), Int::toStream(), Float::toStream(), Double::toStream(), MtxOutStream::write(), KmlLogWriter::write(), MtxIOStream::write(), CodedStr::write(), SyslogEntry::write(), DirectoryEntry::write(), ElementURI::write(), DataEntry::write(), DataAccess::write(), EventEntry::write(), KmlLogWriter::writeFooter(), TextTableLogWriter::writeHeader(), KmlLogWriter::writeHeader(), TextTableLogWriter::writeRow(), KmlLogWriter::writeSyslogItems(), and LogEntry::writeTimestamp().
|
pure virtual |
indicates whether the stream can actually be written to.
Implemented in NullOutStream, UartStream, FileIOStream, StrIOStream, MappedIOStream, NullIOStream, FileOutStream, CommandLine, and DeviceIOStream.
Referenced by LogWriter::isValid(), BinaryLogWriter::writeHeader(), and TextLogWriter::writeHeader().
write a Str, using stream operator
References Str::cStr(), Str::length(), and write().
|
inline |
|
inline |
write a Str, using stream operator
References writeChar().
|
inline |
write a Str, using stream operator
References writeChar().
|
inline |
write a Str, using stream operator
References writeChar().
|
inline |
write a Str, using stream operator
References writeInteger().
|
pure virtual |
writes num bytes from buffer to the output buffer/stream
Implemented in UartStream, StrIOStream, FileIOStream, CommandLine, MappedIOStream, DeviceIOStream, and FileOutStream.
Referenced by operator<<(), UChar::toStream(), Int::toStream(), Double::toStream(), Float::toStream(), StrValue::toStream(), KmlLogWriter::write(), CodedStr::write(), TextLogWriter::write(), write(), SyslogEntry::write(), ElementURI::write(), DataAccess::write(), EventEntry::write(), writeChar(), writeDouble(), writeDouble6(), writeFloat(), writeFloat2(), writeFloat3(), KmlLogWriter::writeFooter(), TextTableLogWriter::writeHeader(), KmlLogWriter::writeHeader(), writeInt(), writeInt24(), writeInteger(), writeLongLong(), writeLongLongCompact(), TextTableLogWriter::writeRow(), writeShort(), KmlLogWriter::writeSyslogItems(), and writeUShortCompact().
|
inlinevirtual |
writes zero-terminated buffer to the output buffer/stream
Reimplemented in FileIOStream, MappedIOStream, and FileOutStream.
References write().
|
inline |
writes a single byte to the output buffer/stream
References write().
Referenced by MissionStateLogger::LogArgWrite(), MissionStateLogger::NewRun(), operator<<(), MissionStateLogger::SetActive(), MissionStateLogger::SetRepeatIndex(), TextLogWriter::write(), DirectoryEntry::write(), ElementURI::write(), EventEntry::write(), writeCharHex(), TextTableLogWriter::writeHeader(), writeLongLongCompact(), TextTableLogWriter::writeRow(), writeShortHex(), writeUCharHex(), writeUShortCompact(), and writeUShortHex().
| OutStream & OutStream::writeCharHex | ( | const signed char | byte | ) |
writes a single signed char to the output buffer/stream as 2 hex chars
writes a single unsigned char to the output buffer/stream as 2 hex chars
References HEX_CHARS, lastWritten_, and writeChar().
Referenced by ElementURI::write(), DataAccess::write(), and writeHex().
|
inline |
writes a 8-byte double to the output buffer/stream
References write().
|
inline |
References write().
Referenced by Double6::toStream().
|
inline |
writes a 4-byte float to the output buffer/stream
References write().
Referenced by MtxIOStream::append(), MissionStateLogger::LogArgWrite(), MissionStateLogger::NewRun(), Double4::toStream(), MtxOutStream::write(), and MtxIOStream::write().
|
inline |
writes a 2-byte float to the output buffer/stream
References write().
Referenced by Float2::toStream(), and EventEntry::write().
|
inline |
writes a 3-byte float to the output buffer/stream
References write().
Referenced by Float3::toStream().
|
virtual |
writes num bytes from buffer to the output buffer/stream as hex chars
References writeCharHex().
Referenced by DataOverHttps::dataWriting(), NAL9602::retrieveAndQueueIncoming(), and writeHex().
|
inlinevirtual |
writes zero-terminated buffer to the output buffer/stream
References writeHex().
|
inline |
writes a 4-byte integer to the output buffer/stream
References write().
Referenced by MissionStateLogger::SetActive(), MissionStateLogger::SetRepeatIndex(), MtxOutStream::write(), and MtxIOStream::write().
|
inline |
writes a 3-byte integer to the output buffer/stream only works on little-endian machines!
References write().
Referenced by EventEntry::write().
| OutStream & OutStream::writeInteger | ( | const int | number, |
| const unsigned int | radix = 10 |
||
| ) |
writes an integer as a base-radix string
References Str::IntToAscii(), and write().
Referenced by operator<<(), and writeNumber().
|
inline |
writes a 8-byte integer to the output buffer/stream
References write().
| OutStream & OutStream::writeLongLongCompact | ( | const long long & | value | ) |
writes a signed long long integer as 1 to 9 bytes, encoded as follows: 0xxxxxxx - 7 bit value, encoded in 1 byte 10xxxxxx+1byte - 14 bit value, encoded in 2 bytes 110xxxxx+2bytes - 21 bit value, encoded in 3 bytes 1110xxxx+3bytes - 28 bit value, encoded in 4 bytes 11110xxx+4bytes - 35 bit value, encoded in 5 bytes 111110xx+5bytes - 42 bit value, encoded in 6 bytes 1111110x+6bytes - 49 bit value, encoded in 7 bytes 11111110+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes
writes a signed long long integer as 1 to 9 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 21 bit value, encoded in 3 bytes xxxx0111+3bytes - 28 bit value, encoded in 4 bytes xxx01111+4bytes - 35 bit value, encoded in 5 bytes xx011111+5bytes - 42 bit value, encoded in 6 bytes x0111111+6bytes - 49 bit value, encoded in 7 bytes 01111111+7bytes - 56 bit value, encoded in 8 bytes 11111111+8bytes - 64 bit value, encoded in 9 bytes
References lastWritten_, write(), and writeChar().
Referenced by StrIOStream_Test::testLongLongCompact(), and LogEntry::writeTimestamp().
| OutStream & OutStream::writeNumber | ( | const double | number, |
| const unsigned int | radix = 10 |
||
| ) |
References writeInteger().
|
inline |
writes a single short to the output buffer/stream
References write().
Referenced by MissionStateLogger::LogArgWrite(), MissionStateLogger::NewRun(), MissionStateLogger::SetActive(), MissionStateLogger::SetRepeatIndex(), Short::toStream(), UShort::toStream(), and StrValue::toStream().
| OutStream & OutStream::writeShortHex | ( | const short | word | ) |
writes a single short to the output buffer/stream as 4 hex chars
References HEX_CHARS, lastWritten_, and writeChar().
Referenced by CodedStr::write(), DirectoryEntry::write(), ElementURI::write(), and DataAccess::write().
| OutStream & OutStream::writeUCharHex | ( | const unsigned char | byte | ) |
writes a single unsigned char to the output buffer/stream as 2 hex chars
References HEX_CHARS, lastWritten_, and writeChar().
Referenced by ElementURI::write().
| OutStream & OutStream::writeUShortCompact | ( | const unsigned short & | value | ) |
writes an unsigned short integer as 1 to 3 bytes, encoded as follows: xxxxxxx0 - 7 bit value, encoded in 1 byte xxxxxx01+1byte - 14 bit value, encoded in 2 bytes xxxxx011+2bytes - 16 bit value, encoded in 3 bytes
References lastWritten_, write(), and writeChar().
Referenced by StrIOStream_Test::testWriteUShortCompact(), SyslogEntry::write(), DirectoryEntry::write(), DataEntry::write(), and EventEntry::write().
| OutStream & OutStream::writeUShortHex | ( | const unsigned short | word | ) |
writes a single unsigned short to the output buffer/stream as 4 hex chars
writes a single short to the output buffer/stream as 4 hex chars
References HEX_CHARS, lastWritten_, and writeChar().
Referenced by ElementURI::write(), and DataAccess::write().
|
staticprotected |
Referenced by writeCharHex(), writeShortHex(), writeUCharHex(), and writeUShortHex().
|
protected |