OpenMS
PTMXMLHandler.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, 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: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
13 #include <vector>
14 #include <map>
15 #include <fstream>
16 
17 namespace OpenMS
18 {
19  namespace Internal
20  {
24  class OPENMS_DLLAPI PTMXMLHandler :
25  public XMLHandler
26  {
27 public:
29  PTMXMLHandler(std::map<String, std::pair<String, String> > & ptm_informations, const String & filename);
30 
32  ~PTMXMLHandler() override;
33 
35  void writeTo(std::ostream & os) override;
36 
37  // Docu in base class
38  void endElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname) override;
39 
40  // Docu in base class
41  void startElement(const XMLCh * const /*uri*/, const XMLCh * const /*local_name*/, const XMLCh * const qname, const xercesc::Attributes & attributes) override;
42 
43  // Docu in base class
44  void characters(const XMLCh * const chars, const XMLSize_t /*length*/) override;
45 
46 protected:
47  std::map<String, std::pair<String, String> > & ptm_informations_;
48  String name_, tag_, composition_;
49  bool open_tag_;
50  };
51 
52  } // namespace Internal
53 
54 } // namespace OpenMS
55 
Handler that is used for parsing PTMXML data.
Definition: PTMXMLHandler.h:26
bool open_tag_
Definition: PTMXMLHandler.h:49
void writeTo(std::ostream &os) override
Writes the xml file to the ostream 'os'.
String composition_
Definition: PTMXMLHandler.h:48
PTMXMLHandler(std::map< String, std::pair< String, String > > &ptm_informations, const String &filename)
Constructor for loading.
void startElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname, const xercesc::Attributes &attributes) override
void characters(const XMLCh *const chars, const XMLSize_t) override
void endElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname) override
~PTMXMLHandler() override
Destructor.
std::map< String, std::pair< String, String > > & ptm_informations_
Definition: PTMXMLHandler.h:47
Base class for XML handlers.
Definition: XMLHandler.h:302
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19