OpenMS
ParamXMLHandler.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: Marc Sturm, Stephan Aiche $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 
14 #include <vector>
15 #include <map>
16 
17 namespace OpenMS
18 {
19  namespace Internal
20  {
25  class OPENMS_DLLAPI ParamXMLHandler :
26  public XMLHandler
27  {
28 public:
30  ParamXMLHandler(Param& param, const String& filename, const String& version);
32  ~ParamXMLHandler() override;
33 
34  // Docu in base class
35  void endElement(const XMLCh* const uri, const XMLCh* const local_name, const XMLCh* const qname) override;
36 
37  // Docu in base class
38  void startElement(const XMLCh* const uri, const XMLCh* const local_name, const XMLCh* const qname, const xercesc::Attributes& attributes) override;
39 
40 protected:
46  std::map<String, String> descriptions_;
47 
49  struct
50  {
51  String name;
52  String type;
53  std::vector<std::string> stringlist;
54  IntList intlist;
55  DoubleList doublelist;
56  std::vector<std::string> tags;
57  String description;
58  String restrictions;
59  Int restrictions_index;
60  } list_;
61 
62 private:
65  };
66 
67  } // namespace Internal
68 } // namespace OpenMS
69 
XML Handler for Param files.
Definition: ParamXMLHandler.h:27
void endElement(const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname) override
ParamXMLHandler(Param &param, const String &filename, const String &version)
Default constructor.
~ParamXMLHandler() override
Destructor.
Param & param_
Reference to the Param object to fill.
Definition: ParamXMLHandler.h:44
String path_
The current absolute path (concatenation of nodes_ with : in between)
Definition: ParamXMLHandler.h:42
std::map< String, String > descriptions_
Map of node descriptions (they are set at the end of parsing)
Definition: ParamXMLHandler.h:46
void startElement(const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname, const xercesc::Attributes &attributes) override
Base class for XML handlers.
Definition: XMLHandler.h:300
Management and storage of parameters / INI files.
Definition: Param.h:44
A more convenient string class.
Definition: String.h:34
int Int
Signed integer type.
Definition: Types.h:76
std::vector< Int > IntList
Vector of signed integers.
Definition: ListUtils.h:29
std::vector< double > DoubleList
Vector of double precision real types.
Definition: ListUtils.h:36
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22