]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt1Decoder.h
ec99e00118740fdd0cf4b1b41da4b848c1c6bc99
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1Decoder.h
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>
25
26 #include "AliMUONSt1Types.h"
27
28 namespace decoder
29 {
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