本文整理汇总了C++中ogre::UTFString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ UTFString::length方法的具体用法?C++ UTFString::length怎么用?C++ UTFString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::UTFString
的用法示例。
在下文中一共展示了UTFString::length方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateControls
void CLASS::UpdateControls(CacheEntry *entry)
{
Ogre::String outBasename = "";
Ogre::String outPath = "";
Ogre::StringUtil::splitFilename(entry->filecachename, outBasename, outPath);
SetPreviewImage(outBasename);
if (entry->sectionconfigs.size())
{
m_Config->setVisible(true);
m_Config->removeAllItems();
for (std::vector<Ogre::String>::iterator its = entry->sectionconfigs.begin(); its != entry->sectionconfigs.end(); its++)
{
try
{
m_Config->addItem(*its, *its);
}
catch (...)
{
m_Config->addItem("ENCODING ERROR", *its);
}
}
m_Config->setIndexSelected(0);
m_vehicle_configs.clear();
Ogre::String configstr = *m_Config->getItemDataAt<Ogre::String>(0);
m_vehicle_configs.push_back(configstr);
}
else
{
m_Config->setVisible(false);
}
Ogre::UTFString authors = "";
std::set<Ogre::String> author_names;
for (auto it = entry->authors.begin(); it != entry->authors.end(); it++)
{
if (!it->type.empty() && !it->name.empty())
{
Ogre::String name = it->name;
Ogre::StringUtil::trim(name);
author_names.insert(name);
}
}
for (std::set<Ogre::String>::iterator it = author_names.begin(); it != author_names.end(); it++)
{
Ogre::UTFString name = ANSI_TO_UTF(*it);
authors.append(U(" ") + name);
}
if (authors.length() == 0)
{
authors = _L("no author information available");
}
try
{
m_EntryName->setCaption(convertToMyGUIString(ANSI_TO_UTF(entry->dname)));
}
catch (...)
{
m_EntryName->setCaption("ENCODING ERROR");
}
Ogre::UTFString c = U("#FF7D02"); // colour key shortcut
Ogre::UTFString nc = U("#FFFFFF"); // colour key shortcut
Ogre::UTFString newline = U("\n");
Ogre::UTFString descriptiontxt = U("#66FF33") + ANSI_TO_UTF(entry->description) + nc + newline;
descriptiontxt = descriptiontxt + _L("Author(s): ") + c + authors + nc + newline;
if (entry->version > 0) descriptiontxt = descriptiontxt + _L("Version: ") + c + TOUTFSTRING(entry->version) + nc + newline;
if (entry->wheelcount > 0) descriptiontxt = descriptiontxt + _L("Wheels: ") + c + TOUTFSTRING(entry->wheelcount) + U("x") + TOUTFSTRING(entry->propwheelcount) + nc + newline;
if (entry->truckmass > 0) descriptiontxt = descriptiontxt + _L("Mass: ") + c + TOUTFSTRING((int)(entry->truckmass / 1000.0f)) + U(" ") + _L("tons") + nc + newline;
if (entry->loadmass > 0) descriptiontxt = descriptiontxt + _L("Load Mass: ") + c + TOUTFSTRING((int)(entry->loadmass / 1000.0f)) + U(" ") + _L("tons") + nc + newline;
if (entry->nodecount > 0) descriptiontxt = descriptiontxt + _L("Nodes: ") + c + TOUTFSTRING(entry->nodecount) + nc + newline;
if (entry->beamcount > 0) descriptiontxt = descriptiontxt + _L("Beams: ") + c + TOUTFSTRING(entry->beamcount) + nc + newline;
if (entry->shockcount > 0) descriptiontxt = descriptiontxt + _L("Shocks: ") + c + TOUTFSTRING(entry->shockcount) + nc + newline;
if (entry->hydroscount > 0) descriptiontxt = descriptiontxt + _L("Hydros: ") + c + TOUTFSTRING(entry->hydroscount) + nc + newline;
if (entry->soundsourcescount > 0) descriptiontxt = descriptiontxt + _L("SoundSources: ") + c + TOUTFSTRING(entry->soundsourcescount) + nc + newline;
if (entry->commandscount > 0) descriptiontxt = descriptiontxt + _L("Commands: ") + c + TOUTFSTRING(entry->commandscount) + nc + newline;
if (entry->rotatorscount > 0) descriptiontxt = descriptiontxt + _L("Rotators: ") + c + TOUTFSTRING(entry->rotatorscount) + nc + newline;
if (entry->exhaustscount > 0) descriptiontxt = descriptiontxt + _L("Exhausts: ") + c + TOUTFSTRING(entry->exhaustscount) + nc + newline;
if (entry->flarescount > 0) descriptiontxt = descriptiontxt + _L("Flares: ") + c + TOUTFSTRING(entry->flarescount) + nc + newline;
if (entry->torque > 0) descriptiontxt = descriptiontxt + _L("Torque: ") + c + TOUTFSTRING(entry->torque) + nc + newline;
if (entry->flexbodiescount > 0) descriptiontxt = descriptiontxt + _L("Flexbodies: ") + c + TOUTFSTRING(entry->flexbodiescount) + nc + newline;
if (entry->propscount > 0) descriptiontxt = descriptiontxt + _L("Props: ") + c + TOUTFSTRING(entry->propscount) + nc + newline;
if (entry->wingscount > 0) descriptiontxt = descriptiontxt + _L("Wings: ") + c + TOUTFSTRING(entry->wingscount) + nc + newline;
if (entry->hasSubmeshs) descriptiontxt = descriptiontxt + _L("Using Submeshs: ") + c + TOUTFSTRING(entry->hasSubmeshs) + nc + newline;
if (entry->numgears > 0) descriptiontxt = descriptiontxt + _L("Transmission Gear Count: ") + c + TOUTFSTRING(entry->numgears) + nc + newline;
if (entry->minrpm > 0) descriptiontxt = descriptiontxt + _L("Engine RPM: ") + c + TOUTFSTRING(entry->minrpm) + U(" - ") + TOUTFSTRING(entry->maxrpm) + nc + newline;
if (!entry->uniqueid.empty() && entry->uniqueid != "no-uid") descriptiontxt = descriptiontxt + _L("Unique ID: ") + c + entry->uniqueid + nc + newline;
if (!entry->guid.empty() && entry->guid != "no-guid") descriptiontxt = descriptiontxt + _L("GUID: ") + c + entry->guid + nc + newline;
if (entry->usagecounter > 0) descriptiontxt = descriptiontxt + _L("Times used: ") + c + TOUTFSTRING(entry->usagecounter) + nc + newline;
if (entry->addtimestamp > 0)
{
char tmp[255] = "";
//.........这里部分代码省略.........