OpenMS
Loading...
Searching...
No Matches
PTMXMLHandler.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- 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
17namespace OpenMS
18{
19 namespace Internal
20 {
24 class OPENMS_DLLAPI PTMXMLHandler :
25 public XMLHandler
26 {
27public:
29 PTMXMLHandler(std::map<std::string, std::pair<std::string, std::string> > & ptm_informations, const std::string & filename);
30
32 ~PTMXMLHandler() override;
33
35 void writeTo(std::ostream & os) override;
36
37 // Docu in base class
38 void onEndElement(const char16_t* qname) override;
39
40 // Docu in base class
41 void onStartElement(const char16_t* qname, const XMLAttributes& attributes) override;
42
43 // Docu in base class
44 void onCharacters(const char16_t* chars, Size /*length*/) override;
45
46protected:
47 std::map<std::string, std::pair<std::string, std::string> > & ptm_informations_;
48 std::string name_, tag_, composition_;
50 };
51
52 } // namespace Internal
53
54} // namespace OpenMS
55
Handler that is used for parsing PTMXML data.
Definition PTMXMLHandler.h:26
void onCharacters(const char16_t *chars, Size) override
Parsing method for character data.
bool open_tag_
Definition PTMXMLHandler.h:49
void writeTo(std::ostream &os) override
Writes the xml file to the ostream 'os'.
std::string composition_
Definition PTMXMLHandler.h:48
std::map< std::string, std::pair< std::string, std::string > > & ptm_informations_
Definition PTMXMLHandler.h:47
void onStartElement(const char16_t *qname, const XMLAttributes &attributes) override
Parsing method for opening tags.
void onEndElement(const char16_t *qname) override
Parsing method for closing tags.
~PTMXMLHandler() override
Destructor.
PTMXMLHandler(std::map< std::string, std::pair< std::string, std::string > > &ptm_informations, const std::string &filename)
Constructor for loading.
Xerces-free, lightweight view over the attribute list of an XML element.
Definition XMLAttributes.h:32
Base class for XML handlers.
Definition XMLHandler.h:42
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19