LTIOBufferedStream Class Reference
Stream which wraps an array of bytes in memory.
More...
#include <lt_ioBufferedStream.h>
List of all members.
Detailed Description
The buffer is of a fixed size and does not grow or shrink.
Definition at line 28 of file lt_ioBufferedStream.h.
Constructor & Destructor Documentation
LTIOBufferedStream::LTIOBufferedStream |
( |
|
) |
|
virtual LTIOBufferedStream::~LTIOBufferedStream |
( |
|
) |
[virtual] |
Member Function Documentation
virtual LT_STATUS LTIOBufferedStream::close |
( |
|
) |
[virtual] |
Puts the stream in a state that does not allow data access. May free up resources, but only in such a way that doesn't inhibit successful future calls to open()
- Return values:
-
| LT_STS_Success | On success, or if the stream is already closed. |
| LT_STS_Failure | Otherwise. |
Implements LTIOStreamInf.
virtual LTIOStreamInf* LTIOBufferedStream::duplicate |
( |
|
) |
[virtual] |
Create new stream of the same type with the same initialization parameters. The transmission of these parameters is the responsibility of the derived type. The new stream should initially return false for isOpen().
- Return values:
-
| NULL | the stream could not be duplicated; valid LTIOStreamInf* otherwise. |
Implements LTIOStreamInf.
virtual const char* LTIOBufferedStream::getID |
( |
|
) |
const [virtual] |
This function returns a UTF-8, null-terminated string which is a URI describing the origin of the stream object -- for example, "file://foo.txt" or "lt_memstream:". This string is only intended for diagnostic purposes, i.e. it may not be valid to pass it to the ctor in an attempt to reopen the stream.
- Return values:
-
Implements LTIOStreamInf.
virtual LT_STATUS LTIOBufferedStream::getLastError |
( |
|
) |
const [virtual] |
read(), write(), tell(), and duplicate() do not explicitly return status codes in the event of an error. When an error has occurred, this function returns the appropriate status code. Note calling this function after a successful I/O operation will return an undefined value.
- Return values:
-
Implements LTIOStreamInf.
- Parameters:
-
| src | source stream; this instance takes ownership of it |
| pageSize | size of each page in bytes |
| numPages | number of pages to keep cached in memory |
| tempDir | temp directory to store unused pages; this instance does not clean them up |
virtual bool LTIOBufferedStream::isEOF |
( |
|
) |
[virtual] |
Returns true after the first read operation that attempts to read past the end of the stream. It returns false if the current position is not end of stream.
- Return values:
-
| true | end of stream |
| false | otherwise |
Implements LTIOStreamInf.
virtual bool LTIOBufferedStream::isOpen |
( |
|
) |
[virtual] |
- Return values:
-
| true | The stream is open |
| false | otherwise |
Implements LTIOStreamInf.
virtual LT_STATUS LTIOBufferedStream::open |
( |
|
) |
[virtual] |
Opening a stream puts it in a state that allows data access based on cached initialization parameters.
- Return values:
-
| LT_STS_IOStreamUninitialized | The stream has not been initialized with enough information to open the stream |
| LT_STS_IOStreamInvalidState | The stream is already open |
| LT_STS_Success | On success. |
| LT_STS_Failure | Failure. |
| other | Implementations may return other codes |
Implements LTIOStreamInf.
- Parameters:
-
| pDest | buffer in which to store read data |
| numBytes | number of bytes to read from stream |
- Return values:
-
| numBytes | The number of bytes actually read |
Implements LTIOStreamInf.
- Parameters:
-
| offset | number of bytes from origin at which to the next read or write will take place |
| origin | place in stream from which to seek |
- Return values:
-
| LT_STS_IOStreamUnsupported | The stream is not seekable |
| LT_STS_IOStreamInvalidArgs | The offset and origin do not specify a valid location in the stream |
| LT_STS_Success | On success |
| LT_STS_Failure | Otherwise |
| other | Implementations may return other codes |
Implements LTIOStreamInf.
virtual lt_int64 LTIOBufferedStream::tell |
( |
|
) |
[virtual] |
- Return values:
-
| postion | Number of bytes from the start of the data |
| -1 | On error. |
| other | Implementations may return other codes |
Implements LTIOStreamInf.
- Parameters:
-
| pSrc | buffer from which to store data |
| numBytes | number of bytes to write to stream |
- Return values:
-
| numBytes | number of bytes actually written |
Implements LTIOStreamInf.
Member Data Documentation
The documentation for this class was generated from the following file: