#ifndef ALI_MUON_ST1_DECODER_H #define ALI_MUON_ST1_DECODER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ // Revision of includes 07/05/2004 /// \ingroup sim /// \class AliMUONSt1Decoder /// \brief Set of functions to decode formatted strings /// /// A generic set of functions (defined in the namespace). /// Used to decode formatted strings, eg. a list of integer ranges, /// or a list of sub-strings separated by delimiters such as '(','{','[', ... . /// Example: \n /// (string 1) (string 2) [string3] {string4} [ (string5.1) (string5.2) ] \n /// note : |_____________________| \n /// | \n /// this is just ONE substring. \n /// /// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay #include #include #include #include #ifndef __HP_aCC using std::string; using std::pair; using std::vector; #endif typedef vector StringVector; typedef vector IntVector; typedef pair IntPair; typedef vector IntPairVector; typedef pair DoublePair; typedef vector DoublePairVector; namespace decoder { StringVector SplitNtuples(const string& s, const string& leftSep ="({[\"'/", const string& rightSep=")}]\"'/"); StringVector SplitList(const string& s, const string& sep=";,"); IntVector DecodeListRanges(const string& s, const string& sep=";,", const string& rangeSep="/"); IntPairVector DecodeListOfIntRanges(const string& s, const string& sep=";,", const string& rangeSep="/"); DoublePairVector DecodeListOfFloatRanges(const string& s, const string& sep=";,", const string& rangeSep="/"); } #endif //ALI_MUON_ST1_DECODER_H