Inheritance diagram for mortic::IFile:
Public Member Functions | |
IFile (IRoot *root) | |
Constructor. | |
virtual void | close ()=0 |
Close the File. | |
virtual void | flush ()=0 |
Flush the File Buffers. | |
virtual std::string | read (unsigned int size=0)=0 |
Read from the file. | |
virtual void | write (std::string s)=0 |
Write to the file. | |
virtual unsigned int | tell ()=0 |
Get the position in the file. | |
virtual void | seek (unsigned int s)=0 |
Set the position in the file. | |
virtual bool | eof ()=0 |
Returns if at end of file. | |
virtual bool | isOpen ()=0 |
Returns if the file is open. | |
virtual std::string | getPath ()=0 |
Returns the path of the file. |
This class represents a file loaded from IFileManager. File abstraction is useful, because it allows you to read from different sources transparently. For example, you could read from an HTTP stream just like a normal file! Note: always open from IFileManager. Never make your own instance.
Definition at line 36 of file IFile.h.
|
Constructor.
|
|
Close the File. After the file is closed, you can no longer read or write. Calls flush() before closing. Always remember to close a file after you're done!
|
|
Returns if at end of file. This function returns whether or not you have reached the end of the file.
|
|
Flush the File Buffers. Flushing after a write() will ensure that what you have written is actually written. files don't normally flush after every write because it is more efficient, but somethimes what is written must be immediatly available. |
|
Returns the path of the file. This path is in VFS terms, and allows you to reopen a closed file, and generally snoop around. Please note that remappings and unmountings may have made this file path move or dissappear, although it would probably work. Always use IFileManager::exists().
|
|
Returns if the file is open. This returns whether or not you can read or write from this file.
|
|
Read from the file. Only works if the file was opened in read mode.
|
|
Set the position in the file.
|
|
Get the position in the file.
|
|
Write to the file. Only works if the file was opened in write mode.
|