OpenMS
ParamCTDFile.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: Ruben Grünberg $
6 // $Authors: Ruben Grünberg $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <string>
13 
14 namespace OpenMS
15 {
16 
20  struct ToolInfo
21  {
22  std::string version_;
23  std::string name_;
24  std::string docurl_;
25  std::string category_;
26  std::string description_;
27  std::vector<std::string> citations_;
28  };
29 
35  class OPENMS_DLLAPI ParamCTDFile
36  {
37  public:
38  ParamCTDFile() = default;
39 
40  ~ParamCTDFile() = default;
41 
51  void store(const std::string& filename, const Param& param, const ToolInfo& tool_info) const;
52 
60  void writeCTDToStream(std::ostream* os_ptr, const Param& param, const ToolInfo& tool_info) const;
61 
62  private:
71  static std::string escapeXML(const std::string& to_escape);
72 
80  static void replace(std::string& replace_in, char to_replace, const std::string& replace_with);
81 
82  const std::string schema_location_ = "/SCHEMAS/Param_1_8_0.xsd";
83  const std::string schema_version_ = "1.8.0";
84  };
85 }
Serializes a Param class in paramCTD file format. Note: only storing is currently possible.
Definition: ParamCTDFile.h:36
static void replace(std::string &replace_in, char to_replace, const std::string &replace_with)
Replace all occurrences of a character in a string with a string.
~ParamCTDFile()=default
Constructor.
void store(const std::string &filename, const Param &param, const ToolInfo &tool_info) const
Destructor.
static std::string escapeXML(const std::string &to_escape)
Escapes certain characters in a string that are not allowed in XML Escaped characters are: & < > " '.
void writeCTDToStream(std::ostream *os_ptr, const Param &param, const ToolInfo &tool_info) const
Write CTD to output stream.
Management and storage of parameters / INI files.
Definition: Param.h:44
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
std::vector< std::string > citations_
Definition: ParamCTDFile.h:27
std::string name_
Definition: ParamCTDFile.h:23
std::string version_
Definition: ParamCTDFile.h:22
std::string category_
Definition: ParamCTDFile.h:25
std::string docurl_
Definition: ParamCTDFile.h:24
std::string description_
Definition: ParamCTDFile.h:26
A struct to pass information about the tool as one parameter.
Definition: ParamCTDFile.h:21