![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/io/RandomAccessStream.h>
Public Types | |
typedef t::uint64 | pos_t |
typedef t::uint64 | size_t |
typedef int | access_t |
Public Member Functions | |
virtual pos_t | pos (void) const =0 |
virtual size_t | size (void) const =0 |
virtual bool | moveTo (pos_t pos)=0 |
virtual bool | moveForward (pos_t pos)=0 |
virtual bool | moveBackward (pos_t pos)=0 |
virtual void | resetPos (void) |
![]() | |
virtual | ~InStream (void) |
virtual int | read (void *buffer, int size)=0 |
virtual int | read (void) |
virtual CString | lastErrorMessage (void) |
![]() | |
virtual | ~OutStream (void) |
virtual int | write (const char *buffer, int size)=0 |
virtual int | write (char byte) |
virtual int | flush (void)=0 |
virtual CString | lastErrorMessage (void) |
virtual bool | supportsANSI () const |
Static Public Member Functions | |
static RandomAccessStream * | openFile (const sys::Path &path, access_t access=READ) |
static RandomAccessStream * | createFile (const sys::Path &path, access_t access=WRITE) |
Static Public Attributes | |
static const int | READ = 1 |
static const int | WRITE = 2 |
static const int | READ_WRITE = READ | WRITE |
![]() | |
static const int | FAILED = -1 |
static const int | ENDED = -2 |
static InStream & | null = _null |
![]() | |
static OutStream & | null = _null |
A stream allowing to move the read/write head along the file.
typedef int access_t |
|
static |
Create a random access stream from a file, removing it if it already exists.
path | Path of the file to open. |
access | Type of access (one of READ, WRITE, READ_WRITE). |
IOException | Thrown if there is an error. |
References System::createRandomFile().
Move the read/write pointer to the given position, relatively back from the current position.
pos | Relative position to move backward from. |
Move the read/write pointer to the given position, relatively to the current position.
pos | Relative position to move to. |
size_t RandomAccessStream::size(void) const; Get the size of the current stream.
Move the read/write pointer to the given position.
pos | Position to set the pointer to. |
Referenced by RandomAccessStream::resetPos().
|
static |
Open a random access stream from a file.
path | Path of the file to open. |
access | Type of access (one of READ, WRITE, READ_WRITE). |
IOException | Thrown if there is an error. |
References System::openRandomFile().
Get the current position in the file.
Reset the position of the read/write pointer to the start of the file.
References RandomAccessStream::moveTo().
|
static |
|
static |