![]() |
Public API Reference |
![]() |
A replacement for FILE type in the virtual file space. More...
#include <iutil/vfs.h>
Public Member Functions | |
virtual bool | AtEOF ()=0 |
Returns true if the stream is at end-of-file, else false. | |
virtual void | Flush ()=0 |
Flush stream. | |
virtual csPtr< iDataBuffer > | GetAllData (bool nullterm=false)=0 |
Request whole content of the file as a single data buffer. | |
virtual csPtr< iDataBuffer > | GetAllData (CS::Memory::iAllocator *allocator)=0 |
Request whole content of the file as a single data buffer. | |
virtual const char * | GetName ()=0 |
Query file name (in VFS) | |
virtual csPtr< iFile > | GetPartialView (size_t offset, size_t size=(size_t)~0)=0 |
Request whole or part of the content of the file as a file object. | |
virtual size_t | GetPos ()=0 |
Query current file pointer. | |
virtual size_t | GetSize ()=0 |
Query file size. | |
virtual int | GetStatus ()=0 |
Check (and clear) file last error status. | |
virtual size_t | Read (char *Data, size_t DataSize)=0 |
Read DataSize bytes and place them into the buffer at which Data points. | |
virtual bool | SetPos (size_t newpos)=0 |
Set new file pointer. | |
virtual size_t | Write (const char *Data, size_t DataSize)=0 |
Write DataSize bytes from the buffer at which Data points. |
A replacement for FILE type in the virtual file space.
Main creators of instances implementing this interface:
virtual bool iFile::AtEOF | ( | ) | [pure virtual] |
Returns true if the stream is at end-of-file, else false.
Implemented in csMemFile, and csPhysicalFile.
virtual void iFile::Flush | ( | ) | [pure virtual] |
Flush stream.
Implemented in csMemFile, and csPhysicalFile.
virtual csPtr<iDataBuffer> iFile::GetAllData | ( | bool | nullterm = false | ) | [pure virtual] |
Request whole content of the file as a single data buffer.
nullterm | Set this to true if you want a null char to be appended to the buffer (e.g. for use with string functions.) |
Implemented in csPhysicalFile, and csMemFile.
virtual csPtr<iDataBuffer> iFile::GetAllData | ( | CS::Memory::iAllocator * | allocator | ) | [pure virtual] |
Request whole content of the file as a single data buffer.
Uses the allocator allocator if memory allocations are necessary.
Implemented in csPhysicalFile, and csMemFile.
virtual const char* iFile::GetName | ( | ) | [pure virtual] |
Query file name (in VFS)
Implemented in csMemFile, and csPhysicalFile.
virtual csPtr<iFile> iFile::GetPartialView | ( | size_t | offset, |
size_t | size = (size_t)~0 |
||
) | [pure virtual] |
Request whole or part of the content of the file as a file object.
offset | Offset of data to return. |
size | Size of data to return. If ~0 all the data starting at offset up to the end of the file is returned. |
Implemented in csPhysicalFile, and csMemFile.
virtual size_t iFile::GetPos | ( | ) | [pure virtual] |
Query current file pointer.
Implemented in csMemFile, and csPhysicalFile.
virtual size_t iFile::GetSize | ( | ) | [pure virtual] |
Query file size.
Implemented in csMemFile, and csPhysicalFile.
virtual int iFile::GetStatus | ( | ) | [pure virtual] |
Check (and clear) file last error status.
Implemented in csMemFile, and csPhysicalFile.
virtual size_t iFile::Read | ( | char * | Data, |
size_t | DataSize | ||
) | [pure virtual] |
Read DataSize bytes and place them into the buffer at which Data points.
Data | Pointer to the buffer into which the data should be read. The buffer should be at least DataSize bytes in size. |
DataSize | Number of bytes to read. |
Implemented in csMemFile, and csPhysicalFile.
virtual bool iFile::SetPos | ( | size_t | newpos | ) | [pure virtual] |
Set new file pointer.
newpos | New position in file. |
Implemented in csMemFile, and csPhysicalFile.
virtual size_t iFile::Write | ( | const char * | Data, |
size_t | DataSize | ||
) | [pure virtual] |
Write DataSize bytes from the buffer at which Data points.
Data | Pointer to the data to be written. |
DataSize | Number of bytes to write. |
Implemented in csMemFile, and csPhysicalFile.