aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CMemoryFile.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CMemoryFile.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CMemoryFile.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CMemoryFile.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CMemoryFile.h
new file mode 100644
index 0000000..98b4c25
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CMemoryFile.h
@@ -0,0 +1,62 @@
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_MEMORY_READ_FILE_H_INCLUDED__
6#define __C_MEMORY_READ_FILE_H_INCLUDED__
7
8#include "IReadFile.h"
9#include "IWriteFile.h"
10#include "irrString.h"
11
12namespace irr
13{
14
15namespace io
16{
17
18 /*!
19 Class for reading and writing from memory.
20 */
21 class CMemoryFile : public IReadFile, public IWriteFile
22 {
23 public:
24
25 //! Constructor
26 CMemoryFile(void* memory, long len, const io::path& fileName, bool deleteMemoryWhenDropped);
27
28 //! Destructor
29 virtual ~CMemoryFile();
30
31 //! returns how much was read
32 virtual s32 read(void* buffer, u32 sizeToRead);
33
34 //! returns how much was written
35 virtual s32 write(const void* buffer, u32 sizeToWrite);
36
37 //! changes position in file, returns true if successful
38 virtual bool seek(long finalPos, bool relativeMovement = false);
39
40 //! returns size of file
41 virtual long getSize() const;
42
43 //! returns where in the file we are.
44 virtual long getPos() const;
45
46 //! returns name of file
47 virtual const io::path& getFileName() const;
48
49 private:
50
51 void *Buffer;
52 long Len;
53 long Pos;
54 io::path Filename;
55 bool deleteMemoryWhenDropped;
56 };
57
58} // end namespace io
59} // end namespace irr
60
61#endif
62