当前位置: 首页>>代码示例>>C++>>正文


C++ CStdString::CompareNoCase方法代码示例

本文整理汇总了C++中CStdString::CompareNoCase方法的典型用法代码示例。如果您正苦于以下问题:C++ CStdString::CompareNoCase方法的具体用法?C++ CStdString::CompareNoCase怎么用?C++ CStdString::CompareNoCase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CStdString的用法示例。


在下文中一共展示了CStdString::CompareNoCase方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: TestGetDriveLetter

void CTestLongNameOpen::TestGetDriveLetter()
{
	CStdString sMsg;

	Gen::CFilePath wrd;

	CStdString sExpectedDriveLetter1 = sLongFileNameDifferentDrive.Left(1);
	sExpectedDriveLetter1.MakeUpper();
	sExpectedDriveLetter1 += _T(":");

	CStdString sDriveLetter = wrd.GetDriveLetter(sLongFileNameDifferentDrive);
	sMsg.Format(_T("Expected to get drive '%s' for file %s.  Actually got drive '%s'"), 
		sExpectedDriveLetter1.c_str(),
		sLongFileNameDifferentDrive.c_str(),
		sDriveLetter.c_str());
	assertMessage(sDriveLetter.CompareNoCase(sExpectedDriveLetter1) == 0, sMsg);

	CStdString sExpectedDriveLetter2(TEST_DOC.Left(1));
	sExpectedDriveLetter2.MakeUpper();
	sExpectedDriveLetter2 += _T(":");

	sDriveLetter = wrd.GetDriveLetter(TEST_DOC);
	sMsg.Format(_T("Expected to get drive '%s' for file %s.  Actually got drive '%s'"), 
		sExpectedDriveLetter2.c_str(),
		TEST_DOC.c_str(),
		sDriveLetter.c_str());
	assertMessage(sDriveLetter.CompareNoCase(sExpectedDriveLetter2) == 0, sMsg);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:28,代码来源:TestLongNameOpen.cpp

示例2: checkFolderForTitle

CStdString fileOps::checkFolderForTitle ( CStdString title, CStdString awGroup )
{
  
  CStdString retPath;
  std::vector<CStdString> fileList = LocalFilelist[awGroup];
  for (unsigned int curFl=0;curFl<fileList.size();curFl++) 
  {
    if (title.CompareNoCase(fileList[curFl].Left(title.length()).c_str()) == 0) 
    {
      //Found a Title match
      retPath = baseLocalCachepath + awGroup + "/" + fileList[curFl];
      break;
    }
  }
  if (retPath.IsEmpty())
  {
    updateLocalFilesList(awGroup);
    std::vector<CStdString> fileList = LocalFilelist[awGroup];
    for (unsigned int curFl=0;curFl<fileList.size();curFl++) 
    {
      if (title.CompareNoCase(fileList[curFl].Left(title.length()).c_str()) == 0) 
      {
        //Found a Title match
        retPath = baseLocalCachepath + awGroup + "/" + fileList[curFl];
        break;
      }
    }
  }
  
  return retPath;
}
开发者ID:Kr0nZ,项目名称:xbmc,代码行数:31,代码来源:fileOps.cpp

示例3: CreateInstance

BOOL CProtocolStackFactory::CreateInstance(CStdString p_Name, CProtocolStackBase*& p_rpNewInstance)
{
	BOOL oResult = FALSE;

	if(p_Name.CompareNoCase(PROTOCOL_MAXON_SERIAL_V1) == 0)
	{
		p_rpNewInstance = new CProtocolStack_MaxonSerialV1();
		oResult = TRUE;
	}
	else if(p_Name.CompareNoCase(PROTOCOL_MAXON_SERIAL_V2) == 0)
	{
		p_rpNewInstance = new CProtocolStack_MaxonSerialV2();
		oResult = TRUE;
	}
	else if(p_Name.CompareNoCase(PROTOCOL_CAN_OPEN) == 0)
	{
		p_rpNewInstance = new CProtocolStack_CANopen();
		oResult = TRUE;
	}
	else if(p_Name.CompareNoCase(PROTOCOL_INFOTEAM_SERIAL) == 0)
	{
		p_rpNewInstance = new CProtocolStack_InfoteamSerial();
		oResult = TRUE;
	}

	return oResult;
}
开发者ID:RIVeR-Lab,项目名称:eposcmd,代码行数:27,代码来源:ProtocolStackFactory.cpp

示例4: main

int main(int argc, char* argv[])
{
	// the "service name" reported on the tape messages uses CONFIG.m_serviceName
	// which also defaults to orkaudio-[hostname] but can be different depending on the 
	// value set in config.xml
	char hostname[40];
	ACE_OS::hostname(hostname, 40);
	CStdString serviceName = CStdString("orkaudio-") + hostname;
	Daemon::Initialize(serviceName, MainThread, StopHandler);

	CStdString argument = argv[1];
	if (argc>1)
	{
		if(argument.CompareNoCase("version") == 0)
		{
			printf("Version my 2\n\n");
		}
		if (argument.CompareNoCase("debug") == 0)
		{
			MainThread();
		}
		else if (argument.CompareNoCase("transcode") == 0)
		{
			if(argc == 3)
			{
				Daemon::Singleton()->SetShortLived();
				CStdString file = argv[2];
				Transcode(file);
			}
			else
			{
				printf("Please specify file to transcode\n\n");
			}
		}
		else if (argument.CompareNoCase("install") == 0)
		{
			Daemon::Singleton()->Install();
		}
		else if  (argument.CompareNoCase("uninstall") == 0)
		{
			Daemon::Singleton()->Uninstall();
		}
		else
		{
#ifdef WIN32
	printf("Argument incorrect. Possibilies are:\ninstall: install NT service\nuninstall: uninstall NT service\ntranscode <file>: convert .mcf file to storage format specified in config.xml\n\n");
#else
	printf("Argument incorrect. Possibilies are:\ndebug: run attached to tty\ntranscode <file>: convert .mcf file to storage format specified in config.xml\n\n");
#endif
		}
	}
	else
	{
		// No arguments, launch the daemon
		printf("Starting orkaudio daemon ... (type 'orkaudio debug' if you prefer running attached to tty)\n");
		Daemon::Singleton()->Start();		
	}
	return 0;
}
开发者ID:HiPiH,项目名称:Oreka,代码行数:59,代码来源:OrkAudio.cpp

示例5: IsArchive

bool URIUtils::IsArchive(const CStdString& strFile)
{
  CStdString extension = GetExtension(strFile);

  return (extension.CompareNoCase(".zip") == 0 ||
          extension.CompareNoCase(".rar") == 0 ||
          extension.CompareNoCase(".apk") == 0 ||
          extension.CompareNoCase(".cbz") == 0 ||
          extension.CompareNoCase(".cbr") == 0);
}
开发者ID:jmarshallnz,项目名称:xbmc-database-4.0,代码行数:10,代码来源:URIUtils.cpp

示例6: SetCategory

void CMoviesWindowState::SetCategory(const CStdString& strCategory)
{
  m_sourceController.ActivateAllSources(false,true);
  m_pWindow->SetProperty("is-category-local", false);
  m_pWindow->m_strItemDescription = g_localizeStrings.Get(90041);
  m_vecSortMethods.clear();
  SetPageSize(DISABLE_PAGING);
  m_pWindow->SetProperty(HIDE_SORT_DROPDOWN_FLAG,false);
  m_pWindow->SetProperty(HIDE_FILTER_DROPDOWN_FLAG,false);

  if (strCategory.CompareNoCase("local")==0) // local
  {
    bool IgnorePrefix = g_guiSettings.GetBool("sort.showstarter");
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_ATOZ, IgnorePrefix?SORT_METHOD_LABEL_IGNORE_THE:SORT_METHOD_LABEL, SORT_ORDER_ASC , g_localizeStrings.Get(53535), ""));
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_ZTOA, IgnorePrefix?SORT_METHOD_LABEL_IGNORE_THE:SORT_METHOD_LABEL, SORT_ORDER_DESC , g_localizeStrings.Get(53536), ""));
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_DATE, SORT_METHOD_DATE_ADDED, SORT_ORDER_DESC, g_localizeStrings.Get(51402), ""));
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_RELEASE, SORT_METHOD_RELEASE_DATE, SORT_ORDER_DESC, g_localizeStrings.Get(53537), ""));
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_RELEASE_REVERSE, SORT_METHOD_RELEASE_DATE, SORT_ORDER_ASC, g_localizeStrings.Get(53538), ""));

    m_sourceController.ActivateSource("localmoviesource",true,true);
    m_pWindow->SetProperty("is-category-local", true);
  }
  else if (strCategory.CompareNoCase("trailers") == 0)
  {
    //don't sort the content we get from the server
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_POPULARITY, SORT_METHOD_NONE, SORT_ORDER_NONE, g_localizeStrings.Get(53504), ""));
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_RELEASE, SORT_METHOD_NONE, SORT_ORDER_NONE, g_localizeStrings.Get(53537), ""));

    m_sourceController.ActivateSource("trailerssource",true,true);
    m_pWindow->m_strItemDescription = g_localizeStrings.Get(90045);
    m_pWindow->SetProperty(HIDE_FILTER_DROPDOWN_FLAG,true);
  }
  else
  {
    //don't sort the content we get from the server
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_POPULARITY, SORT_METHOD_NONE, SORT_ORDER_NONE, g_localizeStrings.Get(53504), ""));
    m_vecSortMethods.push_back(CBoxeeSort(VIEW_SORT_METHOD_RELEASE, SORT_METHOD_NONE, SORT_ORDER_NONE, g_localizeStrings.Get(53537), ""));

    // Activate relevant sources according to selected category
    if (strCategory.CompareNoCase("all")==0) //all
    {
      m_sourceController.ActivateSource("remotemoviesource",true,true);
    }
    else if (strCategory.CompareNoCase("store")==0) // store
    {
      m_sourceController.ActivateSource("moviestoresource",true,true);
    }
    SetPageSize(CURRENT_PAGE_SIZE);
  }

  CBrowseWindowState::SetCategory(strCategory);

  m_pWindow->SetProperty("is-category-default", !m_pWindow->GetPropertyBOOL("is-category-local"));
}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:54,代码来源:GUIWindowBoxeeBrowseMovies.cpp

