MFile
From MaratisWiki
Contents[hide] |
MFile
Code
class M_CORE_EXPORT MFile
{
public:
// destructor
virtual ~MFile(void){}
virtual void open(const char* path, const char* mode) = 0;
virtual int close() = 0;
virtual size_t read(void* dest, size_t size, size_t count) = 0;
virtual size_t write(const void* str, size_t size, size_t count) = 0;
virtual int print(const char* format, ...) = 0;
virtual int print(const char* format, va_list args) = 0;
virtual int seek(long offset, int whence) = 0;
virtual long tell() = 0;
virtual void rewind() = 0;
virtual bool isOpen() = 0;
virtual void destroy() = 0;
};
API
open
Opens a file stream with the name specified by path. The argument mode should be a string containing one of the following modes:
| mode | description |
|---|---|
| "r" | read only, start at the beginning of the file |
| "w" | write only, erase existing file and start at the beginning |
close
Close a file stream, if open.