aboutsummaryrefslogtreecommitdiff
path: root/src/filemgr.h
blob: 5241eee0a36aab79e3a2b8a8ef4c8781e9fcd6e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef FILE_MGR_H
#define FILE_MGR_H

#include <bu/singleton.h>
#include <bu/hash.h>
#include <bu/file.h>

class FileMgr : public Bu::Singleton<FileMgr>
{
friend class Bu::Singleton<FileMgr>;
private:
    FileMgr();
    virtual ~FileMgr();

public:
    int open( const Bu::String &sPath, int iMode );
    Bu::File &get( int iId );
    void close( int iId );

private:
    typedef Bu::Hash<int, Bu::File *> FileHash;
    FileHash hFile;
    int iNextId;
};

#endif