本文整理汇总了C++中common::Archive::listMembers方法的典型用法代码示例。如果您正苦于以下问题:C++ Archive::listMembers方法的具体用法?C++ Archive::listMembers怎么用?C++ Archive::listMembers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::Archive
的用法示例。
在下文中一共展示了Archive::listMembers方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFontsBDF
void MacFontManager::loadFontsBDF() {
Common::Archive *dat;
dat = Common::makeZipArchive("classicmacfonts.dat");
if (!dat) {
warning("Could not find classicmacfonts.dat. Falling back to built-in fonts");
_builtInFonts = true;
return;
}
Common::ArchiveMemberList list;
dat->listMembers(list);
for (Common::ArchiveMemberList::iterator it = list.begin(); it != list.end(); ++it) {
Common::SeekableReadStream *stream = dat->createReadStreamForMember((*it)->getName());
Graphics::BdfFont *font = Graphics::BdfFont::loadFont(*stream);
delete stream;
Common::String fontName;
MacFont *macfont;
if (font->getFamilyName() && *font->getFamilyName()) {
fontName = Common::String::format("%s-%s-%d", font->getFamilyName(), font->getFontSlant(), font->getFontSize());
macfont = new MacFont(_fontNames.getVal(font->getFamilyName(), kMacFontNonStandard), font->getFontSize(), parseFontSlant(font->getFontSlant()));
} else { // Get it from the file name
fontName = (*it)->getName();
// Trim the .bdf extension
for (int i = fontName.size() - 1; i >= 0; --i) {
if (fontName[i] == '.') {
while ((uint)i < fontName.size()) {
fontName.deleteLastChar();
}
break;
}
}
macfont = new MacFont(kMacFontNonStandard);
macfont->setName(fontName);
}
FontMan.assignFontToName(fontName, font);
//macfont->setFont(font);
_fontRegistry.setVal(fontName, macfont);
debug(2, " %s", fontName.c_str());
}
_builtInFonts = false;
delete dat;
}
示例2: PackFile
Common::Archive *loadUpdateArchive(Common::SeekableReadStream *data) {
Common::SeekableReadStream *updStream = new PackFile(data);
Common::Archive *cab = new MsCabinet(updStream);
Common::Archive *update = new LangFilter(cab, g_grim->getGameLanguage());
Common::ArchiveMemberList list;
if (update->listMembers(list) == 0) {
delete update;
return 0;
} else
return update;
}
示例3: loadDirectoryAsPackage
bool PackageManager::loadDirectoryAsPackage(const Common::String &directoryName, const Common::String &mountPosition) {
Common::FSNode directory(directoryName);
Common::Archive *folderArchive = new Common::FSDirectory(directory, 6);
if (!directory.exists() || (folderArchive == NULL)) {
BS_LOG_ERRORLN("Unable to mount directory \"%s\" to \"%s\".", directoryName.c_str(), mountPosition.c_str());
return false;
} else {
BS_LOGLN("Directory '%s' mounted as '%s'.", directoryName.c_str(), mountPosition.c_str());
Common::ArchiveMemberList files;
folderArchive->listMembers(files);
debug(0, "Capacity %d", files.size());
_archiveList.push_front(new ArchiveEntry(folderArchive, mountPosition));
return true;
}
}
示例4: loadPackage
bool PackageManager::loadPackage(const Common::String &fileName, const Common::String &mountPosition) {
debug(3, "loadPackage(%s, %s)", fileName.c_str(), mountPosition.c_str());
Common::Archive *zipFile = Common::makeZipArchive(fileName);
if (zipFile == NULL) {
BS_LOG_ERRORLN("Unable to mount file \"%s\" to \"%s\"", fileName.c_str(), mountPosition.c_str());
return false;
} else {
BS_LOGLN("Package '%s' mounted as '%s'.", fileName.c_str(), mountPosition.c_str());
Common::ArchiveMemberList files;
zipFile->listMembers(files);
debug(3, "Capacity %d", files.size());
for (Common::ArchiveMemberList::iterator it = files.begin(); it != files.end(); ++it)
debug(3, "%s", (*it)->getName().c_str());
_archiveList.push_front(new ArchiveEntry(zipFile, mountPosition));
return true;
}
}
示例5: loadFonts
void MacFontManager::loadFonts() {
Common::Archive *dat;
dat = Common::makeZipArchive("classicmacfonts.dat");
if (!dat) {
warning("Could not find classicmacfonts.dat. Falling back to built-in fonts");
_builtInFonts = true;
return;
}
Common::ArchiveMemberList list;
dat->listMembers(list);
for (Common::ArchiveMemberList::iterator it = list.begin(); it != list.end(); ++it) {
Common::SeekableReadStream *stream = dat->createReadStreamForMember((*it)->getName());
Common::MacResManager *fontFile = new Common::MacResManager();
if (!fontFile->loadFromMacBinary(*stream))
continue;
Common::MacResIDArray fonds = fontFile->getResIDArray(MKTAG('F','O','N','D'));
if (fonds.size() > 0) {
for (Common::Array<uint16>::iterator iterator = fonds.begin(); iterator != fonds.end(); ++iterator) {
Common::SeekableReadStream *fond = fontFile->getResource(MKTAG('F', 'O', 'N', 'D'), *iterator);
Common::String familyName = fontFile->getResName(MKTAG('F', 'O', 'N', 'D'), *iterator);
Graphics::MacFontFamily *fontFamily = new MacFontFamily();
fontFamily->load(*fond);
Common::Array<Graphics::MacFontFamily::AsscEntry> *assoc = fontFamily->getAssocTable();
for (uint i = 0; i < assoc->size(); i++) {
debug("size: %d style: %d id: %d", (*assoc)[i]._fontSize, (*assoc)[i]._fontStyle,
(*assoc)[i]._fontID);
Common::SeekableReadStream *fontstream;
MacFont *macfont;
Graphics::MacFONTFont *font;
fontstream = fontFile->getResource(MKTAG('N', 'F', 'N', 'T'), (*assoc)[i]._fontID);
if (!fontstream)
fontstream = fontFile->getResource(MKTAG('F', 'O', 'N', 'T'), (*assoc)[i]._fontID);
if (!fontstream) {
warning("Unknown FontId: %d", (*assoc)[i]._fontID);
continue;
}
font = new Graphics::MacFONTFont;
font->loadFont(*fontstream, fontFamily, (*assoc)[i]._fontSize, (*assoc)[i]._fontStyle);
delete fontstream;
Common::String fontName = Common::String::format("%s-%d-%d", familyName.c_str(), (*assoc)[i]._fontStyle, (*assoc)[i]._fontSize);
macfont = new MacFont(_fontNames.getVal(familyName, kMacFontNonStandard), (*assoc)[i]._fontSize, (*assoc)[i]._fontStyle);
FontMan.assignFontToName(fontName, font);
macfont->setFont(font);
_fontRegistry.setVal(fontName, macfont);
debug(2, " %s", fontName.c_str());
}
delete fond;
}
}
delete fontFile;
}
_builtInFonts = false;
delete dat;
}