~ubuntu-branches/ubuntu/intrepid/enigma/intrepid

« back to all changes in this revision

Viewing changes to src/file_internal.hh

  • Committer: Bazaar Package Importer
  • Author(s): Erich Schubert
  • Date: 2005-08-28 15:30:09 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050828153009-sky64kb6tcq37xt5
Tags: 0.92.1-1
* New upstream subversion checkout
* Remove menu.s3m, which we are allowed to distributed but not to modify
  also copyright notice is confusing... (Closes: #321669)
* Rebuild with new libzipios (Closes: #325405)
  I hope this works without a versioned build-dependency
* Added "enigma replaces enigma-data" for upgrades (Closes: #308558)
* Added notes about the fonts copyright.
* updated to policy 3.6.2.1 (no changes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
namespace file
2
 
{
3
 
    using std::string;
4
 
 
5
 
 
6
 
    enum FSType {
7
 
        FS_DIRECTORY,
8
 
        FS_ZIPFILE,
9
 
    };
10
 
 
11
 
    struct FSEntry {
12
 
        FSType      type;
13
 
        std::string location;
14
 
 
15
 
        FSEntry (FSType type_, const std::string &location_)
16
 
        : type (type_), location (location_)
17
 
        {}
18
 
    };
19
 
 
20
 
    class GameFS {
21
 
    public:
22
 
        GameFS::GameFS();
23
 
 
24
 
        void clear() { entries.clear(); }
25
 
                
26
 
        void append_dir (const string &path);
27
 
        void prepend_dir (const string &path);
28
 
 
29
 
        void prepend_zip (const string &filename);
30
 
 
31
 
        FileHandle *find_file (const FileName &);
32
 
        
33
 
        bool find_file(const string &filename, string &dest) const;
34
 
                
35
 
        std::list <string> find_files (const string &folder,
36
 
                                       const string &filename) const;
37
 
                
38
 
    private:
39
 
        // Variables
40
 
        std::vector<FSEntry> entries;
41
 
    };
42
 
 
43
 
 
44
 
    class FileHandle_Dir : public FileHandle {
45
 
        std::string m_name;
46
 
        std::string m_path;
47
 
        bool m_exists;          // File exists
48
 
 
49
 
    public:
50
 
        FileHandle_Dir (const std::string &name);
51
 
 
52
 
        // FileHandle interface.
53
 
        bool   exists() const;
54
 
        void   read (ByteVec &buffer);
55
 
    };
56
 
 
57
 
    class FileHandle_Zip : public FileHandle {
58
 
    public:
59
 
        FileHandle_Zip();
60
 
 
61
 
        // FileHandle interface.
62
 
        bool   exists() const;
63
 
        void   read (ByteVec &buffer);
64
 
    };
65
 
}