#include <gauge3d/files/file.h>
Inherits GAUGE3D::GObject.
Inherited by GAUGE3D::GDiskFile, and GAUGE3D::GStringFile.
Public Types | |
typedef GSmartPointer<FileMap> | pFileMap |
enum | tMapFlags { READ = 1 << 0, WRITE = 1 << 1 } |
Flags for mapping a file to memory. More... | |
Public Methods | |
virtual | ~GFile () |
virtual int | Size ()=0 |
Gets the size of the file in bytes. | |
virtual bool | Truncate ()=0 |
Truncates the file to zero length. Returns false if file was not writable. | |
pGIStream | GetInputStream () |
Get a GIStream for the file. May be null if the file is not readable. More... | |
pGOStream | GetOutputStream () |
Get a GOStream for the file. May be null if the file is not readable. More... | |
virtual pGRawIStream | GetRawInputStream ()=0 |
Get a GRawIStream for the file. May be null if the file is not readable. | |
virtual pGRawOStream | GetRawOutputStream ()=0 |
Get a GRawOStream for the file. May be null if the file is not writeable. | |
virtual pFileMap | Map (int offset,int size,int flags)=0 |
Maps a portion of the file to memory. More... | |
pFileMap | Map (int flags=READ) |
Maps the entire file to memory. More... | |
virtual GString | MapToDisk ()=0 |
Copies the file to a temporary file on disk, if it is not already on the disk. More... | |
virtual GString | Name ()=0 |
Get the name of the file. More... | |
virtual | operator GString () |
Create a string containing the complete file. More... |
This could be a file on the disk, a file in a compressed archive, a file on an ftp server, etc.
|
Flags for mapping a file to memory.
|
|
Get a GIStream for the file. May be null if the file is not readable.
|
|
Get a GOStream for the file. May be null if the file is not readable.
|
|
Maps a portion of the file to memory.
Reimplemented in GAUGE3D::GDiskFile, and GAUGE3D::GStringFile. |
|
Maps the entire file to memory.
|
|
Copies the file to a temporary file on disk, if it is not already on the disk.
Reimplemented in GAUGE3D::GDiskFile, and GAUGE3D::GStringFile. |
|
Get the name of the file.
Reimplemented in GAUGE3D::GDiskFile, and GAUGE3D::GStringFile. |
|
Create a string containing the complete file.
Reimplemented in GAUGE3D::GStringFile. |