示例7: GetMacros

void CWordBinaryMetadataDiscoveryWorker::GetMacros() 
{
	if (NULL == m_pStorage)
		throw Workshare::Exception(_T("Encountered NULL pointer (m_pStorage)"));

	if (NULL == m_pStrategy)
		throw Workshare::Exception(_T("Encountered NULL pointer (m_pStrategy)"));

	__raise m_pStrategy->OnMacrosBegin();
	IStorage *pStorageMacros;
	
	if(OpenSubStorage(m_pStorage, MACROS_ELEMENT_NAME, &pStorageMacros))
	{
		USES_CONVERSION;
		IStorage *pVBAStorage;
		try
		{
			if(OpenSubStorage(pStorageMacros, _T("VBA"), &pVBAStorage))
			{
				// Enumerate components
				IEnumSTATSTG *pEnumVBA;
				HRESULT hr = pVBAStorage->EnumElements(0, NULL, 0, &pEnumVBA);
				if(SUCCEEDED(hr))
				{
					STATSTG statstg;
					ZeroMemory(&statstg, sizeof(STATSTG));
					CStdString sStream;
					while(S_OK == pEnumVBA->Next(1, &statstg, 0))
					{
						sStream = W2A(statstg.pwcsName);
						//ignore dir and _VBA_PROJECT as these are of no interest
						if(0 != sStream.CompareNoCase(_T("dir")) && 0 != sStream.CompareNoCase(_T("_VBA_PROJECT")))
						{
							__raise m_pStrategy->OnMacro(_bstr_t(sStream.c_str()));
						}
						CoTaskMemFree(statstg.pwcsName);
						statstg.pwcsName = NULL;
					}
					pEnumVBA->Release();
				}
				pVBAStorage->Release();
			}
		}
		catch (std::exception&)
		{
			pStorageMacros->Release();
			throw;
		}

		pStorageMacros->Release();
	}
	__raise m_pStrategy->OnMacrosEnd();

}
开发者ID:killbug2004,项目名称:WSProf,代码行数:54,代码来源:WordBinaryMetadataDiscoveryWorker.cpp

