OpenMS  2.7.0
Public Member Functions | List of all members
PTMXMLFile Class Reference

Used to load and store PTMXML files. More...

#include <OpenMS/FORMAT/PTMXMLFile.h>

Inheritance diagram for PTMXMLFile:
[legend]
Collaboration diagram for PTMXMLFile:
[legend]

Public Member Functions

 PTMXMLFile ()
 Constructor. More...
 
void load (const String &filename, std::map< String, std::pair< String, String > > &ptm_informations)
 Loads the information of a PTMXML file. More...
 
void store (String filename, std::map< String, std::pair< String, String > > &ptm_informations) const
 Stores the data in an PTMXML file. More...
 
- Public Member Functions inherited from XMLFile
 XMLFile ()
 Default constructor. More...
 
 XMLFile (const String &schema_location, const String &version)
 Constructor that sets the schema location. More...
 
virtual ~XMLFile ()
 Destructor. More...
 
bool isValid (const String &filename, std::ostream &os)
 Checks if a file validates against the XML schema. More...
 
const StringgetVersion () const
 return the version of the schema More...
 

Additional Inherited Members

- Protected Member Functions inherited from XMLFile
void parse_ (const String &filename, XMLHandler *handler)
 Parses the XML file given by filename using the handler given by handler. More...
 
void parseBuffer_ (const std::string &buffer, XMLHandler *handler)
 Parses the in-memory buffer given by buffer using the handler given by handler. More...
 
void save_ (const String &filename, XMLHandler *handler) const
 Stores the contents of the XML handler given by handler in the file given by filename. More...
 
void enforceEncoding_ (const String &encoding)
 
- Protected Attributes inherited from XMLFile
String schema_location_
 XML schema file location. More...
 
String schema_version_
 Version string. More...
 
String enforced_encoding_
 Encoding string that replaces the encoding (system dependent or specified in the XML). Disabled if empty. Used as a workaround for XTandem output xml. More...
 

Detailed Description

Used to load and store PTMXML files.

This class is used to load and store documents that implement the schema of PTMXML files.

Constructor & Destructor Documentation

◆ PTMXMLFile()

Constructor.

Member Function Documentation

◆ load()

void load ( const String filename,
std::map< String, std::pair< String, String > > &  ptm_informations 
)

Loads the information of a PTMXML file.

Parameters
filenameThe name of the file
ptm_informationsthe PTM information from the file are stored herein
Exceptions
FileNotFoundis thrown if the given file could not be found
ParseErroris thrown if the given file could not be parsed The information is read in and stored in the corresponding variables

◆ store()

void store ( String  filename,
std::map< String, std::pair< String, String > > &  ptm_informations 
) const

Stores the data in an PTMXML file.

Exceptions
UnableToCreateFileis thrown if the given filename could not be created

The data is read in and stored in the file 'filename'.