1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __C_WRITE_FILE_H_INCLUDED__
\r
6 #define __C_WRITE_FILE_H_INCLUDED__
\r
9 #include "IWriteFile.h"
\r
10 #include "irrString.h"
\r
19 Class for writing a real file to disk.
\r
21 class CWriteFile : public IWriteFile
\r
25 CWriteFile(const io::path& fileName, bool append);
\r
27 virtual ~CWriteFile();
\r
29 //! Reads an amount of bytes from the file.
\r
30 virtual size_t write(const void* buffer, size_t sizeToWrite) _IRR_OVERRIDE_;
\r
32 //! Changes position in file, returns true if successful.
\r
33 virtual bool seek(long finalPos, bool relativeMovement = false) _IRR_OVERRIDE_;
\r
35 //! Returns the current position in the file.
\r
36 virtual long getPos() const _IRR_OVERRIDE_;
\r
38 //! Returns name of file.
\r
39 virtual const io::path& getFileName() const _IRR_OVERRIDE_;
\r
41 //! Flush the content of the buffer in the file
\r
42 virtual bool flush() _IRR_OVERRIDE_;
\r
44 //! returns if file is open
\r
45 bool isOpen() const;
\r
48 static IWriteFile* createWriteFile(const io::path& fileName, bool append);
\r
53 void openFile(bool append);
\r
60 } // end namespace io
\r
61 } // end namespace irr
\r