7 #ifndef CAFU_FILESYS_FILE_HPP_INCLUDED
8 #define CAFU_FILESYS_FILE_HPP_INCLUDED
12 #if defined(_WIN32) && _MSC_VER<1600
28 enum SeekFromT { FROM_BEGINNING, FROM_CURRENT_POS, FROM_END };
35 virtual bool IsOpen()
const=0;
45 virtual uint64_t
GetPos()
const=0;
61 virtual uint32_t
Read(
char* Buffer, uint32_t Size)=0;
64 virtual uint64_t
GetSize()
const=0;
73 virtual void Write(
const char* Buffer, uint32_t Size)=0;
virtual ~FileI()
The virtual destructor, so that derived classes can safely be deleted via a FileI (base class) pointe...
Definition: File.hpp:32
virtual bool Seek(int32_t Offset, SeekFromT SeekFrom)=0
Modifies the position of the read/write pointer in the file.
virtual const std::string & GetBaseName() const =0
Returns the base name of this file. The base name is relative to and agnostic of the file system this...
virtual void Write(const char *Buffer, uint32_t Size)=0
Writes the contents of Buffer, which has size Size, into the file.
SeekFromT
The values of this enumeration define from where the seek operation applies the offset.
Definition: File.hpp:28
virtual uint32_t Read(char *Buffer, uint32_t Size)=0
Reads Size bytes into the Buffer.
virtual uint64_t GetSize() const =0
Returns the size of the file.
virtual const std::string & GetFullName() const =0
Returns the full name of this file.
virtual uint64_t GetPos() const =0
Returns the current read/write position in the file.
virtual bool IsOpen() const =0
Returns whether the file has successfully been opened and is still open.