本文整理汇总了C++中TextFile::writeFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ TextFile::writeFormat方法的具体用法?C++ TextFile::writeFormat怎么用?C++ TextFile::writeFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextFile
的用法示例。
在下文中一共展示了TextFile::writeFormat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeNocashSym
void SymbolData::writeNocashSym()
{
if (nocashSymFileName.empty())
return;
std::vector<NocashSymEntry> entries;
for (size_t k = 0; k < modules.size(); k++)
{
SymDataModule& module = modules[k];
for (size_t i = 0; i < module.symbols.size(); i++)
{
SymDataSymbol& sym = module.symbols[i];
NocashSymEntry entry;
entry.address = sym.address;
entry.text = sym.name;
entries.push_back(entry);
}
for (size_t i = 0; i < module.data.size(); i++)
{
SymDataData& data = module.data[i];
NocashSymEntry entry;
entry.address = data.address;
switch (data.type)
{
case Data8:
entry.text = formatString(".byt:%04X",data.size);
break;
case Data16:
entry.text = formatString(".wrd:%04X",data.size);
break;
case Data32:
entry.text = formatString(".dbl:%04X",data.size);
break;
case DataAscii:
entry.text = formatString(".asc:%04X",data.size);
break;
}
entries.push_back(entry);
}
}
std::sort(entries.begin(),entries.end());
TextFile file;
if (file.open(nocashSymFileName,TextFile::Write,TextFile::ASCII) == false)
{
Logger::printError(Logger::Error,L"Could not open sym file %s.",file.getFileName().c_str());
return;
}
file.writeLine(L"00000000 0");
for (size_t i = 0; i < entries.size(); i++)
{
file.writeFormat(L"%08X %S\n",entries[i].address,entries[i].text.c_str());
}
file.write("\x1A");
file.close();
}