本文整理汇总了C++中FileFormat::createFilewithtype方法的典型用法代码示例。如果您正苦于以下问题:C++ FileFormat::createFilewithtype方法的具体用法?C++ FileFormat::createFilewithtype怎么用?C++ FileFormat::createFilewithtype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileFormat
的用法示例。
在下文中一共展示了FileFormat::createFilewithtype方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
McoStatus PrinterType::Save(void)
{
int i;
StandardFileReply soutReply;
Str255 prompt;
Str255 outname = "\p";
McoStatus status = MCO_SUCCESS;
FileFormat *filef;
int magic_num = PRINTERTYPE_MAGICNUM;
int version = PRINTERTYPE_VERSION;
GetIndString(prompt,PROMPT_STRINGS,SETTINGS_PROMPT);
StandardPutFile(prompt, outname, &soutReply);
if(!soutReply.sfGood) return MCO_CANCEL;
filef = new FileFormat;
status = filef->createFilewithtype(&soutReply.sfFile,soutReply.sfScript,MONACO_SIG,'MCO6');
if (status != MCO_SUCCESS) goto bail;
status = filef->relWrite(sizeof(int),(char*)&magic_num);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(int),(char*)&version);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(ConData),(char*)&data);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(int),(char*)&num_hands);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(double)*31,(char*)x_hands);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(double)*31,(char*)y_hands);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(int),(char*)&sim_num);
if (status != MCO_SUCCESS) goto bailclose;
status = filef->relWrite(sizeof(int),(char*)&num_tweaks);
if (status != MCO_SUCCESS) goto bailclose;
for (i=0; i<num_tweaks; i++)
{
status = filef->relWrite(sizeof(Tweak_Element),(char*)tweaks[i]);
if (status != MCO_SUCCESS) goto bailclose;
}
bailclose:
filef->closeFile();
bail:
delete filef;
return status;
}