diff options
author | David Walter Seikel | 2013-01-13 17:24:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:24:39 +1000 |
commit | 393b5cd1dc438872af89d334ef6e5fcc59f27d47 (patch) | |
tree | 6a14521219942a08a1b95cb2f5a923a9edd60f63 /libraries/irrlicht-1.8/source/Irrlicht/CMemoryFile.h | |
parent | Add a note about rasters suggested start up code. (diff) | |
download | SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.zip SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.gz SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.bz2 SledjHamr-393b5cd1dc438872af89d334ef6e5fcc59f27d47.tar.xz |
Added Irrlicht 1.8, but without all the Windows binaries.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/CMemoryFile.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CMemoryFile.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CMemoryFile.h b/libraries/irrlicht-1.8/source/Irrlicht/CMemoryFile.h new file mode 100644 index 0000000..98b4c25 --- /dev/null +++ b/libraries/irrlicht-1.8/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 | |||
12 | namespace irr | ||
13 | { | ||
14 | |||
15 | namespace 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 | |||