|
LRAUV
revA
|
#include <MtxIOStream.h>


Public Member Functions | |
| MtxIOStream (const char *filename, bool clobber) | |
| virtual | ~MtxIOStream () |
| Mtx | read (Logger &logger, int maxN=0, Syslog::Severity severity=Syslog::FAULT) |
| Reads matrix in case of failure, returns invalid Matrix. More... | |
| Mtx | read (Logger &logger, int minN=0, int maxN=0, Syslog::Severity severity=Syslog::FAULT) |
| Reads matrix in case of failure, returns invalid Matrix. More... | |
| bool | write (const Mtx &mtx, Logger &logger, int minM=0, int maxM=-1, int minN=0, int maxN=-1, Syslog::Severity severity=Syslog::FAULT) |
| Writes matrix or subset of matrix if min/max m & n are specified in case of failure, returns false. More... | |
| bool | append (const Mtx &mtx, Logger &logger, Syslog::Severity severity) |
| Writes matrix or subset of matrix if min/max m & n are specified in case of failure, returns false. More... | |
Public Member Functions inherited from FileIOStream | |
| FileIOStream (FILE *file=NULL, bool autoClose=false) | |
| Constructor. More... | |
| FileIOStream (const char *filename, bool clobber) | |
| Constructor. More... | |
| virtual | ~FileIOStream () |
| void | close () |
| virtual IOStream & | read (char *buffer, size_t num) |
| reads num bytes from buffer to the output buffer/stream More... | |
| void | setFile (FILE *file, const char *filename) |
| Change the assoicated file. More... | |
| bool | seek (unsigned int location) |
| virtual bool | eof () |
| Indicates if the end of file has been reached. More... | |
| virtual void | clearErr () |
| bool | isReadable () |
| indicates whether the stream can actually be read from. More... | |
| const char * | getName () |
| returns name of the stream More... | |
| const Str & | getFilename () |
| const struct stat | getStat () |
| IOStream & | write (const char *buffer, size_t num) |
| writes num bytes from buffer to the output buffer/stream More... | |
| virtual IOStream & | write (const char *buffer) |
| writes zero-terminated buffer to the output buffer/stream More... | |
| void | setFile (FILE *file) |
| Change the assoicated file. More... | |
| int | tell () |
| void | flush () |
| bool | open (const char *filename, bool clobber) |
| bool | isWritable () |
| indicates whether the stream can actually be written to. More... | |
Public Member Functions inherited from InStream | |
| virtual | ~InStream () |
| Destructor. More... | |
| InStream & | readChar (signed char &value) |
| reads a single byte to the input buffer/stream More... | |
| InStream & | readCharHex (signed char &byte) |
| reads a single unsigned char from the input buffer/stream as 2 hex chars More... | |
| InStream & | readUCharHex (unsigned char &byte) |
| reads a single unsigned char from the input buffer/stream as 2 hex chars More... | |
| virtual InStream & | readLine (char *buf, unsigned int bufsize) |
| InStream & | readShort (short &value) |
| reads a single short from the input buffer/stream More... | |
| InStream & | readShort (unsigned short &value) |
| reads a single short from the input buffer/stream More... | |
| InStream & | readShortHex (short &word) |
| reads a single short from the input buffer/stream as 4 hex chars More... | |
| InStream & | readUShortHex (unsigned short &value) |
| reads a single unsigned short from the input buffer/stream as 4 hex chars More... | |
| InStream & | readUShortCompact (unsigned short &value) |
| reads 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... | |
| InStream & | readInt24 (int &medInt) |
| reads a 3-byte integer to the input buffer/stream only works on little-endian machines! More... | |
| InStream & | readInt (int &value) |
| reads a 4-byte integer to the input buffer/stream More... | |
| InStream & | readLongLong (long long &value) |
| reads a 8-byte integer to the input buffer/stream More... | |
| InStream & | readLongLongCompact (long long &value) |
| reads 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... | |
| InStream & | readFloat (float &value) |
| reads a 4-byte float to the input buffer/stream More... | |
| InStream & | readFloat2 (float &value) |
| reads a 2-byte float to the input buffer/stream More... | |
| InStream & | readFloat3 (float &value) |
| reads a 3-byte float to the input buffer/stream More... | |
| InStream & | readDouble (double &value) |
| reads a 8-byte double to the input buffer/stream More... | |
| virtual InStream & | readUntil (char *buf, unsigned int num, unsigned char match) |
| size_t | bytesRead () |
| Indicates the number of bytes read in the last operation. More... | |
| size_t | getBytesRead () |
| Indicates the number of bytes read in the last operation. More... | |
| size_t | getTotalBytesRead () |
| Indicates the total number of bytes read;. More... | |
Public Member Functions inherited from OutStream | |
| virtual | ~OutStream () |
| Destructor. 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 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 () |
Additional Inherited Members | |
Protected Member Functions inherited from InStream | |
| InStream () | |
| Protected Constructor for abstract class. More... | |
| void | zeroBytesRead () |
| void | incBytesRead () |
| void | incBytesRead (size_t incRead) |
| void | setBytesRead (size_t lastRead) |
| void | zeroTotalBytesRead () |
Protected Member Functions inherited from OutStream | |
| OutStream () | |
| Protected Constructor for abstract class. More... | |
Protected Attributes inherited from FileIOStream | |
| FILE * | file_ |
| bool | autoClose_ |
| Mutex | fileMutex_ |
Protected Attributes inherited from OutStream | |
| size_t | lastWritten_ |
Static Protected Attributes inherited from OutStream | |
| static const unsigned char | HEX_CHARS [] = "0123456789ABCDEF" |
| MtxIOStream::MtxIOStream | ( | const char * | filename, |
| bool | clobber | ||
| ) |
|
virtual |
| bool MtxIOStream::append | ( | const Mtx & | mtx, |
| Logger & | logger, | ||
| Syslog::Severity | severity | ||
| ) |
Writes matrix or subset of matrix if min/max m & n are specified in case of failure, returns false.
References InStream::bytesRead(), OutStream::bytesWritten(), Mtx::getM(), Mtx::getN(), FileIOStream::getName(), FileIOStream::getStat(), InStream::readInt(), FileIOStream::seek(), Logger::syslog(), write(), and OutStream::writeFloat().
Referenced by Mtx::append().
|
inline |
Reads matrix in case of failure, returns invalid Matrix.
Referenced by Mtx::Mtx().
| Mtx MtxIOStream::read | ( | Logger & | logger, |
| int | minN = 0, |
||
| int | maxN = 0, |
||
| Syslog::Severity | severity = Syslog::FAULT |
||
| ) |
Reads matrix in case of failure, returns invalid Matrix.
References InStream::bytesRead(), FileIOStream::getName(), FileIOStream::getStat(), InStream::readFloat(), InStream::readInt(), FileIOStream::seek(), Mtx::setSize(), and Logger::syslog().
| bool MtxIOStream::write | ( | const Mtx & | mtx, |
| Logger & | logger, | ||
| int | minM = 0, |
||
| int | maxM = -1, |
||
| int | minN = 0, |
||
| int | maxN = -1, |
||
| Syslog::Severity | severity = Syslog::FAULT |
||
| ) |
Writes matrix or subset of matrix if min/max m & n are specified in case of failure, returns false.
References OutStream::bytesWritten(), Mtx::getM(), Mtx::getN(), FileIOStream::getName(), Mtx::isUnlimitedN(), FileIOStream::seek(), Logger::syslog(), OutStream::writeFloat(), and OutStream::writeInt().
Referenced by append(), and Mtx::write().