本文整理汇总了C++中Format::GetScanner方法的典型用法代码示例。如果您正苦于以下问题:C++ Format::GetScanner方法的具体用法?C++ Format::GetScanner怎么用?C++ Format::GetScanner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Format
的用法示例。
在下文中一共展示了Format::GetScanner方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Apply
PostLoadCommand MAMELoader::Apply(RawFile *file) {
if (!bLoadedXml)
return KEEP_IT;
if (file->GetExtension() != L"zip")
return KEEP_IT;
wstring fullfilename_w = file->GetFileName();
string fullfilename = wstring2string(fullfilename_w);
const char *endoffilename = strrchr(fullfilename.c_str(), '.');
char filename[10] = {0};
strncpy(filename, fullfilename.c_str(), endoffilename - fullfilename.c_str());
// look up the game name in our little database
GameMap::iterator it = gamemap.find(filename);
if (it == gamemap.end()) //if we couldn't find an entry for the game name
return KEEP_IT; //don't do anything
MAMEGameEntry *gameentry = it->second;
//Get the format given and check if it is defined in VGMTrans
Format *fmt = Format::GetFormatFromName(gameentry->format);
if (!fmt)
return KEEP_IT;
//try to open up the game zip
wstring fullpath = file->GetFullPath();
string test = wstring2string(fullpath);
unzFile cur_file = unzOpen(wstring2string(fullpath).c_str());
if (!cur_file) {
return KEEP_IT;
}
int ret;
//Now we try to load the rom groups. We save the created file into the rom MAMERomGroupEntry's file member
// Note that this does not check for an error, so the romgroup entry's file member may receive NULL.
// This must be checked for in Scan().
for (list<MAMERomGroupEntry>::iterator it = gameentry->romgroupentries.begin();
it != gameentry->romgroupentries.end(); it++)
it->file = LoadRomGroup(&(*it), gameentry->format, cur_file);
fmt->GetScanner().Scan(NULL, gameentry);
for (list<MAMERomGroupEntry>::iterator it = gameentry->romgroupentries.begin();
it != gameentry->romgroupentries.end(); it++) {
if (it->file != NULL)
pRoot->SetupNewRawFile(it->file);
}
ret = unzClose(cur_file);
if (ret != UNZ_OK) {
return KEEP_IT;
}
return DELETE_IT;
}
示例2: AddScanner
void VGMRoot::AddScanner(const string& formatname)
{
Format* fmt = Format::GetFormatFromName(formatname);
if (!fmt)
return;
VGMScanner& scanner = fmt->GetScanner();
if (!scanner.Init())
return;
vScanner.push_back(&scanner);
}