Beispiel #1
0
ILocalization * ApproachLocalizationManager::CreateLocalization(const TCHAR * theLocaleID, int theSize_LocaleID)
{
	IdType aId(theLocaleID, theLocaleID+theSize_LocaleID);

	LocalizationIter aIter = myLocalizations.find( aId );

	if ( aIter == myLocalizations.end() )
	{
		if ( aId != _T("en_US") )
			return new LocalizationImpl_Xml();
		else
			return new LocalizationImpl_EnUs_Hardcoded();
	}
	else
		return aIter->second.Localization;
}
Beispiel #2
0
HRESULT ApproachLocalizationManager::SetCurrentLocale(const TCHAR * theLocale, int theSize)
{
	IdType aId(theLocale, theLocale+theSize);

	LocalizationIter aIter = myLocalizations.find(aId);

	HRESULT aRes = S_OK;

	if ( aIter == myLocalizations.end() )
	{
		bool aPartial = false;

		ILocalization * aLoc = CreateLocalization(theLocale, theSize);

		if (aLoc == 0)
			return E_FAIL;

		aRes = aLoc->Initialize(theLocale, theSize, aPartial);

		if ( FAILED(aRes) )
			return aRes;

		aIter = myLocalizations.insert
		(
			aIter,
			LocalizationDataPair(aId, LocalizationData(aLoc, aPartial) )
		);
	}
	else
	{
		bool aPartial = false;

		aRes = aIter->second.Localization->Initialize(theLocale, theSize, aPartial);

		ATLASSERT( SUCCEEDED(aRes) && !aPartial );

		aIter->second.Partial = aPartial;
	}

	myCurLocalization = aId;

	Application::Instance().RaiseLocalizationChanged(aIter->second.Localization, myCurLocalization.c_str(), (int) myCurLocalization.size() );

	return aRes;
}
Beispiel #3
0
void testEcalDetId::testPnDiodeDetId() {

  for (int iEcalSubDet=EcalBarrel ; iEcalSubDet<=EcalEndcap ; iEcalSubDet++)
    for (int iDCC=1;iDCC<=36;iDCC++)
      for (int iPn=1;iPn<=10;iPn++)
	{
	  try
	    {
	      //EcalTrigTowerDetId Zside 1 
	      {
		EcalPnDiodeDetId aId(iEcalSubDet,iDCC,iPn);
		CPPUNIT_ASSERT(aId.iEcalSubDetectorId()==iEcalSubDet);
		CPPUNIT_ASSERT(aId.iDCCId()==iDCC);
		CPPUNIT_ASSERT(aId.iPnId()==iPn);
	      }
	    }
	  catch ( cms::Exception &e ) 
	    { 
	    }
	}
}
Beispiel #4
0
HRESULT ApproachLocalizationManager::OnLocalizationFoundNew(
		ILocalization * theLoc, const TCHAR * theLocale, int theSize_Locale,
		IEnumLocalizationsProcessor * theOut)
{
	bool aPartial = true;
	HRESULT aRes = theLoc->Initialize(theLocale, theSize_Locale, aPartial);

	if ( FAILED(aRes) )
		delete theLoc;
	else
	{
		IdType aId(theLocale, theLocale+theSize_Locale);

		LocalizationData & aData = myLocalizations[aId];
		aData.Localization = theLoc;
		aData.Partial      = aPartial;

		if (theOut)
			theOut->OnLocalizationFound(theLoc);
	}

	return aRes;
}