00001
00002
00003
00004
00005
00011 #ifndef HRESMGR_H
00012 #define HRESMGR_H
00013
00014 #ifndef HBASE_H
00015 # error HBase.h must be included BEFORE HResMgr.h
00016 #endif
00017
00018 #include "HZipFile.h"
00072 class HResMgr : public HZipFile
00073 {
00074 typedef HZipFile base_class;
00075 static StringPtr ClassName(void) { return "HResMgr"; }
00076
00077
00078
00079
00080
00081
00082
00083 public:
00084 HResMgr(void) : HZipFile()
00085 { }
00086 ~HResMgr(void)
00087 { }
00088
00089
00090
00091 public:
00104 ErrCode
00105 Extract(StringPtr pstrSrc, StringPtr pstrDst = NULL)
00106 {
00107 return base_class::Extract(pstrSrc, pstrDst);
00108 }
00115 ErrCode
00116 Open(HFilename & fsFile)
00117 {
00118 ErrCode ec = HError::NoError();
00119
00120 while ((ec = base_class::Open(fsFile, O_BINARY|O_RDONLY)) != NO_ERROR)
00121 {
00122 if (Humble::PopUpYesNo( "Startup Error",
00123 "Unable to load resource file \"%s\". Do you want to search for it?",
00124 fsFile.GetString()) != ID_YES)
00125 {
00126 DEBUG_LOG("HResMgr::Open() => user chose not to search for file.\n");
00127 ASSERT(ec != NO_ERROR);
00128 break;
00129 }
00130
00131
00132
00133 sSelectFileTypes sTypes[] = { { TEXT("zip"), TEXT("Zip Archive") },
00134 { TEXT("pkg"), TEXT("Package") },
00135 { NULL, NULL } };
00136
00137 if (!fsFile.Select( "Select resource file...",
00138 SELECTFILE_OPEN | SELECTFILE_INITIAL_DIR,
00139 sTypes))
00140 {
00141 DEBUG_LOG("HResMgr::Open() => user canceled file selection.\n");
00142 ASSERT(ec != NO_ERROR);
00143 break;
00144 }
00145 }
00146
00147 return ec;
00148 }
00149 };
00150
00151 #endif // HRESMGR_H
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178