示例8: IsZIP

bool URIUtils::IsZIP(const CStdString& strFile) // also checks for comic books!
{
  CStdString strExtension = GetExtension(strFile);

  if (strExtension.CompareNoCase(".zip") == 0)
    return true;

  if (strExtension.CompareNoCase(".cbz") == 0)
    return true;

  return false;
}
开发者ID:jmarshallnz,项目名称:xbmc-database-4.0,代码行数:12,代码来源:URIUtils.cpp

示例9: IsValidSendForReview

bool RighClickMenuManger::IsValidSendForReview(const CStdString& sFileName)
{
	CStdString sExtension = ATLPath::FindExtension(sFileName.c_str());
	if (sExtension.CompareNoCase(_T(".doc")) == 0)
		return true;
	if (sExtension.CompareNoCase(_T(".docx")) == 0)
		return true;
	if (sExtension.CompareNoCase(_T(".docm")) == 0)
		return true;
	if (sExtension.CompareNoCase(_T(".rtf")) == 0)
		return true;

	return false;
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:14,代码来源:RightClickMenuManger.cpp

示例10: IsRAR

bool URIUtils::IsRAR(const CStdString& strFile)
{
  CStdString strExtension = GetExtension(strFile);

  if (strExtension.Equals(".001") && strFile.Mid(strFile.length()-7,7).CompareNoCase(".ts.001"))
    return true;

  if (strExtension.CompareNoCase(".cbr") == 0)
    return true;

  if (strExtension.CompareNoCase(".rar") == 0)
    return true;

  return false;
}
开发者ID:alltech,项目名称:xbmc,代码行数:15,代码来源:URIUtils.cpp

示例11: InitGatewayToInterface

BOOL CProtocolStack_InfoteamSerial::InitGatewayToInterface(CStdString strInterfaceName)
{
    BOOL oResult = FALSE;

    //Reset
	DeleteGatewayToInterface();

	//Create Gateway
    if(strInterfaceName.CompareNoCase(INTERFACE_RS232) == 0)
    {
        m_pGatewayToInterface = new CGatewayInfoteamSerialToRS232();
    }

	//InitGateway
	if(m_pGatewayToInterface)
	{
		if(m_pGatewayToInterface->InitGateway())
        {
            InitParameterSet();
			InitCommands(m_pGatewayToInterface);
            oResult = TRUE;
        }
        else
        {
            DeleteGatewayToInterface();
        }
	}

	return oResult;
}
开发者ID:RIVeR-Lab,项目名称:eposcmd,代码行数:30,代码来源:ProtocolStack_InfoteamSerial.cpp

示例12: IsEqual

BOOL CHandleRegistration_PS::IsEqual(CProtocolStackBase* pProtocol, CInterfaceManagerBase* pManager, HANDLE hInterfaceHandle)
{
	CStdString interfaceName = _T("");
	CStdString interfaceName2 = _T("");
	BOOL oResult = FALSE;

	if((m_pProtocol && pProtocol) && (m_pInterfaceManager && pManager))
	{
		//Init
		oResult = TRUE;

		//ProtocolStack
		if(oResult && !m_pProtocol->IsEqual(pProtocol)) oResult = FALSE;

		//Interface
		m_pInterfaceManager->I_GetInterfaceName(m_hInterfaceHandle, &interfaceName);
		pManager->I_GetInterfaceName(hInterfaceHandle, &interfaceName2);

		if(oResult && interfaceName.CompareNoCase(interfaceName2) != 0) oResult = FALSE;

		if(oResult && (m_hInterfaceHandle != hInterfaceHandle)) oResult = FALSE;
	}

	return oResult;
}
开发者ID:RIVeR-Lab,项目名称:eposcmd,代码行数:25,代码来源:HandleRegistration_PS.cpp

示例13: sErr

void TestDocProvider5::TestDemote()
{
	CStdString sDocumentName = _T("TestDocument for DemoteToWord");
	CStdString sTestDocID;

	m_pTestHelper->SaveDocument(sDocumentName, sTestDocID);

	try
	{
		BSTR sDocID = ::SysAllocString(CT2CW(sTestDocID.c_str()));
		m_pIDocProvider5->PromoteToSynergy(&sDocID);
		::SysFreeString(sDocID);
	}
	catch(_com_error& e) 
	{
		CStdString sErr(e.ErrorMessage());
		assertMessage(false, _T("Promote to Synergy Failed"));
	}

	try
	{
		m_pIDocProvider5->DemoteToDocument(_bstr_t(sTestDocID));
		tagWSDOCUMENT wsDoc = m_pIDocProvider5->GetDocument(_bstr_t(sTestDocID), 8 /*DF_INFO_ONLY*/);
		CStdString sExt = wsDoc.bstrExtension;
		assertMessage(sExt.CompareNoCase(_T("DOC")) == 0, _T("Failed to demote to document in powerdocs"));
	}
	catch(_com_error& e)
	{
		CStdString sErr(e.ErrorMessage());
		assertMessage(false, sErr.c_str());
	}
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:32,代码来源:TestDocProvider5.cpp

示例14: ValidateRenderingSetOptions

void COptionsDlgSelector::ValidateRenderingSetOptions()
{
	CStdString sOptionsFile;
	m_cboOptionsFile.GetWindowText(sOptionsFile.GetBuffer(MAX_PATH), MAX_PATH);
	sOptionsFile.ReleaseBuffer();
	if (m_bPageModified)
	{
		// Right-Click doesn't come in here, so start the timing from here
		LOG_WS_FUNCTION_SCOPE_MSG(_T("DeltaView Total Comparison Time"));

		if (!sOptionsFile.IsEmpty() && sOptionsFile.CompareNoCase(CStdString::LoadResource(IDS_TXTEX_customRenderingSet6129,_T("Custom rendering set"))) != 0)/* TXTEX_IGNORE */ 
		{
			if (!RenderingSet::LoadRenderingSetIfRequired(sOptionsFile))
			{
				GetApp()->ShowMessageEx(this->m_hWnd, 
					CStdStringW::LoadResource(IDS_TXTEX_theOptionsFileSpecifiedDoesNotHaveCorrectInformationPleaseMakeSureThisIsaValidOptionsFileCurrentSettingsWillBeApplied5086,_T("The options file specified does not have the correct information - please make sure this is a valid options file.\n\nCurrent settings will be applied.")),
					WsOK,
					WsDefault,
					WsErrorIcon,
					L"",
					CDeltaVwApp::GetProductHelpID(HIDC_INVALID_OPTIONS_FILE),
					LOG_LOCATION);
			}
		}
	}
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:26,代码来源:OptionsDlgSelector.cpp

示例15: PathsMatch

bool PathReadWriter::PathsMatch(const CStdString& sPath1, const CStdString& sPath2)
{
	if (sPath1.CompareNoCase(sPath2) == 0)
	{
		return true;
	}
	// Try comparing the two as short-name paths
	TCHAR buf1[MAX_PATH];
	DWORD dwRet = ::GetShortPathName(sPath1, buf1, MAX_PATH);
	if (dwRet <= 0 || dwRet > MAX_PATH)
	{
		// sPath1 doesn't exist, so sPath2 can't be the long-name version of it
		return false;
	}
	::PathRemoveBackslash(buf1);
	TCHAR buf2[MAX_PATH];
	dwRet = ::GetShortPathName(sPath2, buf2, MAX_PATH);
	if (dwRet <= 0 || dwRet > MAX_PATH)
	{
		// sPath2 doesn't exist, so it can't match sPath1, which does exist
		return false;
	}
	::PathRemoveBackslash(buf2);
	return (_tcsicmp(buf1, buf2) == 0);
}
开发者ID:killbug2004,项目名称:WSProf,代码行数:25,代码来源:PathReadWriter.cpp


注:本文中的CStdString::CompareNoCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。