OpenMS
CVMappingFile.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: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/FORMAT/XMLFile.h>
15 
16 #include <vector>
17 
18 namespace OpenMS
19 {
20  class String;
21 
32  class OPENMS_DLLAPI CVMappingFile :
33  protected Internal::XMLHandler,
34  public Internal::XMLFile
35  {
36 public:
37 
40 
42  ~CVMappingFile() override;
43 
53  void load(const String& filename, CVMappings& cv_mappings, bool strip_namespaces = false);
54 
55 protected:
56 
57  // Docu in base class
58  void startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes) override;
59 
60  // Docu in base class
61  void endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname) override;
62 
63  // Docu in base class
64  void characters(const XMLCh* const chars, const XMLSize_t /*length*/) override;
65 
66 private:
67 
70 
73 
75 
77 
79 
80  std::vector<CVMappingRule> rules_;
81 
82  std::vector<CVReference> cv_references_;
83 
84  };
85 
86 } // namespace OpenMS
87 
Used to load CvMapping files.
Definition: CVMappingFile.h:35
CVMappingFile & operator=(const CVMappingFile &rhs)
Not implemented.
String tag_
Definition: CVMappingFile.h:74
~CVMappingFile() override
Destructor.
CVMappingFile(const CVMappingFile &rhs)
Not implemented.
CVMappingFile()
Default constructor.
std::vector< CVReference > cv_references_
Definition: CVMappingFile.h:82
void startElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname, const xercesc::Attributes &attributes) override
std::vector< CVMappingRule > rules_
Definition: CVMappingFile.h:80
bool strip_namespaces_
Definition: CVMappingFile.h:76
void characters(const XMLCh *const chars, const XMLSize_t) override
CVMappingRule actual_rule_
Definition: CVMappingFile.h:78
void endElement(const XMLCh *const, const XMLCh *const, const XMLCh *const qname) override
void load(const String &filename, CVMappings &cv_mappings, bool strip_namespaces=false)
loads CvMappings from the given file
Representation of a CV Mapping rule used by CVMappings.
Definition: CVMappingRule.h:28
Representation of controlled vocabulary mapping rules (for PSI formats)
Definition: CVMappings.h:31
Base class for loading/storing XML files that have a handler derived from XMLHandler.
Definition: XMLFile.h:23
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