コード例 #1
0
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);
}
コード例 #2
0
ファイル: fileOps.cpp プロジェクト: Kr0nZ/xbmc
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;
}
コード例 #3
0
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;
}
コード例 #4
0
ファイル: OrkAudio.cpp プロジェクト: HiPiH/Oreka
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;
}
コード例 #5
0
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);
}
コード例 #6
0
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"));
}
コード例 #7
0
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();

}
コード例 #8
0
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;
}
コード例 #9
0
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;
}
コード例 #10
0
ファイル: URIUtils.cpp プロジェクト: alltech/xbmc
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;
}
コード例 #11
0
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;
}
コード例 #12
0
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;
}
コード例 #13
0
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());
	}
}
コード例 #14
0
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);
			}
		}
	}
}
コード例 #15
0
ファイル: PathReadWriter.cpp プロジェクト: killbug2004/WSProf
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);
}
コード例 #16
0
void CLocalFilesSource::RequestItems(bool bUseCurPath)
{
  CBoxeeSort previousSort = m_sourceSort;
  CStdString strPath = GetBasePath();


  if (strPath.Find("sources://all") >= 0 || strPath.CompareNoCase("network://protocols") == 0)
  {
    m_sourceSort.Reset();
  }
  else if (strPath.IsEmpty() ||
      strPath == "network:/" ||
      strPath.Equals("afp:/") ||
      (strPath.Left(6).Equals("afp://") && strPath.Right(6).Equals(".local")) ||
      strPath.Left(15).Equals("smb://computers") ||
      strPath == "nfs:/" ||
      (strPath.Left(6).Equals("nfs://") && strPath.Right(6).Equals(".local")) ||
      strPath.Left(6).Equals("upnp:/") ||
      strPath.Left(5).Equals("bms:/")
      )
  {
    CBoxeeSort specialCasesSort(VIEW_SORT_METHOD_ATOZ, SORT_METHOD_LABEL, SORT_ORDER_ASC, g_localizeStrings.Get(53505), "start");
    m_sourceSort = specialCasesSort;
  }  

  CBrowseWindowSource::RequestItems(bUseCurPath);
  m_sourceSort = previousSort;
}
コード例 #17
0
ファイル: fileOps.cpp プロジェクト: Kr0nZ/xbmc
std::vector<CStdString> fileOps::missingSGFiles ( std::vector<CStdString> hayStack, std::vector<CStdString> needle )
{
  // Returns items in haystack that are not in needle
  
  std::vector<CStdString> missingFiles;
  
  for (unsigned int i = 0; i < hayStack.size();i++) 
  {
    CStdString remoteFile = hayStack[i].c_str();
    bool flMissing = true;
    for (unsigned int k = 0; k < needle.size();k++) 
    {
      CStdString localFile = needle[k].c_str();
      if (remoteFile.CompareNoCase(localFile.c_str()) == 0) 
      {
	flMissing = false;
	break;
      }
    }
    if (flMissing) 
    {
      missingFiles.push_back(remoteFile.c_str());
    }
  }
  return missingFiles;
}
コード例 #18
0
ファイル: IDirectory.cpp プロジェクト: blacksocket/xbmc
/*!
 \brief Test if file have an allowed extension, as specified with SetMask()
 \param strFile File to test
 \return \e true if file is allowed
 \note If extension is ".ifo", filename format must be "vide_ts.ifo" or
       "vts_##_0.ifo". If extension is ".dat", filename format must be
       "AVSEQ##(#).DAT", "ITEM###(#).DAT" or "MUSIC##(#).DAT".
 */
