本文整理汇总了C++中CStdString::Compare方法的典型用法代码示例。如果您正苦于以下问题:C++ CStdString::Compare方法的具体用法?C++ CStdString::Compare怎么用?C++ CStdString::Compare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CStdString
的用法示例。
在下文中一共展示了CStdString::Compare方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Remove
void CGUIList::Remove(CStdString aListItemLabel)
{
EnterCriticalSection(&m_critical);
if (m_listitems.size() > 0)
{
GUILISTITERATOR iterator = m_listitems.begin();
while (iterator != m_listitems.end())
{
if (aListItemLabel.Compare((*iterator)->GetName()) == 0)
{
try
{
delete *iterator;
}
catch (...)
{
// OutputDebugString("Unable to free stuff\r\n");
}
m_listitems.erase(iterator);
break;
}
iterator++;
}
}
LeaveCriticalSection(&m_critical);
}
示例2: TestLoggerPassesFilePathToILogger
void TestLogger::TestLoggerPassesFilePathToILogger()
{
CStdString sExpectedFilePath = L"asdf";
Workshare::Logging::Configuration::SetLogFilePath(sExpectedFilePath.c_str());
MockLogger mock;
MockILogger* mockILogger = static_cast<MockILogger*>(mock.GetFileLogger());
assertMessage( sExpectedFilePath.Compare( mockILogger->m_ConfigData.FileLogPath) == 0, _T("Logger should advise ILogger of FileLog path"));
}
示例3: IsListnumWithListText
bool IsListnumWithListText(const RTFObject* pObj, RTFfile* pFile, CStdString sListText)
{
if (pObj->GetType() != rotField)
return false;
RTFfield* pField = (RTFfield*) pObj;
CStdString sResult = pField->GetResultText().GetData();
return 0 == sResult.Compare(sListText);
}
示例4: SetDataTypeLongStr
BOOL CObjectEntry::SetDataTypeLongStr(CStdString strDataType)
{
BOOL oResult(TRUE);
if(strDataType.Compare("Unknown") == 0) m_DataType = ODT_UNKNOWN;
else if(strDataType.Compare("Boolean") == 0) m_DataType = ODT_BOOLEAN;
else if(strDataType.Compare("Signed 8-Bit Integer") == 0) m_DataType = ODT_INT8;
else if(strDataType.Compare("Signed 16-Bit Integer") == 0) m_DataType = ODT_INT16;
else if(strDataType.Compare("Signed 32-Bit Integer") == 0) m_DataType = ODT_INT32;
else if(strDataType.Compare("Signed 64-Bit Integer") == 0) m_DataType = ODT_INT64;
else if(strDataType.Compare("Unsigned 8-Bit Integer") == 0) m_DataType = ODT_UINT8;
else if(strDataType.Compare("Unsigned 16-Bit Integer") == 0) m_DataType = ODT_UINT16;
else if(strDataType.Compare("Unsigned 32-Bit Integer") == 0) m_DataType = ODT_UINT32;
else if(strDataType.Compare("Unsigned 64-Bit Integer") == 0) m_DataType = ODT_UINT64;
else if(strDataType.Compare("32-Bit Floating Point") == 0) m_DataType = ODT_FLOAT;
else if(strDataType.Compare("String") == 0) m_DataType = ODT_STRING;
else if(strDataType.Compare("Domain") == 0) m_DataType = ODT_DOMAIN;
else m_DataType = ODT_UNKNOWN;
return oResult;
}
示例5: SetDataType
BOOL CObjectEntry::SetDataType(CStdString strDataType)
{
BOOL oResult(TRUE);
if(strDataType.Compare("Unknown") == 0) m_DataType = ODT_UNKNOWN;
else if(strDataType.Compare("Boolean") == 0) m_DataType = ODT_BOOLEAN;
else if(strDataType.Compare("Int8") == 0) m_DataType = ODT_INT8;
else if(strDataType.Compare("Int16") == 0) m_DataType = ODT_INT16;
else if(strDataType.Compare("Int32") == 0) m_DataType = ODT_INT32;
else if(strDataType.Compare("Int64") == 0) m_DataType = ODT_INT64;
else if(strDataType.Compare("UInt8") == 0) m_DataType = ODT_UINT8;
else if(strDataType.Compare("UInt16") == 0) m_DataType = ODT_UINT16;
else if(strDataType.Compare("UInt32") == 0) m_DataType = ODT_UINT32;
else if(strDataType.Compare("UInt64") == 0) m_DataType = ODT_UINT64;
else if(strDataType.Compare("Float") == 0) m_DataType = ODT_FLOAT;
else if(strDataType.Compare("String") == 0) m_DataType = ODT_STRING;
else if(strDataType.Compare("Domain") == 0) m_DataType = ODT_DOMAIN;
else m_DataType = ODT_UNKNOWN;
return oResult;
}
示例6: SetPDOMapping
BOOL CObjectEntry::SetPDOMapping(CStdString strPDOMapping)
{
BOOL oResult(FALSE);
if(strPDOMapping.Compare("1") == 0)
{
m_oPDOMapping = TRUE;
oResult = TRUE;
}
else
{
m_oPDOMapping = FALSE;
oResult = TRUE;
}
return oResult;
}
示例7: OnUpdateRenderingSet
void CMainFrame::OnUpdateRenderingSet(CCmdUI* pCmdUI)
{
CStdString selectedRenderingSet = RenderingSet::GetCurrentRenderingSet();
// TODO STASH THESE ?? unless updated :)
std::vector<std::wstring> vecRenderingSets;
RenderingSet::GetRenderingSetList(vecRenderingSets);
Ribbon::PopulateRenderingSetList(GetRibbonBar());
CStdString sItem = Ribbon::GetRenderingSetNameByID(pCmdUI->m_nID);
if (sItem.IsEmpty() || std::find(vecRenderingSets.begin(), vecRenderingSets.end(), sItem) == vecRenderingSets.end())
{
pCmdUI->Enable(FALSE);
}
else
{
pCmdUI->Enable();
pCmdUI->SetCheck(sItem.Compare(selectedRenderingSet) == 0);
}
}
示例8: ConvertLine
void CDVDSubtitleTagSami::ConvertLine(CDVDOverlayText* pOverlay, const char* line, int len, const char* lang)
{
CStdStringA strUTF8;
strUTF8.assign(line, len);
strUTF8.Trim();
int pos = 0;
int del_start = 0;
while ((pos=m_tags->RegFind(strUTF8.c_str(), pos)) >= 0)
{
// Parse Tags
CStdString fullTag = m_tags->GetMatch(0);
fullTag.ToLower();
strUTF8.erase(pos, fullTag.length());
if (fullTag == "<b>")
{
m_flag[FLAG_BOLD] = true;
strUTF8.insert(pos, "[B]");
pos += 3;
}
else if (fullTag == "</b>" && m_flag[FLAG_BOLD])
{
m_flag[FLAG_BOLD] = false;
strUTF8.insert(pos, "[/B]");
pos += 4;
}
else if (fullTag == "<i>")
{
m_flag[FLAG_ITALIC] = true;
strUTF8.insert(pos, "[I]");
pos += 3;
}
else if (fullTag == "</i>" && m_flag[FLAG_ITALIC])
{
m_flag[FLAG_ITALIC] = false;
strUTF8.insert(pos, "[/I]");
pos += 4;
}
else if (fullTag == "</font>" && m_flag[FLAG_COLOR])
{
m_flag[FLAG_COLOR] = false;
strUTF8.insert(pos, "[/COLOR]");
pos += 8;
}
else if (fullTag.Left(5) == "<font")
{
int pos2 = 5;
while ((pos2 = m_tagOptions->RegFind(fullTag.c_str(), pos2)) >= 0)
{
CStdString tagOptionName = m_tagOptions->GetMatch(1);
CStdString tagOptionValue = m_tagOptions->GetMatch(2);
pos2 += tagOptionName.length() + tagOptionValue.length();
if (tagOptionName == "color")
{
m_flag[FLAG_COLOR] = true;
CStdString tempColorTag = "[COLOR ";
if (tagOptionValue[0] == '#')
{
tagOptionValue.erase(0, 1);
tempColorTag += "FF";
}
else if( tagOptionValue.size() == 6 )
{
bool bHex = true;
for( int i=0 ; i<6 ; i++ )
{
char temp = tagOptionValue[i];
if( !(('0' <= temp && temp <= '9') ||
('a' <= temp && temp <= 'f') ||
('A' <= temp && temp <= 'F') ))
{
bHex = false;
break;
}
}
if( bHex ) tempColorTag += "FF";
}
tempColorTag += tagOptionValue;
tempColorTag += "]";
strUTF8.insert(pos, tempColorTag);
pos += tempColorTag.length();
}
}
}
else if (lang && (fullTag.Left(3) == "<p "))
{
int pos2 = 3;
while ((pos2 = m_tagOptions->RegFind(fullTag.c_str(), pos2)) >= 0)
{
CStdString tagOptionName = m_tagOptions->GetMatch(1);
CStdString tagOptionValue = m_tagOptions->GetMatch(2);
pos2 += tagOptionName.length() + tagOptionValue.length();
if (tagOptionName == "class")
{
if (m_flag[FLAG_LANGUAGE])
{
strUTF8.erase(del_start, pos - del_start);
pos = del_start;
}
if (!tagOptionValue.Compare(lang))
//.........这里部分代码省略.........