本文整理汇总了C++中IFileSystem::CreateFile方法的典型用法代码示例。如果您正苦于以下问题:C++ IFileSystem::CreateFile方法的具体用法?C++ IFileSystem::CreateFile怎么用?C++ IFileSystem::CreateFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFileSystem
的用法示例。
在下文中一共展示了IFileSystem::CreateFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
printf("===================================================\n");
printf("=== Unpacker started\n");
printf("=== Unpack directory: %s\n", directoryPath.c_str());
printf("=== Unpack archiveName: %s\n", archiveName.c_str());
printf("===================================================\n");
fs->CreateDirectory(directoryPath.c_str());
ResourceArchive ra;
ra.Open(programmPath + "/" + archiveName);
for (int file = 0; file < ra.GetFileCount(); ++file)
{
String pathName = ra.GetResourcePathname(file);
pathName = directoryPath + pathName;
String::size_type pos = pathName.rfind('/');
if (pos == -1)
{
}else
{
String dirCreate = pathName.substr(0, pos);
fs->CreateDirectory(dirCreate.c_str());
}
int32 size = ra.LoadResource(file, 0);
uint8 * data = new uint8[size];
ra.LoadResource(file, data);
IFile * unpackFile = fs->CreateFile(pathName.c_str(), IO::EFA_CREATE | IO::EFA_WRITE);
if (unpackFile)
{
unpackFile->Write(data, size);
SafeRelease(unpackFile);
}
else
{
}
delete [] data;
}
}else // archive mode of ResourcePacker tool
{
directoryPath = argv[pathIndex];
if (directoryPath.find(':') == -1)
{
directoryPath = programmPath + "/" + directoryPath;
}
if ((pathIndex + 1) > (argc - 1))
{
String::size_type pos = directoryPath.rfind('/');
if (pos == -1)
{
archiveName = directoryPath + ".re";
headerName = directoryPath + ".h";
}else
{