本文整理汇总了C++中tstring::compare方法的典型用法代码示例。如果您正苦于以下问题:C++ tstring::compare方法的具体用法?C++ tstring::compare怎么用?C++ tstring::compare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tstring
的用法示例。
在下文中一共展示了tstring::compare方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: optionCallback
void IndexMergerAppRunner::optionCallback(const Option& option, const tstring& sValue)
{
if (option.matchFull(_T("merge-index")) || option.matchShort(_T("m")))
{
if (sValue.empty() || (!sValue.compare(_T("merge"))))
{
m_nMergeMode = 1;
}
else if (!sValue.compare(_T("optimize")))
{
m_nMergeMode = 2;
}
else
{
throw UnknownOptionException(sValue);
}
}
else if (option.matchFull(_T("index-path")) || option.matchShort(_T("i")))
{
if (sValue.empty())
{
throw MissingArgumentException("--index-path/-i");
}
m_sIndexPath = sValue;
}
else if (option.matchFull(_T("lexicon-dir")) || option.matchShort(_T("l")))
{
if (sValue.empty())
{
throw MissingArgumentException("--def-field/-d");
}
m_sLexiDir = sValue;
}
}
示例2: if
int
CLink::UrlType(
const tstring& strUrl )
{
int urlType;
const tstring slashSlash = _T("//");
const tstring bslashBslash = _T("\\\\");
if ( ( strUrl.compare( 0, 2, slashSlash ) == 0 ) ||
( strUrl.compare( 0, 2, bslashBslash ) == 0 ) )
{
urlType = urlType_Absolute;
}
else if ( ( strUrl[0] == _T('\\') ) || ( strUrl[0] == _T('/') ) )
{
urlType = urlType_LocalAbsolute;
}
else
{
if ( strUrl.find( _T(':') ) != tstring::npos )
{
urlType = urlType_Absolute;
}
else
{
urlType = urlType_Relative;
}
}
return urlType;
}
示例3: InternalNamesMatch
// Inherits XMLSpy generation source function.
bool CNode::InternalNamesMatch(xmlNodePtr pNode, const tstring& sNamespaceURI, const tstring& sName)
{
const xmlChar* sNodeURI = X("");
const xmlChar* sNodeName = X("");
if(pNode->ns && pNode->ns->href)
sNodeURI = pNode->ns->href;
if(pNode->name)
sNodeName = pNode->name;
return sNamespaceURI.compare(XC2TS(sNodeURI)) == 0 && sName.compare(XC2TS(sNodeName)) == 0;
}
示例4: setMatch
void ColorSettings::setMatch(const tstring& match) {
if (match.compare(_T("$ts$")) == 0) {
bTimestamps = true;
} else if (match.compare(_T("$users$")) == 0) {
bUsers = true;
} else if (match.find(_T("$mynick$")) != tstring::npos) {
bMyNick = true;
} else if (match.find(_T("$Re:")) == 0) {
bUsingRegexp = true;
}
strMatch = match;
}
示例5: GetProcessIDByName
DWORD GetProcessIDByName(tstring processName)
{
DWORD dwProcID = -1;
do
{
HANDLE hProcSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if (hProcSnap == INVALID_HANDLE_VALUE) {
break;
}
PROCESSENTRY32 pe32= {0x00};
pe32.dwSize = sizeof(PROCESSENTRY32);
BOOL bFlags = Process32First(hProcSnap, &pe32);
while(bFlags)
{
if (processName.compare(pe32.szExeFile) == 0) {
dwProcID = pe32.th32ProcessID;
break;
}
bFlags = Process32Next(hProcSnap, &pe32);
}
if (hProcSnap != INVALID_HANDLE_VALUE) {
CloseHandle (hProcSnap);
hProcSnap = NULL;
}
} while (FALSE);
return dwProcID;
}
示例6: connectControl
void Ui::connectControl(tstring name, HWND handle)
{
controls[toansi(name)] = handle;
if(name.compare(_T("WizardForm")) == 0)
uiMainWindowHandle = handle;
}
示例7: StringToRootKey
BOOL CRegistryTool::StringToRootKey(tstring strKey,HKEY *hKey)
{
BOOL bSucceed = FALSE;
transform(strKey.begin(),strKey.end(),strKey.begin(),_totupper);
if(strKey.compare(_T("HKEY_CLASSES_ROOT"))==0)
{
*hKey = HKEY_CLASSES_ROOT;
bSucceed = TRUE;
}
else if(strKey.compare(_T("HKEY_CURRENT_CONFIG"))==0)
{
*hKey = HKEY_CURRENT_CONFIG;
bSucceed = TRUE;
}
else if(strKey.compare(_T("HKEY_CURRENT_USER"))==0)
{
*hKey = HKEY_CURRENT_USER;
bSucceed = TRUE;
}
else if(strKey.compare(_T("HKEY_LOCAL_MACHINE"))==0)
{
*hKey = HKEY_LOCAL_MACHINE;
bSucceed = TRUE;
}
else if(strKey.compare(_T("HKEY_PERFORMANCE_DATA")) ==0)
{
*hKey = HKEY_PERFORMANCE_DATA;
bSucceed = TRUE;
}
else if(strKey.compare(_T("HKEY_USERS")) == 0)
{
*hKey = HKEY_USERS;
bSucceed = TRUE;
}
return bSucceed;
}
示例8: operator
bool operator()(const tstring &a, const tstring &b) const
{
return a.compare(b) < 0;
}
示例9:
gcc_pure
bool operator<(const TaskStore::Item &other) const {
return task_name.compare(other.task_name) < 0;
}
示例10: operator
void operator()(const TCHAR *key, const T &value) {
ok1(last.compare(key) <= 0);
last = key;
}
示例11:
gcc_pure
bool operator==(const TCHAR *relative_path) const {
return path_relative.compare(relative_path) == 0;
}