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


C++ KVString::ReplaceAll方法代码示例

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


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

示例1: SetProperties

//________________________________________________________________
Bool_t KVFAZIADetector::SetProperties()
{
	// detector name are assumed to be defined as
   // SI2-T2-Q2-B001
	//	CSI-T2-Q2-B001
	// SI1-T1-Q1-B001
	//
   
   KVString tmp;
   KVString sname(GetName());
   sname.Begin("-");
   SetLabel(sname.Next());
	gFazia->AddDetectorLabel(GetLabel());
   
	tmp = sname.Next(); tmp.ReplaceAll("T",""); fTelescope = tmp.Atoi();
	tmp = sname.Next(); tmp.ReplaceAll("Q",""); fQuartet = tmp.Atoi();
	tmp = sname.Next(); tmp.ReplaceAll("B",""); fBlock = tmp.Atoi();
	KVSignal* sig=0;
   //"QH1", "I1", "QL1", "Q2", "I2", "Q3
	if (fSignals)
   	delete fSignals;
   fSignals = new KVList(kTRUE);
	KVString lsignals="";
   if ( !strcmp(GetLabel(),"SI1") ) {	lsignals="QH1,I1,QL1";	}
   else if ( !strcmp(GetLabel(),"SI2" ) ) {	lsignals="Q2,I2";	}
	else if ( !strcmp(GetLabel(),"CSI" ) ) {	lsignals="Q3";	}
   else{
   	Warning("SetProperties","Unknown label \"%s\" for this detector : %s\n",GetLabel(),GetName());
		lsignals="";
	}
   
	lsignals.Begin(",");
	while ( !lsignals.End() )
	{
		KVString ssig = lsignals.Next();
		if (ssig.BeginsWith("Q")){
			sig = new KVChargeSignal(ssig.Data());
		}
		else if (ssig.BeginsWith("I")){
			sig = new KVCurrentSignal(ssig.Data());
		}
		else{
			Warning("unknown format signal detectorlabel=%s, signal=%s\n",GetLabel(),ssig.Data());
			sig = new KVSignal(ssig.Data(),"unknown");
		}
		
		sig->LoadPSAParameters(GetLabel());
		sig->SetDetectorName(GetName());
		fSignals->Add(sig);
	}
	
	return kTRUE;
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:54,代码来源:KVFAZIADetector.cpp

示例2: ExpandAutoBatchName

const Char_t* KVINDRAReconDataAnalyser::ExpandAutoBatchName(const Char_t* format)
{
   //Replace any 'special' symbols in "format" with their current values
   //
   //  $Date   : current date and time
   //  $System  :  name of system to be analysed
   //  $User  :  name of user
   //  $UserClass or $Selector :  name of user's analysis class (KVSelector)
   //  $DataSelector  :  name of user's data selector (KVDataSelector)
   
   static KVString tmp;
   tmp = KVDataAnalyser::ExpandAutoBatchName(format);
   tmp.ReplaceAll("$Selector", GetUserClass());
   tmp.ReplaceAll("$DataSelector", GetKVDataSelector());
   return tmp.Data();
}
开发者ID:pwigg,项目名称:kaliveda,代码行数:16,代码来源:KVINDRAReconDataAnalyser.cpp

示例3: ReadHeader

Bool_t KVSimReader_SMF_asym::ReadHeader(){

	KVString snom;
	Int_t res = ReadLineAndCheck(1," ");
	switch (res){
	case 0:
		return kFALSE; 
	case 1:
		snom.Form("%s",GetReadPar(0).Data());
		snom.ReplaceAll("evt_","");
		//Info("ReadHeader","lecture %d",snom.Atoi());
		nv->SetValue("event_number",snom.Atoi());
		
		break;
	default:
		return kFALSE;	
	}
	
	res = ReadLineAndCheck(1," ");
	switch (res){
	case 0:
		return kFALSE; 
	case 1:
		nv->SetValue("ndes",GetIntReadPar(0));
		ndes = 0;
		
		return kTRUE;
	default:
		return kFALSE;	
	}


}
开发者ID:pwigg,项目名称:kaliveda,代码行数:33,代码来源:KVSimReader_SMF_asym.cpp


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