1 #ifndef ALI_MUON_ST1_INI_READER_H
2 #define ALI_MUON_ST1_INI_READER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
8 // Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
10 // Class AliMUONIniReader
11 // ----------------------
12 // General class to read data in ASCII file format,
13 // similar to the Windows ".ini" files (a set of sections tagged by a
15 // and values defined in the way:
16 // parameterName = value
18 // comment lines can be introduced if the first non-blank character
19 // is either ';' or '#'
28 #include "AliMUONSt1Types.h"
30 class AliMUONSt1IniReader
33 enum TType {kUndef,kChapter,kValue};
35 typedef pair<string,string> TValuePair;
36 typedef vector<TValuePair> TValueList;
37 typedef pair<string,TValueList> TChapter;
38 typedef multimap <string,TValueList> TChapterList;
41 AliMUONSt1IniReader();
42 AliMUONSt1IniReader(string fileName);
43 virtual ~AliMUONSt1IniReader();
46 TType GetCurrentType() const {return fCurrentType; }
47 string GetCurrentName() const {return fCurrentName; }
48 string GetCurrentValue() const {return fCurrentValue;}
49 TChapter MakeCurrentChapter();
50 TValueList MakeCurrentValueList();
51 TChapterList MakeChapterList();
52 bool Eof() {return fEndOfFile;}
56 string trail(const string& s) const;
58 ifstream fFile; // the file to be read
59 TType fCurrentType; // current type of line (either kChapter or kValue)
60 string fCurrentName; // name of chapter / name of parameter pair
61 string fCurrentValue;// value of the parameter pair if the type is kValue
62 bool fEndOfFile; // true if the file is entirely read
65 #endif //ALI_MUON_ST1_INI_READER_H