diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2011-06-03 07:18:23 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2011-06-03 07:18:23 +0000 |
| commit | f16f239688b632fc54684c3e0e1430fd89a67db5 (patch) | |
| tree | 6a6d4f3b5d5f4974af4c3cc47c7892e46c5ef201 /src/filemgr.h | |
| parent | 4f1e5849d4a48eb674d81164ba4baba4ad51a89f (diff) | |
| download | build-f16f239688b632fc54684c3e0e1430fd89a67db5.tar.gz build-f16f239688b632fc54684c3e0e1430fd89a67db5.tar.bz2 build-f16f239688b632fc54684c3e0e1430fd89a67db5.tar.xz build-f16f239688b632fc54684c3e0e1430fd89a67db5.zip | |
I added basic support for "opaque" type variables. I think there's one more
tweak to it that I would like to make, but it's fine for now. I also added
open, close, read, and write functions. They work just fine, but I'll also add
a readLine function, and maybe even a readToken function later.
Diffstat (limited to '')
| -rw-r--r-- | src/filemgr.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/filemgr.h b/src/filemgr.h new file mode 100644 index 0000000..517e784 --- /dev/null +++ b/src/filemgr.h | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | #ifndef FILE_MGR_H | ||
| 2 | #define FILE_MGR_H | ||
| 3 | |||
| 4 | #include <bu/singleton.h> | ||
| 5 | #include <bu/hash.h> | ||
| 6 | #include <bu/file.h> | ||
| 7 | |||
| 8 | class FileMgr : public Bu::Singleton<FileMgr> | ||
| 9 | { | ||
| 10 | friend class Bu::Singleton<FileMgr>; | ||
| 11 | private: | ||
| 12 | FileMgr(); | ||
| 13 | virtual ~FileMgr(); | ||
| 14 | |||
| 15 | public: | ||
| 16 | int open( const Bu::String &sPath, int iMode ); | ||
| 17 | Bu::File &get( int iId ); | ||
| 18 | void close( int iId ); | ||
| 19 | |||
| 20 | private: | ||
| 21 | typedef Bu::Hash<int, Bu::File *> FileHash; | ||
| 22 | FileHash hFile; | ||
| 23 | int iNextId; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #endif | ||
