MFile

From MaratisWiki
Revision as of 15:45, 9 April 2012 by Nistur (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

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

see also:M_fopen, fopen

close

Close a file stream, if open.

see also:M_fclose, fclose

read

see also:M_fread, fread

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox