|
wavelength 1.0.0
|
BinStream over a file read into a buffer in the background. More...
#include <asyncstream.h>


Public Member Functions | |
| AsyncStream (const char *pszFile, bool bLittleEndian) | |
| Open a file and start reading it. | |
| ~AsyncStream () override | |
| Release the buffer and the file. | |
| bool | Ready (int nBytes) |
| Report whether enough of the file has been read. | |
| void | Read (void *pData, int nBytes) override |
| Read bytes, waiting for them to arrive. | |
| void | Write (const void *pData, int nBytes) override |
| Write bytes. | |
| void | Flush () override |
| Do nothing. | |
| void | Seek (int nOffset, SeekType eFrom) override |
| Move the position. | |
| int | Tell () override |
| Report the position. | |
| const char * | GetFileName () const |
| Report the file. | |
| bool | Eof () override |
| Report whether the position is at the end of the file. | |
| bool | Fail () override |
| Report whether a transfer failed. | |
| Public Member Functions inherited from BinStream | |
| BinStream (bool bLittleEndian) | |
| Construct a stream. | |
| virtual | ~BinStream () |
| Release the stream. | |
| virtual void | Mark (const char *pszMark) |
| Receive a named mark in the data, such as the end of a chunk. | |
| 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) |
Additional Inherited Members | |
| Public Types inherited from BinStream | |
| enum | SeekType { kSeekBegin = 0 , kSeekCurrent = 1 , kSeekEnd = 2 , kSeekBegin = 0 , kSeekCurrent = 1 , kSeekEnd = 2 } |
| Origins of Seek(). More... | |
| enum | SeekType { kSeekBegin = 0 , kSeekCurrent = 1 , kSeekEnd = 2 , kSeekBegin = 0 , kSeekCurrent = 1 , kSeekEnd = 2 } |
| The origin of Seek(). More... | |
BinStream over a file read into a buffer in the background.
The RTTI includes the class name and records BinStream as the base. The constructor opens the file and starts reading all of it into a buffer from the pool, billed to the tag "AsyncStream buf". Only the members its callers here use are declared.
| AsyncStream::AsyncStream | ( | const char * | pszFile, |
| bool | bLittleEndian ) |
Open a file and start reading it.
| pszFile | The file. |
| bLittleEndian | Whether values are stored in the console's byte order. |
|
override |
Release the buffer and the file.
| bool AsyncStream::Ready | ( | int | nBytes | ) |
Report whether enough of the file has been read.
Once the whole file has been read, the file is closed and every later call reports true.
| nBytes | The bytes needed. |
|
overridevirtual |
Read bytes, waiting for them to arrive.
| pData | The destination. |
| nBytes | The number of bytes. |
Implements BinStream.
|
overridevirtual |
Write bytes.
| pData | The source. |
| nBytes | The number of bytes. |
Implements BinStream.
|
inlineoverridevirtual |
Do nothing.
Implements BinStream.
|
overridevirtual |
Move the position.
| nOffset | The offset in bytes. |
| eFrom | The origin of the offset. |
Implements BinStream.
|
inlineoverridevirtual |
Report the position.
Implements BinStream.
|
inline |
Report the file.
GfxManager::FindPreload() reads the name in place, and the image has no accessor.
|
inlineoverridevirtual |
Report whether the position is at the end of the file.
Implements BinStream.
|
inlineoverridevirtual |
Report whether a transfer failed.
Implements BinStream.