~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/common/FSNodeZIP.hxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2013-06-28 09:53:13 UTC
  • mfrom: (1.3.6)
  • Revision ID: package-import@ubuntu.com-20130628095313-j8jkkgxpvx1t18ym
Tags: 3.9-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: FSNodeZIP.hxx 2610 2013-02-15 19:04:52Z stephena $
 
17
// $Id: FSNodeZIP.hxx 2746 2013-06-10 14:19:56Z stephena $
18
18
//
19
19
//   Based on code from ScummVM - Scumm Interpreter
20
20
//   Copyright (C) 2002-2004 The ScummVM project
51
51
     */
52
52
    FilesystemNodeZIP(const string& path);
53
53
 
54
 
    bool exists() const      { return _realNode->exists();     }
 
54
    bool exists() const      { return _realNode && _realNode->exists(); }
55
55
    const string& getName() const { return _virtualFile; }
56
56
    const string& getPath() const { return _path;        }
57
57
    string getShortPath() const   { return _shortPath;   }
58
 
    bool isDirectory() const { return _numFiles > 1;           }
59
 
    bool isFile() const      { return _numFiles == 1;          }
60
 
    bool isReadable() const  { return _realNode->isReadable(); }
 
58
    bool isDirectory() const { return _numFiles > 1;  }
 
59
    bool isFile() const      { return _numFiles == 1; }
 
60
    bool isReadable() const  { return _realNode && _realNode->isReadable(); }
61
61
    bool isWritable() const  { return false; }
62
 
    bool isAbsolute() const  { return _realNode->isAbsolute(); }
63
62
 
64
63
    //////////////////////////////////////////////////////////
65
64
    // For now, ZIP files cannot be modified in any way
70
69
    bool getChildren(AbstractFSList& list, ListMode mode, bool hidden) const;
71
70
    AbstractFSNode* getParent() const;
72
71
 
73
 
    bool read(uInt8*& image, uInt32& size) const;
 
72
    uInt32 read(uInt8*& image) const;
74
73
 
75
74
  private:
76
75
    FilesystemNodeZIP(const string& zipfile, const string& virtualfile,
79
78
    void setFlags(const string& zipfile, const string& virtualfile,
80
79
        Common::SharedPtr<AbstractFSNode> realnode);
81
80
 
82
 
  protected:
 
81
  private:
 
82
    /* Error types */
 
83
    enum zip_error
 
84
    {
 
85
      ZIPERR_NONE = 0,
 
86
      ZIPERR_NOT_A_FILE,
 
87
      ZIPERR_NOT_READABLE,
 
88
      ZIPERR_NO_ROMS
 
89
    };
 
90
 
83
91
    Common::SharedPtr<AbstractFSNode> _realNode;
84
92
    string _zipFile, _virtualFile;
85
93
    string _path, _shortPath;
86
 
    bool _isValid;
 
94
    zip_error _error;
87
95
    uInt32 _numFiles;
88
96
};
89
97