|
| | ChunkStream (const char *pszFile, Mode eMode, int nChunkSize, bool bCompressed, bool bLittleEndian) |
| | Open a file and start reading its header, or write a fresh header.
|
| | ~ChunkStream () override |
| | Write the last block and the final header of a writer, and close the file.
|
| void | Read (void *pData, int nBytes) override |
| | Copy bytes out of the current block.
|
| void | Write (const void *pData, int nBytes) override |
| | Append bytes to the block being gathered.
|
| void | Flush () override |
| | Do nothing.
|
| void | Seek (int nOffset, SeekType eFrom) override |
| | Report that the stream cannot seek.
|
| int | Tell () override |
| | Report that the stream cannot report a position.
|
| bool | Eof () override |
| | Advance the background reads, and report whether the current block is still unavailable.
|
| bool | Fail () override |
| | Report whether the file failed to open or a block failed to write.
|
| void | Mark (const char *pszMark) override |
| | End the block at a mark of g_szChunkMark once it has reached the chunk size.
|
| | BinStream (bool bLittleEndian) |
| | Construct a stream.
|
| virtual | ~BinStream () |
| | Release the stream.
|
| void | ReadString (char *pszBuffer, int nSize) |
| | Read a length-prefixed string into a buffer and terminate it.
|
| void | ReadString (String &text) |
| | Read a length-prefixed string.
|
| BinStream & | WriteString (const char *pszText) |
| | Write a string with its length first.
|
| void | ReadEndian (void *pData, int nBytes) |
| | Read a value of 2, 4, 8, or 16 bytes, reversing its bytes unless the stream is little endian.
|
| void | WriteEndian (const void *pData, int nBytes) |
| | Write a value of 2, 4, 8, or 16 bytes, reversing its bytes unless the stream is little endian.
|
| | BinStream (bool littleEndian) |
| | Set the byte order.
|
| virtual | ~BinStream () |
| | Destroy the stream.
|
| virtual void | NoOp (int) |
| | Do nothing.
|
| void | ReadEndian (void *data, int bytes) |
| | Read a value, swapping its bytes into the host order.
|
| void | WriteEndian (const void *data, int bytes) |
| | Write a value, swapping its bytes into the stream order.
|
| BinStream & | operator<< (const char *str) |
| | Write text as its length followed by its characters, without a terminator.
|
| BinStream & | operator>> (String &str) |
| | Read text written by operator<<(const char *).
|
| void | ReadString (char *buffer, int bufSize) |
| | Read text written by operator<<(const char *) into a buffer, and terminate it.
|
| BinStream & | operator<< (char c) |
| BinStream & | operator<< (unsigned char c) |
| BinStream & | operator<< (short s) |
| BinStream & | operator<< (unsigned short s) |
| BinStream & | operator<< (int i) |
| BinStream & | operator<< (unsigned int i) |
| BinStream & | operator<< (float f) |
| BinStream & | operator>> (char &c) |
| BinStream & | operator>> (unsigned char &c) |
| BinStream & | operator>> (short &s) |
| BinStream & | operator>> (unsigned short &s) |
| BinStream & | operator>> (int &i) |
| BinStream & | operator>> (unsigned int &i) |
| BinStream & | operator>> (float &f) |
BinStream over a file stored as a header and a run of blocks, each optionally deflated.
The RTTI includes the class name and records BinStream as the base. A reader reads the header and the blocks in the background, two block buffers in turn. A writer gathers a block in memory until the block reaches the chunk size at a mark of g_szChunkMark, and rewrites the header when the stream is deleted.