#include <memfile.h>
Inheritance diagram for PMemoryFile:
Public Member Functions | |
Construction | |
PMemoryFile () | |
PMemoryFile (const PBYTEArray &data) | |
Overrides from class PObject | |
Comparison | Compare (const PObject &obj) const |
Overrides from class PChannel | |
virtual BOOL | Read (void *buf, PINDEX len) |
virtual BOOL | Write (const void *buf, PINDEX len) |
Overrides from class PFile | |
off_t | GetLength () const |
BOOL | SetLength (off_t len) |
BOOL | SetPosition (off_t pos, FilePositionOrigin origin=Start) |
off_t | GetPosition () const |
Overrides from class PFile | |
const PBYTEArray & | GetData () const |
Protected Attributes | |
PBYTEArray | data |
off_t | position |
|
Create a new, empty, memory file. |
|
Create a new memory file initialising to the specified content.
|
|
Determine the relative rank of the two objects. This is essentially the string comparison of the PFilePath# names of the files.
Reimplemented from PFile. |
|
Get the memory data the file has operated with. |
|
Get the current size of the file. The size of the file corresponds to the size of the data array.
Reimplemented from PFile. |
|
Get the current active position in the file for the next read or write operation.
Reimplemented from PFile. |
|
Low level read from the memory file channel. The read timeout is ignored. The GetLastReadCount() function returns the actual number of bytes read. The GetErrorCode() function should be consulted after Read() returns FALSE to determine what caused the failure.
Reimplemented from PFile. |
|
Set the size of the file, padding with 0 bytes if it would require expanding the file, or truncating it if being made shorter.
Reimplemented from PFile. |
|
Set the current active position in the file for the next read or write operation. The pos# variable is a signed number which is added to the specified origin. For origin == PFile::Start# only positive values for pos# are meaningful. For origin == PFile::End# only negative values for pos# are meaningful.
|
|
Low level write to the memory file channel. The write timeout is ignored. The GetLastWriteCount() function returns the actual number of bytes written. The GetErrorCode() function should be consulted after Write() returns FALSE to determine what caused the failure.
Reimplemented from PFile. |
|
|
|
|