aboutsummaryrefslogtreecommitdiff
path: root/src/filemgr.h
blob: 2dbfc698fed9117ac18f1e05e9e9b8ee312bc853 (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
27
28
29
30
31
32
33
/*
 * Copyright (C) 2007-2014 Xagasoft, All rights reserved.
 *
 * This file is part of the Xagasoft Build and is released under the
 * terms of the license contained in the file LICENSE.
 */

#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