Line | |
---|
1 | /*
|
---|
2 | Copyright (C) 2005-2006 Feeling Software Inc.
|
---|
3 | MIT License: http://www.opensource.org/licenses/mit-license.php
|
---|
4 | */
|
---|
5 | |
---|
6 | #ifndef _FU_FILE_H_ |
---|
7 | #define _FU_FILE_H_ |
---|
8 | |
---|
9 | class FCOLLADA_EXPORT FUFile |
---|
10 | { |
---|
11 | public: |
---|
12 | enum Mode |
---|
13 | { |
---|
14 | READ, |
---|
15 | WRITE |
---|
16 | }; |
---|
17 | |
---|
18 | private: |
---|
19 | FILE* filePtr; |
---|
20 | |
---|
21 | public: |
---|
22 | FUFile(const char* filename, Mode mode); |
---|
23 | FUFile(); |
---|
24 | ~FUFile(); |
---|
25 | |
---|
26 | bool IsOpen() { return filePtr != NULL; } |
---|
27 | |
---|
28 | // Retrieve the file length |
---|
29 | uint32 GetLength(); |
---|
30 | |
---|
31 | // Writes/Reads in a piece of the file from/into the given buffer |
---|
32 | bool Read(void* buffer, size_t length); |
---|
33 | bool Write(const void* buffer, size_t length); |
---|
34 | |
---|
35 | // Flush/close the file stream |
---|
36 | void Flush(); |
---|
37 | void Close(); |
---|
38 | }; |
---|
39 | |
---|
40 | #endif // _FU_FILE_H_ |
---|
Note: See
TracBrowser
for help on using the repository browser.