| GPL_Reference | public |
Open(name, flags).
GPL_Boolean operator ==(const GPL_File & file)
Return TRUE if the file and file refer to the same file handle
which was opened with the same flags. Return FALSE otherwise.
GPL_Boolean operator !=(const GPL_File & file)
Return FALSE if the file and file refer to the same file handle
which was opened with the same flags. Return TRUE otherwise.
GPL_Boolean Duplicate(const GPL_File & file)
Duplicate the file file after closing the current file. This
results in a unique file handle to the same file.
GPL_Boolean Close(void)
Close the file.
GPL_Boolean Copy(const char *destination) const
Copy the file to destination.
GPL_Boolean Delete(void)
Delete the file after closing it.
char *GetName(void) const
Return the name used to open the file or NULL if it has never been
opened.
unsigned long GetSize(void) const
Return the size of the file or 0 if the file does not exist or
can not be inspected.
char *GetDirectory(void) const
Calls GetDirectory(GetName()).
char *GetBase(void) const
Calls GetBase(GetName()).
char *GetExtension(void) const
Calls GetExtension(GetName()).
char *GetFullPathName(void) const
Calls GetFullPathName(GetName()).
unsigned long GetFlags(void) const
Return the flags used to open the file or 0 if it has never been
opened.
GPL_Boolean EndOfFile(void) const
Return whether or not the file is at its end.
GPL_Boolean IsOpen(void) const
Return whether or not the file is open.
GPL_Boolean GetAttributes(OSD_FileAttributes & attr) const
Calls GetAttributes(GetName(), attr).
GPL_Boolean GetModificationTime(OSD_Time & time) const
Calls GetAttributes(GetName(), time).
GPL_Boolean SetPointer(const long offset, const long start)
Set the file pointer to offset from start. See
osdFileOpen(3) for details on the values for offset and
start.
long Read(char *buffer, const unsigned long len)
Return the number of bytes, up to a maximum of len, read into
buffer from the file.
char *Read(unsigned long *length, unsigned long grain_size)
Return the number of bytes read from the file. This function attempts to
load the whole file and allocates the buffer. It is the caller's responsibility
to free the memory when done. If grain_size is not specifed a default
value is used.
long Read(GPL_CharPtr &cptr)
Read in a whole file into a GPL_CharPtr.
Return the number of bytes, up to a maximum of 65536, read into
cptr from the file. Note that GPL_CharPtr is a GPL_Array<char> which
means the underlying implementation may be significantly slower than the
other Read functions.
long ReadLine(char *buffer, const unsigned long maxlen)
Return the number of bytes, up to a maximum of maxlen or
new-line, whichever comes first, read into buffer from the
file.
long Write(char *buffer, const unsigned long len)
Return the number of bytes, up to a maximum of len, written from
buffer to the file.
long Write(const char *buffer, const unsigned long len)
Return the number of bytes, up to a maximum of len, written from
buffer to the file.
GPL_Boolean Lock(long offset, long len, GPL_Boolean ex, GPL_Boolean wait)
Lock the region in the file consisting of len bytes starting at
offset. If ex is TRUE, the lock is exclusive. If
wait is TRUE, the lock is blocking. Returns whether or not
the lock was acquired. This call may block indefinitely.
GPL_Boolean Unlock(long offset, long len)
Unlock the region in the file consisting of len bytes starting at
offset. Returns whether or not the lock was released.
GPL_Boolean Exists(const char *name)
Return whether or not the file named by the path name name exists.
GPL_Boolean GetAttributes(const char *name, OSD_FileAttributes & attr)
Put the attributes of the file named name in attr.
GPL_Boolean GetModificationTime(const char *name, OSD_Time & time)
Put the modification time of the file named name in time.
char *GetDirectory(const char *name)
Return the directory component of name. The returned buffer is the
address of OSD_GLOBAL_BUFFER[0].
char *GetBase(const char *name)
Return the file component of name. The returned buffer is the
address of OSD_GLOBAL_BUFFER[1].
char *GetExtension(const char *name)
Return the extension of name. The returned buffer is the address of
OSD_GLOBAL_BUFFER[2].
char *GetFullPathName(const char *name)
Return the full path name for name. The returned buffer is the
address of OSD_GLOBAL_BUFFER[3].