本文整理汇总了C++中mygui::UString::find方法的典型用法代码示例。如果您正苦于以下问题:C++ UString::find方法的具体用法?C++ UString::find怎么用?C++ UString::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mygui::UString
的用法示例。
在下文中一共展示了UString::find方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: executeCommand
bool CommandManager::executeCommand(const MyGUI::UString& _command)
{
bool result = false;
MyGUI::UString command = _command;
size_t index = _command.find('.');
MYGUI_LOG(Warning , "+++++:Menu Command apply :" << command << "+++++");
if (index != MyGUI::UString::npos)
{
command = _command.substr(0, index);
mData = _command.substr(index + 1);
}
MapDelegate::iterator iter = mDelegates.find(command);
if (iter != mDelegates.end())
{
iter->second(command, result);
}
else
{
MYGUI_LOG(Warning, "Command '" << command << "' not found");
}
mData.clear();
return result;
}
示例2: convertProjectName
MyGUI::UString EditorState::convertProjectName(const MyGUI::UString& _fileName)
{
size_t pos = mFileName.find_last_of("\\/");
MyGUI::UString shortName = pos == MyGUI::UString::npos ? mFileName : mFileName.substr(pos + 1);
addUserTag("ResourceName", shortName);
size_t index = _fileName.find("|");
if (index == MyGUI::UString::npos)
return _fileName;
MyGUI::UString fileName = _fileName.substr(0, index);
MyGUI::UString itemIndexName = _fileName.substr(index + 1);
size_t itemIndex = MyGUI::utility::parseValue<size_t>(itemIndexName);
MyGUI::xml::Document doc;
if (!doc.open(fileName))
return _fileName;
MyGUI::xml::ElementPtr root = doc.getRoot();
if ((nullptr == root) || (root->getName() != "MyGUI"))
return _fileName;
if (root->findAttribute("type") == "Resource")
{
// берем детей и крутимся
MyGUI::xml::ElementEnumerator element = root->getElementEnumerator();
while (element.next("Resource"))
{
if (element->findAttribute("type") == "ResourceLayout")
{
if (itemIndex == 0)
{
// поменять на теги
std::string resourceName = element->findAttribute("name");
addUserTag("ResourceName", resourceName);
return MyGUI::utility::toString(fileName, " [", resourceName, "]");
}
else
{
itemIndex --;
}
}
}
}
return _fileName;
}
示例3: isProjectFile
bool EditorState::isProjectFile(const MyGUI::UString& _fileName)
{
size_t index = _fileName.find("|");
return (index != MyGUI::UString::npos);
}