OpenMS
AbsoluteQuantitationMethodFile Class Reference

File adapter for AbsoluteQuantitationMethod files. More...

#include <OpenMS/FORMAT/AbsoluteQuantitationMethodFile.h>

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

Public Member Functions

 AbsoluteQuantitationMethodFile ()=default
 Default constructor. More...
 
 ~AbsoluteQuantitationMethodFile () override=default
 Destructor. More...
 
void load (const String &filename, std::vector< AbsoluteQuantitationMethod > &aqm_list)
 Loads an AbsoluteQuantitationMethod file. More...
 
void store (const String &filename, const std::vector< AbsoluteQuantitationMethod > &aqm_list)
 Stores an AbsoluteQuantitationMethod file. More...
 

Protected Member Functions

void parseLine_ (const StringList &line, const std::map< String, Size > &headers, AbsoluteQuantitationMethod &aqm) const
 Parses a line into the members of AbsoluteQuantitationMethod. More...
 
void setCastValue_ (const String &key, const String &value, Param &params) const
 Helper method which takes care of converting the given value to the desired type, based on the header (here `key`) information. More...
 

Additional Inherited Members

- Private Member Functions inherited from CsvFile
 CsvFile ()
 Default constructor. More...
 
 ~CsvFile () override
 destructor More...
 
 CsvFile (const String &filename, char is=',', bool ie=false, Int first_n=-1)
 Constructor with filename. More...
 
void load (const String &filename, char is=',', bool ie=false, Int first_n=-1)
 Loads data from a text file. More...
 
void store (const String &filename)
 Stores the buffer's content into a file. More...
 
void addRow (const StringList &list)
 Add a row to the buffer. More...
 
void clear ()
 Clears the buffer. More...
 
bool getRow (Size row, StringList &list)
 writes all items from a row to list More...
 
std::vector< String >::size_type rowCount () const
 Returns the number of rows that were loaded from the file. More...
 

Detailed Description

File adapter for AbsoluteQuantitationMethod files.

Loads and stores .csv or .tsv files describing an AbsoluteQuantitationMethod.

Constructor & Destructor Documentation

◆ AbsoluteQuantitationMethodFile()

Default constructor.

◆ ~AbsoluteQuantitationMethodFile()

~AbsoluteQuantitationMethodFile ( )
overridedefault

Destructor.

Member Function Documentation

◆ load()

void load ( const String filename,
std::vector< AbsoluteQuantitationMethod > &  aqm_list 
)

Loads an AbsoluteQuantitationMethod file.

Exceptions
Exception::FileNotFoundis thrown if the file could not be opened
Exception::ParseErroris thrown if an error occurs during parsing
Parameters
[in]filenameThe input file name.
[out]aqm_listOutput variable where the AbsoluteQuantitationMethod data is loaded.

◆ parseLine_()

void parseLine_ ( const StringList line,
const std::map< String, Size > &  headers,
AbsoluteQuantitationMethod aqm 
) const
protected

Parses a line into the members of AbsoluteQuantitationMethod.

Parameters
[in]lineA line of the .csv file.
[in]headersA map of header strings to column positions.
[out]aqmAbsoluteQuantitationMethod.

◆ setCastValue_()

void setCastValue_ ( const String key,
const String value,
Param params 
) const
protected

Helper method which takes care of converting the given value to the desired type, based on the header (here `key`) information.

Parameters
[in]keyThe header name with which the correct conversion is chosen
[in]valueThe value to be converted
[in,out]paramsThe object where the new value is saved

◆ store()

void store ( const String filename,
const std::vector< AbsoluteQuantitationMethod > &  aqm_list 
)

Stores an AbsoluteQuantitationMethod file.

Exceptions
Exception::UnableToCreateFileis thrown if the file could not be created
Parameters
[in]filenameThe output file name.
[in]aqm_listThe AbsoluteQuantitationMethod data to write into the file.