|
| IFile (const char *filename) |
| Constructs a base file object.
|
|
FileType | type () const |
| Returns the file type (RTTI)
|
|
virtual void | open (unsigned char mode)=0 |
| Tries to open the file.
|
|
virtual void | close ()=0 |
| Closes the file.
|
|
virtual long int | seek (long int offset, int whence) const =0 |
| Seeks in an opened file.
|
|
virtual long int | tell () const =0 |
| Tells the seek position of an opened file.
|
|
virtual unsigned long int | read (void *buffer, unsigned long int bytes) const =0 |
| Reads a certain amount of bytes from the file to a buffer.
|
|
virtual unsigned long int | write (const void *buffer, unsigned long int bytes)=0 |
| Writes a certain amount of bytes from a buffer to the file.
|
|
void | setCloseOnDestruction (bool shouldCloseOnDestruction) |
| Sets the close on destruction flag.
|
|
virtual bool | isOpened () const |
| Returns true if the file has been sucessfully opened.
|
|
const char * | filename () const |
| Returns file name with path.
|
|
int | fd () const |
| Returns file descriptor.
|
|
FILE * | ptr () const |
| Returns file stream pointer.
|
|
unsigned long int | size () const |
| Returns file size in bytes.
|
|
virtual const void * | bufferPtr () const |
| Returns the constant buffer pointer of a memory file or nullptr for other file types.
|
|
virtual void * | bufferPtr () |
| Returns the buffer pointer of a memory file or nullptr for other file types.
|
|
|
static uint16_t | int16FromLE (uint16_t number) |
| Reads a little endian 16 bit unsigned integer.
|
|
static uint32_t | int32FromLE (uint32_t number) |
| Reads a little endian 32 bit unsigned integer.
|
|
static uint64_t | int64FromLE (uint64_t number) |
| Reads a little endian 64 bit unsigned integer.
|
|
static uint16_t | int16FromBE (uint16_t number) |
| Reads a big endian 16 bit unsigned integer.
|
|
static uint32_t | int32FromBE (uint32_t number) |
| Reads a big endian 32 bit unsigned integer.
|
|
static uint64_t | int64FromBE (uint64_t number) |
| Reads a big endian 64 bit unsigned integer.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (const char *bufferName, unsigned char *bufferPtr, unsigned long int bufferSize) |
| Returns a memory file with the specified name.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (const char *bufferName, const unsigned char *bufferPtr, unsigned long int bufferSize) |
| Returns a read-only memory file with the specified name.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (unsigned char *bufferPtr, unsigned long int bufferSize) |
| Returns a memory file.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (const unsigned char *bufferPtr, unsigned long int bufferSize) |
| Returns a read-only memory file.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (const char *bufferName, unsigned long int bufferSize) |
| Returns a memory file with the specified name, that allocates a buffer of the specified size.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (unsigned long int bufferSize) |
| Returns a memory file that allocates a buffer of the specified size.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (const char *bufferName, nctl::UniquePtr< unsigned char[]> buffer, unsigned long int bufferSize) |
| Returns a memory file with the specified name, that takes ownership of the specified buffer.
|
|
static nctl::UniquePtr< IFile > | createFromMemory (nctl::UniquePtr< unsigned char[]> buffer, unsigned long int bufferSize) |
| Returns a memory file that takes ownership of the specified buffer.
|
|
static nctl::UniquePtr< IFile > | createFileHandle (const char *filename) |
| Returns the proper file handle according to prepended tags.
|
|
The interface class dealing with file operations.