aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CReadFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CReadFile.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CReadFile.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CReadFile.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CReadFile.h
new file mode 100644
index 0000000..09f3501
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CReadFile.h
@@ -0,0 +1,64 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_READ_FILE_H_INCLUDED__
6#define __C_READ_FILE_H_INCLUDED__
7
8#include <stdio.h>
9#include "IReadFile.h"
10#include "irrString.h"
11
12namespace irr
13{
14
15namespace io
16{
17
18 /*!
19 Class for reading a real file from disk.
20 */
21 class CReadFile : public IReadFile
22 {
23 public:
24
25 CReadFile(const io::path& fileName);
26
27 virtual ~CReadFile();
28
29 //! returns how much was read
30 virtual s32 read(void* buffer, u32 sizeToRead);
31
32 //! changes position in file, returns true if successful
33 virtual bool seek(long finalPos, bool relativeMovement = false);
34
35 //! returns size of file
36 virtual long getSize() const;
37
38 //! returns if file is open
39 virtual bool isOpen() const
40 {
41 return File != 0;
42 }
43
44 //! returns where in the file we are.
45 virtual long getPos() const;
46
47 //! returns name of file
48 virtual const io::path& getFileName() const;
49
50 private:
51
52 //! opens the file
53 void openFile();
54
55 FILE* File;
56 long FileSize;
57 io::path Filename;
58 };
59
60} // end namespace io
61} // end namespace irr
62
63#endif
64