aboutsummaryrefslogtreecommitdiff
path: root/engines/agos/installshield_cab.h
diff options
context:
space:
mode:
authorMatthew Hoops2011-08-20 16:42:09 -0400
committerMatthew Hoops2011-08-20 16:42:09 -0400
commitf91f0f275660cfa3362036f583619b4ef7d343fd (patch)
tree25bf70d941d09bfe38f6cfabcbef84437afa2705 /engines/agos/installshield_cab.h
parentf408456d14b12152727be31fe00f61b028f18c3b (diff)
downloadscummvm-rg350-f91f0f275660cfa3362036f583619b4ef7d343fd.tar.gz
scummvm-rg350-f91f0f275660cfa3362036f583619b4ef7d343fd.tar.bz2
scummvm-rg350-f91f0f275660cfa3362036f583619b4ef7d343fd.zip
AGOS: Add an archive class for handling InstallShield Cabinets
Diffstat (limited to 'engines/agos/installshield_cab.h')
-rw-r--r--engines/agos/installshield_cab.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/engines/agos/installshield_cab.h b/engines/agos/installshield_cab.h
new file mode 100644
index 0000000000..3fb8e66b03
--- /dev/null
+++ b/engines/agos/installshield_cab.h
@@ -0,0 +1,67 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/archive.h"
+#include "common/scummsys.h"
+#include "common/endian.h"
+#include "common/file.h"
+#include "common/hash-str.h"
+#include "common/hashmap.h"
+#include "common/str.h"
+
+#ifndef AGOS_INSTALLSHIELD_CAB_H
+#define AGOS_INSTALLSHIELD_CAB_H
+
+namespace AGOS {
+
+class InstallShieldCabinet : public Common::Archive {
+public:
+ InstallShieldCabinet();
+ ~InstallShieldCabinet();
+
+ bool open(const Common::String &filename);
+ void close();
+ bool isOpen() const { return _stream != 0; }
+
+ // Common::Archive API implementation
+ bool hasFile(const Common::String &name);
+ int listMembers(Common::ArchiveMemberList &list);
+ Common::ArchiveMemberPtr getMember(const Common::String &name);
+ Common::SeekableReadStream *createReadStreamForMember(const Common::String &name) const;
+
+private:
+ struct FileEntry {
+ uint32 uncompressedSize;
+ uint32 compressedSize;
+ uint32 offset;
+ uint16 flags;
+ };
+
+ Common::SeekableReadStream *_stream;
+
+ typedef Common::HashMap<Common::String, FileEntry, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> FileMap;
+ FileMap _map;
+};
+
+} // End of namespace AGOS
+
+#endif