]>
Commit | Line | Data |
---|---|---|
ba030c0e | 1 | #ifndef ALI_MUON_ST1_DECODER_H |
2 | #define ALI_MUON_ST1_DECODER_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay | |
9 | // | |
10 | // Class AliMUONSt1Decoder | |
11 | // ----------------------- | |
12 | // A generic set of functions (defined in the <decoder> namespace). | |
13 | // Used to decode formatted strings, eg. a list of integer ranges, | |
14 | // or a list of sub-strings separated by delimiters such as '(','{','[', ... . | |
15 | // Example: | |
16 | // (string 1) (string 2) [string3] {string4} [ (string5.1) (string5.2) ] | |
17 | // note : |_____________________| | |
18 | // | | |
19 | // this is just ONE substring. | |
20 | ||
21 | ||
22 | #include <vector> | |
23 | #include <utility> | |
24 | #include <string> | |
5f91c9e8 | 25 | |
26 | #include "AliMUONSt1Types.h" | |
ba030c0e | 27 | |
28 | namespace decoder | |
29 | { | |
ba030c0e | 30 | vector<string> SplitNtuples(const string& s, |
31 | const string& leftSep ="({[\"'/", | |
32 | const string& rightSep=")}]\"'/"); | |
33 | vector<string> SplitList(const string& s,const string& sep=";,"); | |
34 | vector<int> DecodeListRanges(const string& s,const string& sep=";,",const string& rangeSep="/"); | |
35 | vector< pair<int,int> > DecodeListOfIntRanges(const string& s,const string& sep=";,",const string& rangeSep="/"); | |
36 | vector< pair<double,double> > DecodeListOfFloatRanges(const string& s,const string& sep=";,",const string& rangeSep="/"); | |
37 | } | |
38 | ||
39 | #endif //ALI_MUON_ST1_DECODER_H |