]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt1Decoder.h
Mods for MacOSX
[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 // Revision of includes 07/05/2004
8
9 // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
10 //
11 // Class AliMUONSt1Decoder
12 // -----------------------
13 // A generic set of functions (defined in the <decoder> namespace).
14 // Used to decode formatted strings, eg. a list of integer ranges,
15 // or a list of sub-strings separated by delimiters such as '(','{','[', ... .
16 // Example: 
17 //   (string 1) (string 2) [string3] {string4} [ (string5.1) (string5.2) ] 
18 //   note :                                      |_____________________|
19 //                                                         |
20 //                                             this is just ONE substring.
21
22 #include <string>
23 #include <utility>
24 #include <vector>
25
26 #ifndef __HP_aCC
27   using std::string;
28   using std::pair;
29   using std::vector;
30 #endif  
31
32 #include <Rtypes.h>
33
34 typedef vector<string>  StringVector; 
35 typedef vector<Int_t>   IntVector; 
36 typedef pair<Int_t, Int_t> IntPair;
37 typedef vector<IntPair>    IntPairVector;
38 typedef pair<Double_t, Double_t>  DoublePair;
39 typedef vector<DoublePair>        DoublePairVector;
40
41 namespace decoder
42 {
43   StringVector     SplitNtuples(const string& s,
44                                 const string& leftSep ="({[\"'/",
45                                 const string& rightSep=")}]\"'/");
46   StringVector     SplitList(const string& s, const string& sep=";,");
47
48   IntVector        DecodeListRanges(const string& s, const string& sep=";,",
49                                     const string& rangeSep="/");
50   IntPairVector    DecodeListOfIntRanges(const string& s, const string& sep=";,",
51                                     const string& rangeSep="/");
52   DoublePairVector DecodeListOfFloatRanges(const string& s, const string& sep=";,",
53                                     const string& rangeSep="/");
54 }
55
56 #endif //ALI_MUON_ST1_DECODER_H