#include <GFile.h>
Public Member Functions | |
int | Open (const char *Name, int Attrib) |
Opens a file. | |
bool | IsOpen () |
Returns non zero if the class is associated with an open file handle. | |
int | GetError () |
Returns the most recent error code encountered. | |
int | Close () |
Closes the file. | |
int | GetOpenMode () |
Gets the mode that the file was opened with. | |
int | GetBlockSize () |
Gets the block size. | |
int64 | GetPos () |
Gets the current file pointer. | |
int64 | SetPos (int64 Pos) |
Sets the current file pointer. | |
int64 | GetSize () |
Gets the file size. | |
int64 | SetSize (int64 Size) |
Sets the file size. | |
int | Read (void *Buffer, int Size, int Flags=0) |
Reads bytes into memory from the current file pointer. | |
int | Write (const void *Buffer, int Size, int Flags=0) |
Writes bytes from memory to the current file pointer. | |
virtual char * | GetName () |
Gets the path used to open the file. | |
virtual int64 | Seek (int64 To, int Whence) |
Moves the current file pointer. | |
virtual bool | Eof () |
Returns true if the current file pointer is at the end of the file. | |
virtual void | SetStatus (bool s=false) |
Resets the status value. | |
virtual bool | GetStatus () |
Returns true if all operations were successful since the file was openned or SetStatus was used to reset the file's status. | |
virtual void | SetSwap (bool s) |
Sets the swap option. When switched on all integer reads/writes will have their bytes swaped. | |
virtual bool | GetSwap () |
Gets the current swap setting. | |
virtual bool | Close () |
virtual int | GetSize () |
Gets the size of the stream. |
int GFile::Open | ( | const char * | Name, | |
int | Attrib | |||
) | [virtual] |
Opens a file.
Name | The path of the file to open |
Attrib | The mode to open the file with. One of O_READ, O_WRITE or O_READWRITE. |
Reimplemented from GStreamI.
References Close(), GSemaphore::Lock(), Open(), and GSemaphore::Unlock().
Referenced by GFileSystem::Copy(), GApp::GetConfig(), IFtp::ListDir(), LoadDC(), Html2::GHtml2::Name(), GHtml::Name(), Html2::GHtml2::OnMouseClick(), GHtml::OnMouseClick(), GTextView3::Open(), GMemStream::Open(), Open(), Xml::ParseXmlFile(), GXmlTree::Read(), GTextView3::Save(), GTempStream::Write(), WriteDC(), and SystemFunctions::WriteTextFile().
int64 GFile::GetPos | ( | ) | [virtual] |
Sets the current file pointer.
Reimplemented from GStreamI.
Referenced by GetSize(), LoadDC(), SetSize(), and GTempStream::Write().
int64 GFile::GetSize | ( | ) | [virtual] |
Gets the file size.
Reimplemented from GStreamI.
References GetPos(), and SetPos().
Referenced by GFileSystem::Copy(), Eof(), GTextView3::Open(), GMemStream::Open(), SetSize(), and GTempStream::Write().
Sets the file size.
Reimplemented from GStreamI.
References GetPos(), GetSize(), and SetPos().
Referenced by Html2::GHtml2::Name(), Html2::GHtml2::OnMouseClick(), GHtml::OnMouseClick(), GTextView3::Save(), and SystemFunctions::WriteTextFile().
int GFile::Read | ( | void * | Buffer, | |
int | Size, | |||
int | Flags = 0 | |||
) | [virtual] |
Reads bytes into memory from the current file pointer.
Reimplemented from GStream.
Referenced by GFileSystem::Copy(), LoadDC(), GTextView3::Open(), and GMemStream::Open().
int GFile::Write | ( | const void * | Buffer, | |
int | Size, | |||
int | Flags = 0 | |||
) | [virtual] |
Writes bytes from memory to the current file pointer.
Reimplemented from GStream.
Referenced by GFileSystem::Copy(), IFtp::ListDir(), Html2::GHtml2::Name(), GHtml::Name(), Html2::GHtml2::OnMouseClick(), GHtml::OnMouseClick(), GTextView3::Save(), and SystemFunctions::WriteTextFile().
virtual bool GFile::Close | ( | ) | [virtual] |
virtual int GFile::GetSize | ( | ) | [virtual] |
Gets the size of the stream.
Reimplemented from GStreamI.