bool IDirectory::IsAllowed(const CStdString& strFile) const
{
    if (m_strFileMask.empty() || strFile.empty())
        return true;

    // Check if strFile have an allowed extension
    if (!URIUtils::HasExtension(strFile, m_strFileMask))
        return false;

    // We should ignore all non dvd/vcd related ifo and dat files.
    if (URIUtils::HasExtension(strFile, ".ifo"))
    {
        CStdString fileName = URIUtils::GetFileName(strFile);

        // Allow filenames of the form video_ts.ifo or vts_##_0.ifo
        return fileName.CompareNoCase("video_ts.ifo") == 0 ||
               (fileName.length() == 12 && fileName.Left(4).CompareNoCase("vts_") == 0 &&
                fileName.Right(6).CompareNoCase("_0.ifo") == 0);
    }

    if (URIUtils::HasExtension(strFile, ".dat"))
    {
        CStdString fileName = URIUtils::GetFileName(strFile);

        // Allow filenames of the form AVSEQ##(#).DAT, ITEM###(#).DAT
        // and MUSIC##(#).DAT
        return (fileName.length() == 11 || fileName.length() == 12) &&
               (fileName.Left(5).CompareNoCase("AVSEQ") == 0 || fileName.Left(5).CompareNoCase("MUSIC") == 0 ||
                fileName.Left(4).CompareNoCase("ITEM") == 0);
    }

    return true;
}
コード例 #19
0
ファイル: XBDateTime.cpp プロジェクト: Ayu222/android
void CDateTimeSpan::SetFromPeriod(const CStdString &period)
{
  long days = atoi(period.c_str());
  // find the first non-space and non-number
  int pos = period.find_first_not_of("0123456789 ", 0);
  if (pos >= 0)
  {
    CStdString units = period.Mid(pos, 3);
    if (units.CompareNoCase("wee") == 0)
      days *= 7;
    else if (units.CompareNoCase("mon") == 0)
      days *= 31;
  }

  SetDateTimeSpan(days, 0, 0, 0);
}
コード例 #20
0
void TestDiscoveryRegistryInfoRegistrar::TestBuildCommandLine_Exe()
{
	GenericMockInstallAgentProcessController pc;
	DiscoveryRegistryInfoRegistrar drir(pc);
	CStdString sRegeditPath = SystemFolderInfo::GetWindowsPath() + _T("\\regedit.exe");
	assertTest(sRegeditPath.CompareNoCase(drir.BuildCommandLine_Exe()) == 0);
}	
コード例 #21
0
ファイル: GUIColorManager.cpp プロジェクト: Ayu222/android
// load the color file in
void CGUIColorManager::Load(const CStdString &colorFile)
{
  Clear();

  // load the global color map if it exists
  TiXmlDocument xmlDoc;
  if (xmlDoc.LoadFile(CSpecialProtocol::TranslatePathConvertCase("special://xbmc/system/colors.xml")))
    LoadXML(xmlDoc);

  // first load the default color map if it exists
  CStdString path, basePath;
  URIUtils::AddFileToFolder(g_SkinInfo->Path(), "colors", basePath);
  URIUtils::AddFileToFolder(basePath, "defaults.xml", path);

  if (xmlDoc.LoadFile(CSpecialProtocol::TranslatePathConvertCase(path)))
    LoadXML(xmlDoc);

  // now the color map requested
  if (colorFile.CompareNoCase("SKINDEFAULT") == 0)
    return; // nothing to do

  URIUtils::AddFileToFolder(basePath, colorFile, path);
  CLog::Log(LOGINFO, "Loading colors from %s", path.c_str());

  if (xmlDoc.LoadFile(path))
    LoadXML(xmlDoc);
}
コード例 #22
0
ファイル: InterfaceBase.cpp プロジェクト: RIVeR-Lab/eposcmd
BOOL CInterfaceBase::AppendSelectionArray(CStdStringArray* pDestArray, CStdStringArray* pSourceArray)
{
    BOOL oFound;
    CStdString strDestName;
    CStdString strSourceName;

    if(pDestArray && pSourceArray)
    {
        for(std::size_t i = 0; i < pSourceArray->size(); i++)
        {
            oFound = FALSE;
            strSourceName = pSourceArray->at(i);
            for(std::size_t j = 0; j < pDestArray->size(); j++)
            {
                strDestName = pDestArray->at(j);

                if(strSourceName.CompareNoCase(strDestName) == 0)
                {
                    oFound = TRUE;
                    break;
                }
            }

            if(!oFound)
            {
                pDestArray->push_back(strSourceName);
            }
        }

        return TRUE;
    }

    return FALSE;
}
コード例 #23
0
ファイル: MainFrm.cpp プロジェクト: killbug2004/WSProf
void CMainFrame::OnRenderingSet(UINT nID)
{
	CStdString selectedRenderingSet = Ribbon::GetRenderingSetNameByID(nID);
	if (!selectedRenderingSet.IsEmpty() && selectedRenderingSet.CompareNoCase(CStdString::LoadResource(IDS_TXTEX_customRenderingSet6129,_T("Custom rendering set"))) != 0)
	{
		if (!RenderingSet::LoadRenderingSetIfRequired(selectedRenderingSet))
		{
			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);

			return;
		}
	}
	Workshare::OptionApi::SetString(L"CurrentRenderingSet", selectedRenderingSet.c_str()); 

	CChildFrame* const pFrame = DYNAMIC_DOWNCAST( CChildFrame, MDIGetActive() );
	if( pFrame )
	{
		CStdString str;
		str.Format(_T("DeltaView Event: Change rendering set to %s"),selectedRenderingSet.c_str());
		AnalyticsHelper::SendDeltaViewStatistics(str.c_str());
		pFrame->ReCompare(m_dvComparisonOption, true);
	}
}
コード例 #24
0
ファイル: BoxeeMediaSourceList.cpp プロジェクト: Kr0nZ/boxee
void CBoxeeMediaSourceList::deleteSourceByAppId(CStdString appId)
{
  bool deleted = false;
  
  BoxeeMediaSourceMap::iterator iterator;
  for (iterator = m_sources.begin(); iterator != m_sources.end(); iterator++)
  {
    CBoxeeMediaSource& source = (*iterator).second;
    if (!CUtil::IsApp(source.path))
    {
      continue;
    }
    
    CURI appUrl(source.path);
    CStdString sourceAppId = appUrl.GetHostName();
    
    if (sourceAppId.CompareNoCase(appId) == 0)
    {
      if (source.isVideo) g_settings.DeleteSource("video", source.name, source.path);
      if (source.isMusic) g_settings.DeleteSource("music", source.name, source.path);
      if (source.isPicture) g_settings.DeleteSource("pictures", source.name, source.path);
      deleted = true;
    }
  }

  if (deleted)
  {
    g_settings.SaveSources();
    load();      
  }
}
コード例 #25
0
CGUIControl::GUICONTROLTYPES CGUIControlFactory::TranslateControlType(const CStdString &type)
{
  for (unsigned int i = 0; i < sizeof(controls) / sizeof(controls[0]); ++i)
    if (0 == type.CompareNoCase(controls[i].name))
      return controls[i].type;
  return CGUIControl::GUICONTROL_UNKNOWN;
}
コード例 #26
0
void CTestLongNameOpen::TestExtractServerNameRootDir()
{
	if (!m_bTestShareExists)		
		throw SkipTestException(_T("The TestShare does not exist.  Please create a share called TestShare"));

	Gen::CFilePath wrd;
	TCHAR pszShortname[MAX_PATH] = {0};
	DWORD  dwSize = GetShortPathName(sLongUNC_Name, pszShortname, MAX_PATH);
	if(dwSize == 0)
	{
		assertTest(_T("Failed to extract short name") == false);
	}
	
	CStdString stServerPart;
	int iRet = wrd.ExtractServerNameRootDir(pszShortname, stServerPart);
	if(iRet > 0 )
	{
		TCHAR			szUNCName[MAX_PATH] = {0};
		unsigned long	ulUNCPathSize = MAX_PATH;
		GetComputerName(szUNCName, &ulUNCPathSize);
		CStdString sUNCShareName;
		sUNCShareName.Format(UNC_SERVER_PART.c_str(), szUNCName);
		assertTest(stServerPart.CompareNoCase(sUNCShareName) == 0);
	}
	else
	{
		assertTest(_T("Failed to detect UNC path") == false);
	}
}
コード例 #27
0
ファイル: IManTestUtils.cpp プロジェクト: killbug2004/WSProf
IManFolderPtr CIManTestUtils::GetWorkspace_Helper(IManDatabasePtr pDatabase, CStdString sWorkspaceName)
{
	IManDocumentPtr pDoc;
	IManFolderPtr	pWorkspaceFolder;
	IManFolderPtr	pDocumentFolder;

	try
	{
		IManWorkspacesPtr pWorkspaces = pDatabase->Workspaces;

		for( int i =1 ; i < pWorkspaces->Count +1; i++)
		{
			HRESULT hr = pWorkspaces->raw_ItemByIndex(_variant_t(i), &pWorkspaceFolder);

			if(pWorkspaceFolder != NULL && SUCCEEDED(hr))
			{
				CStdString sName = pWorkspaceFolder->Name;
				if(	 sName.CompareNoCase(sWorkspaceName) ==0 )
				{
					return pWorkspaceFolder;
				}
			}
		}
	}
	catch(_com_error& e)
	{
		throw e;
	}

	return NULL;
}
コード例 #28
0
void CMoviesWindowState::SetStore(const CStdString& strStoreId)
{
  m_strStoreId = strStoreId;

  if (strStoreId.CompareNoCase("all") != 0)
  {
    std::vector<BXSourcesItem> vecSources;

    BOXEE::Boxee::GetInstance().GetBoxeeClientServerComManager().GetMovieSources(vecSources);

    for (std::vector<BXSourcesItem>::iterator it = vecSources.begin() ; it != vecSources.end() ; ++it)
    {
      if (strStoreId == it->GetSourceId())
      {
        m_strStoreName = it->GetSourceName();
        break;
      }
    }

    m_pWindow->SetProperty(STORE_LABEL_FLAG, strStoreId);
    m_pWindow->SetProperty(STORE_FLAG, true);
    m_sourceController.SetFilter("provider", strStoreId);
  }
  else
  {
    m_pWindow->SetProperty(STORE_LABEL_FLAG, "");
    m_pWindow->SetProperty(STORE_FLAG, false);
    m_sourceController.ClearFilter("provider");
    m_strStoreName = "";
  }
}
コード例 #29
0
ファイル: IDPTestDefines.cpp プロジェクト: killbug2004/WSProf
bool TargetSystemIs(	CStdString sSystem)
{
	sSystem +=_T("://");

	CStdString sTargetSys = IMPORT_DOCUMENT_TARGET.Left(min(IMPORT_DOCUMENT_TARGET.size(), sSystem.size()));

	return (sSystem.CompareNoCase(sTargetSys) == 0);
}
コード例 #30
0
BOOL CInterfaceFactory::CreateInstance(CStdString p_Name, CInterfaceBase*& p_rpNewInstance)
{
	BOOL oResult = FALSE;

	if(p_Name.CompareNoCase(INTERFACE_RS232) == 0)
	{
		p_rpNewInstance = new CInterface_RS232();
		oResult = TRUE;
	}
	else if(p_Name.CompareNoCase(INTERFACE_USB) == 0)
	{
		p_rpNewInstance = new CInterface_USB();
		oResult = TRUE;
	}

	return oResult;
}