Changeset 1524 for trunk/MagicSoft/Mars/mdata/MDataChain.cc
- Timestamp:
- 09/16/02 10:10:17 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MDataChain.cc
r1493 r1524 91 91 #include "MDataValue.h" 92 92 #include "MDataMember.h" 93 # 93 #include "MDataElement.h" 94 94 95 ClassImp(MDataChain); 95 96 … … 164 165 for (int i=0; i<l; i++) 165 166 { 166 if (!isalnum(txt[i]) && txt[i]!='.' && 167 if (!isalnum(txt[i]) && txt[i]!='.' && /*txt[i]!='['&&txt[i]!=']'&&*/ 167 168 ((txt[i]!='-' && txt[i]!='+') || i!=0)) 168 169 return i; … … 172 173 } 173 174 174 Int_t MDataChain::GetBracket(TString txt )175 Int_t MDataChain::GetBracket(TString txt, char open, char close) 175 176 { 176 177 Int_t first=1; 177 178 for (int cnt=0; first<txt.Length(); first++) 178 179 { 179 if (txt[first]== '(')180 if (txt[first]==open) 180 181 cnt++; 181 if (txt[first]== ')')182 if (txt[first]==close) 182 183 cnt--; 183 184 if (cnt==-1) … … 197 198 198 199 if (txt=="abs") return kEAbs; 200 if (txt=="fabs") return kEAbs; 199 201 if (txt=="log") return kELog; 200 202 if (txt=="log10") return kELog10; … … 238 240 // Search for the corresponding bracket 239 241 // 240 Int_t first=GetBracket(txt );242 Int_t first=GetBracket(txt, '(', ')'); 241 243 242 244 if (first==txt.Length()) … … 364 366 txt = txt.Strip(TString::kBoth); 365 367 368 if (!txt.IsNull() && txt[0]=='[') 369 { 370 Int_t first = GetBracket(txt, '[', ']'); 371 TString op = txt(1, first-1); 372 txt.Remove(0, first+1); 373 374 newmember = new MDataElement(text, atoi(op)); 375 break; 376 } 366 377 if ((txt.IsNull() || txt[0]!='(') && text[0]!='-' && text[0]!='+') 367 378 { … … 379 390 } 380 391 381 Int_t first = GetBracket(txt );392 Int_t first = GetBracket(txt, '(', ')'); 382 393 TString sub = op==kENegative || op==kEPositive ? text.Remove(0,1) + txt : txt(1, first-1); 383 394 txt.Remove(0, first+1); 384 395 385 396 newmember = new MDataChain(sub, op); 386 387 397 if (!newmember->IsValid()) 388 398 {
Note:
See TracChangeset
for help on using the changeset viewer.