本文整理汇总了C++中common::String::wordWrap方法的典型用法代码示例。如果您正苦于以下问题:C++ String::wordWrap方法的具体用法?C++ String::wordWrap怎么用?C++ String::wordWrap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common::String
的用法示例。
在下文中一共展示了String::wordWrap方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reportUnknown
void AdvancedMetaEngine::reportUnknown(const Common::FSNode &path, const ADFilePropertiesMap &filesProps, const ADGameIdList &matchedGameIds) const {
Common::String report = Common::String::format(
_("The game in '%s' seems to be an unknown %s engine game "
"variant.\n\nPlease report the following data to the ResidualVM "
"team at %s along with the name of the game you tried to add and "
"its version, language, etc.:"),
path.getPath().c_str(), getName(), "https://github.com/residualvm/residualvm/issues");
if (matchedGameIds.size()) {
report += "\n\n";
report += _("Matched game IDs:");
report += " ";
for (ADGameIdList::const_iterator gameId = matchedGameIds.begin(); gameId != matchedGameIds.end(); ++gameId) {
if (gameId != matchedGameIds.begin()) {
report += ", ";
}
report += *gameId;
}
}
report += "\n\n";
report.wordWrap(80);
for (ADFilePropertiesMap::const_iterator file = filesProps.begin(); file != filesProps.end(); ++file)
report += Common::String::format(" {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
report += "\n";
g_system->logMessage(LogMessageType::kInfo, report.c_str());
}
示例2: generateUnknownGameReport
Common::String DetectionResults::generateUnknownGameReport(bool translate, uint32 wordwrapAt) const {
assert(!_detectedGames.empty());
const char *reportStart = _s("The game in '%s' seems to be an unknown game variant.\n\n"
"Please report the following data to the ResidualVM team at %s "
"along with the name of the game you tried to add and "
"its version, language, etc.:");
const char *reportEngineHeader = _s("Matched game IDs for the %s engine:");
Common::String report = Common::String::format(
translate ? _(reportStart) : reportStart, _detectedGames[0].path.c_str(),
"https://github.com/residualvm/residualvm/issues"
);
report += "\n";
FilePropertiesMap matchedFiles;
const char *currentEngineName = nullptr;
for (uint i = 0; i < _detectedGames.size(); i++) {
const DetectedGame &game = _detectedGames[i];
if (!game.hasUnknownFiles) continue;
if (!currentEngineName || strcmp(currentEngineName, game.engineName) != 0) {
currentEngineName = game.engineName;
// If the engine is not the same as for the previous entry, print an engine line header
report += "\n";
report += Common::String::format(
translate ? _(reportEngineHeader) : reportEngineHeader,
game.engineName
);
report += " ";
} else {
report += ", ";
}
// Add the gameId to the list of matched games for the engine
// TODO: Use the gameId here instead of the preferred target.
// This is currently impossible due to the AD singleId feature losing the information.
report += game.preferredTarget;
// Consolidate matched files across all engines and detection entries
for (FilePropertiesMap::const_iterator it = game.matchedFiles.begin(); it != game.matchedFiles.end(); it++) {
matchedFiles.setVal(it->_key, it->_value);
}
}
if (wordwrapAt) {
report.wordWrap(wordwrapAt);
}
report += "\n\n";
for (FilePropertiesMap::const_iterator file = matchedFiles.begin(); file != matchedFiles.end(); ++file)
report += Common::String::format(" {\"%s\", 0, \"%s\", %d},\n", file->_key.c_str(), file->_value.md5.c_str(), file->_value.size);
report += "\n";
return report;
}