OpenMS
ParamCTDFile Class Reference

Serializes a Param class in paramCTD file format. Note: only storing is currently possible. More...

#include <OpenMS/FORMAT/ParamCTDFile.h>

Collaboration diagram for ParamCTDFile:
[legend]

Public Member Functions

 ParamCTDFile ()=default
 
 ~ParamCTDFile ()=default
 Constructor. More...
 
void store (const std::string &filename, const Param &param, const ToolInfo &tool_info) const
 Destructor. More...
 
void writeCTDToStream (std::ostream *os_ptr, const Param &param, const ToolInfo &tool_info) const
 Write CTD to output stream. More...
 

Static Private Member Functions

static std::string escapeXML (const std::string &to_escape)
 Escapes certain characters in a string that are not allowed in XML Escaped characters are: & < > " '. More...
 
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. More...
 

Private Attributes

const std::string schema_location_ = "/SCHEMAS/Param_1_8_0.xsd"
 
const std::string schema_version_ = "1.8.0"
 

Detailed Description

Serializes a Param class in paramCTD file format. Note: only storing is currently possible.

Constructor & Destructor Documentation

◆ ParamCTDFile()

ParamCTDFile ( )
default

◆ ~ParamCTDFile()

~ParamCTDFile ( )
default

Constructor.

Member Function Documentation

◆ escapeXML()

static std::string escapeXML ( const std::string &  to_escape)
staticprivate

Escapes certain characters in a string that are not allowed in XML Escaped characters are: & < > " '.

Parameters
to_escapeThe string in which the characters should be escaped
Returns
The escaped string

◆ replace()

static void replace ( std::string &  replace_in,
char  to_replace,
const std::string &  replace_with 
)
staticprivate

Replace all occurrences of a character in a string with a string.

Parameters
replace_inThe string in which the characters should be replaced.
to_replaceThe character that should be replaced.
replace_withThe string the character should be replaced with.

◆ store()

void store ( const std::string &  filename,
const Param param,
const ToolInfo tool_info 
) const

Destructor.

Write CTD file

Parameters
filenameThe name of the file the param data structure should be stored in.
paramThe param data structure that should be stored.
tool_infoAdditional information about the Tool for which the param data should be stored.
Exceptions
std::ios::failureis thrown if the file could not be created

◆ writeCTDToStream()

void writeCTDToStream ( std::ostream *  os_ptr,
const Param param,
const ToolInfo tool_info 
) const

Write CTD to output stream.

Parameters
os_ptrThe stream to which the param data should be written.
paramThe param data structure that should be writte to stream.
tool_infoAdditional information about the Tool for which the param data should be written.

Member Data Documentation

◆ schema_location_

const std::string schema_location_ = "/SCHEMAS/Param_1_8_0.xsd"
private

◆ schema_version_

const std::string schema_version_ = "1.8.0"
private