csMemFile Class Reference
Essentially a raw memory buffer which implements the abstract iFile interface. More...
#include <csutil/memfile.h>
Inheritance diagram for csMemFile:

Public Types | |
enum | Disposition { DISPOSITION_DELETE, DISPOSITION_FREE, DISPOSITION_IGNORE } |
Disposition of memory buffer at destruction time. More... | |
Public Member Functions | |
virtual bool | AtEOF () |
Returns true if the stream is at end-of-file, else false. | |
csMemFile (iDataBuffer *buf, bool readOnly) | |
Construct a memory file from an existing data buffer. | |
csMemFile (char *, size_t, Disposition=DISPOSITION_DELETE) | |
Construct a memory file from an existing memory buffer and free later. | |
csMemFile (const char *, size_t) | |
Construct a memory file from an existing memory buffer but do not free. | |
csMemFile () | |
Construct an empty memory file. | |
virtual void | Flush () |
Flush stream. | |
virtual csPtr< iDataBuffer > | GetAllData (bool nullterm=false) |
Request whole content of the file as a single data buffer. | |
virtual const char * | GetData () const |
Returns a pointer to the memory buffer. | |
virtual const char * | GetName () |
Returns "#csMemFile". | |
virtual size_t | GetPos () |
Query current file pointer. | |
virtual size_t | GetSize () |
Query file size. | |
virtual int | GetStatus () |
Check (and clear) file last error status. | |
virtual size_t | Read (char *Data, size_t DataSize) |
Read DataSize bytes and place them into the buffer at which Data points. | |
virtual bool | SetPos (size_t newpos) |
Set new file pointer. | |
virtual size_t | Write (const char *Data, size_t DataSize) |
Write DataSize bytes from the buffer at which Data points. | |
virtual | ~csMemFile () |
Destructor. | |
Protected Attributes | |
csRef< iDataBuffer > | buffer |
bool | copyOnWrite |
size_t | cursor |
size_t | size |
Detailed Description
Essentially a raw memory buffer which implements the abstract iFile interface.
Definition at line 34 of file memfile.h.
Member Enumeration Documentation
|
Disposition of memory buffer at destruction time.
|
Constructor & Destructor Documentation
|
Construct an empty memory file.
|
|
Construct a memory file from an existing memory buffer but do not free.
|
|
Construct a memory file from an existing memory buffer and free later. Note that when writing to the buffer, the original buffer may be discarded and a new one created due required resizing. |
|
Construct a memory file from an existing data buffer.
|
|
Destructor.
|
Member Function Documentation
|
Returns true if the stream is at end-of-file, else false.
Implements iFile. |
|
Flush stream.
Implements iFile. |
|
Request whole content of the file as a single data buffer.
Implements iFile. |
|
Returns a pointer to the memory buffer. May return 0 if memory file is empty. Use GetSize() for size info. |
|
Returns "#csMemFile".
Implements iFile. |
|
Query current file pointer.
Implements iFile. |
|
Query file size.
Implements iFile. |
|
Check (and clear) file last error status.
Implements iFile. |
|
Read DataSize bytes and place them into the buffer at which Data points.
Implements iFile. |
|
Set new file pointer.
Implements iFile. |
|
Write DataSize bytes from the buffer at which Data points.
Implements iFile. |
The documentation for this class was generated from the following file:
- csutil/memfile.h
Generated for Crystal Space by doxygen 1.4.6