本文整理汇总了C++中StringData::Version方法的典型用法代码示例。如果您正苦于以下问题:C++ StringData::Version方法的具体用法?C++ StringData::Version怎么用?C++ StringData::Version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringData
的用法示例。
在下文中一共展示了StringData::Version方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Finalise
void Finalise(const StringData &data)
{
/* Find the plural form with the most amount of cases. */
int max_plural_forms = 0;
for (uint i = 0; i < lengthof(_plural_forms); i++) {
max_plural_forms = max(max_plural_forms, _plural_forms[i].plural_count);
}
fprintf(this->fh,
"\n"
"static const uint LANGUAGE_PACK_VERSION = 0x%X;\n"
"static const uint LANGUAGE_MAX_PLURAL = %d;\n"
"static const uint LANGUAGE_MAX_PLURAL_FORMS = %d;\n\n",
(uint)data.Version(), (uint)lengthof(_plural_forms), max_plural_forms
);
fprintf(this->fh, "#endif /* TABLE_STRINGS_H */\n");
this->FileWriter::Finalise();
if (CompareFiles(this->filename, this->real_filename)) {
/* files are equal. tmp.xxx is not needed */
unlink(this->filename);
} else {
/* else rename tmp.xxx into filename */
#if defined(WIN32) || defined(WIN64)
unlink(this->real_filename);
#endif
if (rename(this->filename, this->real_filename) == -1) error("rename() failed");
}
}