本文整理汇总了C++中FResourceFile::Open方法的典型用法代码示例。如果您正苦于以下问题:C++ FResourceFile::Open方法的具体用法?C++ FResourceFile::Open怎么用?C++ FResourceFile::Open使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FResourceFile
的用法示例。
在下文中一共展示了FResourceFile::Open方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FDirectory
FResourceFile *CheckDir(const char *filename, FileReader *file, bool quiet)
{
FResourceFile *rf = new FDirectory(filename);
if (rf->Open(quiet)) return rf;
delete rf;
return NULL;
}
示例2: FLumpFile
FResourceFile *CheckLump(const char *filename, FileReader *file, bool quiet)
{
// always succeeds
FResourceFile *rf = new FLumpFile(filename, file);
if (rf->Open(quiet)) return rf;
delete rf;
return NULL;
}
示例3: FPakFile
FResourceFile *CheckPak(const char *filename, FileReader *file, bool quiet)
{
char head[4];
if (file->GetLength() >= 12)
{
file->Seek(0, SEEK_SET);
file->Read(&head, 4);
file->Seek(0, SEEK_SET);
if (!memcmp(head, "PACK", 4))
{
FResourceFile *rf = new FPakFile(filename, file);
if (rf->Open(quiet)) return rf;
delete rf;
}
}
return NULL;
}
示例4: FGrpFile
FResourceFile *CheckGRP(const char *filename, FileReader *file, bool quiet)
{
char head[12];
if (file->GetLength() >= 12)
{
file->Seek(0, SEEK_SET);
file->Read(&head, 12);
file->Seek(0, SEEK_SET);
if (!memcmp(head, "KenSilverman", 12))
{
FResourceFile *rf = new FGrpFile(filename, file);
if (rf->Open(quiet)) return rf;
delete rf;
}
}
return NULL;
}
示例5: FZipFile
FResourceFile *CheckZip(const char *filename, FileReader *file, bool quiet)
{
char head[4];
if (file->GetLength() >= (long)sizeof(FZipLocalFileHeader))
{
file->Seek(0, SEEK_SET);
file->Read(&head, 4);
file->Seek(0, SEEK_SET);
if (!memcmp(head, "PK\x3\x4", 4))
{
FResourceFile *rf = new FZipFile(filename, file);
if (rf->Open(quiet)) return rf;
delete rf;
}
}
return NULL;
}
示例6:
FResourceFile *Check7Z(const char *filename, FileReader *file, bool quiet)
{
char head[k7zSignatureSize];
if (file->GetLength() >= k7zSignatureSize)
{
file->Seek(0, SEEK_SET);
file->Read(&head, k7zSignatureSize);
file->Seek(0, SEEK_SET);
if (!memcmp(head, k7zSignature, k7zSignatureSize))
{
FResourceFile *rf = new F7ZFile(filename, file);
if (rf->Open(quiet)) return rf;
rf->Reader = NULL; // to avoid destruction of reader
delete rf;
}
}
return NULL;
}