Changeset 1524 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 09/16/02 10:10:17 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/DataLinkDef.h
r1488 r1524 7 7 #pragma link C++ class MData+; 8 8 #pragma link C++ class MDataArray+; 9 #pragma link C++ class MDataElement+; 9 10 #pragma link C++ class MDataList+; 10 11 #pragma link C++ class MDataValue+; -
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 { -
trunk/MagicSoft/Mars/mdata/MDataChain.h
r1481 r1524 46 46 47 47 Int_t IsAlNum(TString txt); 48 Int_t GetBracket(TString txt );48 Int_t GetBracket(TString txt, char open, char close); 49 49 50 50 MData *ParseString(TString txt, Int_t level); -
trunk/MagicSoft/Mars/mdata/Makefile
r1488 r1524 20 20 # @endcode 21 21 22 INCLUDES = -I. -I../mbase 22 INCLUDES = -I. -I../mbase -I../mhist 23 23 24 24 # @code … … 33 33 SRCFILES = MData.cc \ 34 34 MDataArray.cc \ 35 MDataElement.cc \ 35 36 MDataMember.cc \ 36 37 MDataValue.cc \
Note:
See TracChangeset
for help on using the changeset viewer.