ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

winexe_ne.h

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #ifndef COMMON_WINEXE_NE_H
00024 #define COMMON_WINEXE_NE_H
00025 
00026 #include "common/list.h"
00027 #include "common/str.h"
00028 #include "common/winexe.h"
00029 
00030 namespace Common {
00031 
00032 template<class T> class Array;
00033 class SeekableReadStream;
00034 
00041 class NEResources {
00042 public:
00043     NEResources();
00044     ~NEResources();
00045 
00047     void clear();
00048 
00050     bool loadFromEXE(const String &fileName);
00051 
00053     bool loadFromCompressedEXE(const String &fileName);
00054 
00056     bool loadFromEXE(SeekableReadStream *stream);
00057 
00059     const Array<WinResourceID> getIDList(const WinResourceID &type) const;
00060 
00062     SeekableReadStream *getResource(const WinResourceID &type, const WinResourceID &id);
00063 
00064 private:
00066     struct Resource {
00067         WinResourceID id;
00068 
00069         WinResourceID type; 
00070 
00071         uint32 offset; 
00072         uint32 size;   
00073 
00074         uint16 flags;
00075         uint16 handle;
00076         uint16 usage;
00077     };
00078 
00079     SeekableReadStream *_exe;        
00080 
00082     List<Resource> _resources;
00083 
00085     uint32 getResourceTableOffset();
00087     bool readResourceTable(uint32 offset);
00088 
00090     const Resource *findResource(const WinResourceID &type, const WinResourceID &id) const;
00091 
00093     static String getResourceString(SeekableReadStream &exe, uint32 offset);
00094 };
00095 
00096 } // End of namespace Common
00097 
00098 #endif


Generated on Sat Jul 20 2019 05:00:48 for ResidualVM by doxygen 1.7.1
curved edge   curved edge