本文整理汇总了C++中PString::Format_S1方法的典型用法代码示例。如果您正苦于以下问题:C++ PString::Format_S1方法的具体用法?C++ PString::Format_S1怎么用?C++ PString::Format_S1使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PString
的用法示例。
在下文中一共展示了PString::Format_S1方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadModule
//.........这里部分代码省略.........
if (!typeString.IsEmpty())
file->SetFileType(typeString);
}
catch(PFileException e)
{
// If we can't set the file type, we ignore the error.
// An error will occure on e.g. CD-ROM disks
;
}
}
// Yap, load the module
convInfo.moduleFile->SeekToBegin();
apResult = player->LoadModule(playerInfo->index, convInfo.moduleFile, playerError);
if (apResult != AP_OK)
{
// Well, something went wrong when loading the file
//
// Build the error string
errorStr.Format_S3(GetApp()->resource, IDS_CMDERR_LOAD_MODULE, fileName, playerInfo->addOnName, playerError);
// Delete the player
playerInfo->loader->DeleteInstance(player);
player = NULL;
playerInfo = NULL;
result = false;
}
else
{
// Get module information
playerName = playerInfo->addOnName;
if (modConverted)
{
moduleFormat = convInfo.modKind;
if (moduleFormat.IsEmpty())
moduleFormat = playerInfo->addOnName;
}
else
moduleFormat = playerInfo->addOnName;
// Should the file still be open?
if (player->GetSupportFlags(playerInfo->index) & appDontCloseFile)
{
// Yes, remember the file pointer
if (modConverted)
{
usingFile = convInfo.newModuleFile;
convInfo.newModuleFile = NULL;
}
else
{
usingFile = file;
file = NULL;
}
}
}
}
else
{
// Nup, send an error back
errorStr.Format_S1(GetApp()->resource, IDS_CMDERR_UNKNOWN_MODULE, fileName);
}
}
catch(...)
{
infoList->DoneReading();
throw;
}
// Done with the list
infoList->DoneReading();
}
catch(PFileException e)
{
PString err;
char *fileStr, *errStr;
// Build error message
err = PSystem::GetErrorString(e.errorNum);
errorStr.Format(GetApp()->resource, IDS_CMDERR_FILE, (fileStr = fileName.GetString()), e.errorNum, (errStr = err.GetString()));
err.FreeBuffer(errStr);
fileName.FreeBuffer(fileStr);
result = false;
}
catch(...)
{
;
}
// Close the files again
delete convInfo.newModuleFile;
delete file;
file = NULL;
return (result);
}