本文整理汇总了C++中CStr::LowerCase方法的典型用法代码示例。如果您正苦于以下问题:C++ CStr::LowerCase方法的具体用法?C++ CStr::LowerCase怎么用?C++ CStr::LowerCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStr
的用法示例。
在下文中一共展示了CStr::LowerCase方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FindKeyCode
int FindKeyCode( const CStr& keyname )
{
std::map<CStr,int>::iterator it;
it = keymap.find( keyname.LowerCase() );
if( it != keymap.end() )
return( it->second );
return( 0 );
}
示例2: ParseUsage
static bool ParseUsage(CStr temp)
{
temp = temp.LowerCase().Trim(PS_TRIM_BOTH);
if(temp == "blend" ||
temp == "true" ||
temp == "yes" ||
temp.ToInt() > 0)
return true;
return false;
}
示例3: SendEventToAll
void CGUI::SendEventToAll(const CStr& EventName)
{
// janwas 2006-03-03: spoke with Ykkrosh about EventName case.
// when registering, case is converted to lower - this avoids surprise
// if someone were to get the case wrong and then not notice their
// handler is never called. however, until now, the other end
// (sending events here) wasn't converting to lower case,
// leading to a similar problem.
// now fixed; case is irrelevant since all are converted to lower.
GUI<CStr>::RecurseObject(0, m_BaseObject,
&IGUIObject::ScriptEvent, EventName.LowerCase());
}
示例4: SetEntitySelection
void CUnit::SetEntitySelection(const CStr& selection)
{
CStr selection_lc = selection.LowerCase();
// If we've already selected this, don't do anything
if (m_EntitySelections.find(selection_lc) != m_EntitySelections.end())
return;
// Just allow one selection at a time
m_EntitySelections.clear();
m_EntitySelections.insert(selection_lc);
ReloadObject();
}
示例5: FindInsensitive
long CStr::FindInsensitive(const CStr& Str) const { return LowerCase().Find(Str.LowerCase()); }
示例6: Xeromyces_ReadObject
//.........这里部分代码省略.........
XMBElementList children = Element.GetChildNodes();
for (i=0; i<children.Count; ++i)
{
// Get node
XMBElement child = children.Item(i);
// Check what name the elements got
int element_name = child.GetNodeName();
if (element_name == elmt_object)
{
// Call this function on the child
Xeromyces_ReadObject(child, pFile, object, NameSubst, Paths);
}
else if (element_name == elmt_action)
{
// Scripted <action> element
// Check for a 'file' parameter
CStrW filename (child.GetAttributes().GetNamedItem(attr_file).FromUTF8());
CStr code;
// If there is a file, open it and use it as the code
if (! filename.empty())
{
Paths.insert(filename);
CVFSFile scriptfile;
if (scriptfile.Load(g_VFS, filename) != PSRETURN_OK)
{
LOGERROR(L"Error opening GUI script action file '%ls'", filename.c_str());
throw PSERROR_GUI_JSOpenFailed();
}
code = scriptfile.DecodeUTF8(); // assume it's UTF-8
}
// Read the inline code (concatenating to the file code, if both are specified)
code += CStr(child.GetText());
CStr action = CStr(child.GetAttributes().GetNamedItem(attr_on));
// We need to set the GUI this object belongs to because RegisterScriptHandler requires an associated GUI.
object->SetGUI(this);
object->RegisterScriptHandler(action.LowerCase(), code, this);
}
else if (element_name == elmt_repeat)
{
Xeromyces_ReadRepeat(child, pFile, object, Paths);
}
else
{
// Try making the object read the tag.
if (!object->HandleAdditionalChildren(child, pFile))
{
LOGERROR(L"GUI: (object: %hs) Reading unknown children for its type", object->GetPresentableName().c_str());
}
}
}
//
// Check if Z wasn't manually set
//
if (!ManuallySetZ)
{
// Set it automatically to 10 plus its parents
bool absolute;
GUI<bool>::GetSetting(object, "absolute", absolute);
// If the object is absolute, we'll have to get the parent's Z buffered,
// and add to that!
if (absolute)
{
GUI<float>::SetSetting(object, "z", pParent->GetBufferedZ() + 10.f, true);
}
else
// If the object is relative, then we'll just store Z as "10"
{
GUI<float>::SetSetting(object, "z", 10.f, true);
}
}
//
// Input Child
//
try
{
if (pParent == m_BaseObject)
AddObject(object);
else
pParent->AddChild(object);
}
catch (PSERROR_GUI& e)
{
LOGERROR(L"GUI error: %hs", e.what());
}
}
示例7: Xeromyces_ReadObject
//.........这里部分代码省略.........
CStr code;
// If there is a file, open it and use it as the code
if (!filename.empty())
{
Paths.insert(filename);
CVFSFile scriptfile;
if (scriptfile.Load(g_VFS, filename) != PSRETURN_OK)
{
LOGERROR("Error opening GUI script action file '%s'", utf8_from_wstring(filename));
throw PSERROR_GUI_JSOpenFailed();
}
code = scriptfile.DecodeUTF8(); // assume it's UTF-8
}
XMBElementList grandchildren = child.GetChildNodes();
if (!grandchildren.empty()) // The <action> element contains <keep> and <translate> tags.
for (XMBElement grandchild : grandchildren)
{
if (grandchild.GetNodeName() == elmt_translate)
code += g_L10n.Translate(grandchild.GetText());
else if (grandchild.GetNodeName() == elmt_keep)
code += grandchild.GetText();
}
else // It’s pure JavaScript code.
// Read the inline code (concatenating to the file code, if both are specified)
code += CStr(child.GetText());
CStr action = CStr(child.GetAttributes().GetNamedItem(attr_on));
// We need to set the GUI this object belongs to because RegisterScriptHandler requires an associated GUI.
object->SetGUI(this);
object->RegisterScriptHandler(action.LowerCase(), code, this);
}
else if (element_name == elmt_repeat)
{
Xeromyces_ReadRepeat(child, pFile, object, NameSubst, Paths, nesting_depth);
}
else if (element_name == elmt_translatableAttribute)
{
// This is an element in the form “<translatableAttribute id="attributeName">attributeValue</translatableAttribute>”.
CStr attributeName(child.GetAttributes().GetNamedItem(attr_id)); // Read the attribute name.
if (attributeName.empty())
{
LOGERROR("GUI: ‘translatableAttribute’ XML element with empty ‘id’ XML attribute found. (object: %s)", object->GetPresentableName().c_str());
continue;
}
CStr value(child.GetText());
if (value.empty())
continue;
CStr context(child.GetAttributes().GetNamedItem(attr_context)); // Read the context if any.
if (!context.empty())
{
CStr translatedValue(g_L10n.TranslateWithContext(context, value));
object->SetSetting(attributeName, translatedValue.FromUTF8(), true);
}
else
{
CStr translatedValue(g_L10n.Translate(value));
object->SetSetting(attributeName, translatedValue.FromUTF8(), true);
}
}
else if (element_name == elmt_attribute)