#include <OpenMS/FORMAT/FileHandler.h>
This class provides file type recognition from the file name and from the file content.
It also offer a common interface to load MSExperiment data and allows querying for supported file types.
Public Types | |
enum | Type { UNKNOWN, DTA, DTA2D, MZDATA, MZXML, FEATUREXML, FEATUREPAIRSXML, ANDIMS, IDXML, CONSENSUSXML, MGF, SIZE_OF_TYPE } |
The known file types. More... | |
Public Member Functions | |
Type | getTypeByFileName (const String &filename) |
Determines the file type from a file name. | |
Type | getTypeByContent (const String &filename) throw (Exception::FileNotFound) |
Determines the file type of a file by parsing the first few lines. | |
Type | nameToType (const String &name) |
Converts a file type name into a Type. | |
String | typeToName (Type type) |
Converts a Type into a file type name. | |
bool | isSupported (Type type) |
Returns if the file type is supported in this build of the library. | |
PeakFileOptions & | getOptions () |
Mutable access to the options for loading. | |
const PeakFileOptions & | getOptions () const |
Non-mutable access to the options for loading. | |
template<class PeakType> | |
bool | loadExperiment (const String &filename, MSExperiment< PeakType > &exp, Type force_type=UNKNOWN, ProgressLogger::LogType log=ProgressLogger::NONE) |
Loads a file into an MSExperiment. | |
Static Public Attributes | |
static const std::string | NamesOfTypes [SIZE_OF_TYPE] |
String representations of the file types. | |
Private Attributes | |
PeakFileOptions | options_ |
enum Type |
The known file types.
Type getTypeByContent | ( | const String & | filename | ) | throw (Exception::FileNotFound) |
Determines the file type of a file by parsing the first few lines.
bool isSupported | ( | Type | type | ) |
Returns if the file type is supported in this build of the library.
PeakFileOptions& getOptions | ( | ) |
Mutable access to the options for loading.
const PeakFileOptions& getOptions | ( | ) | const |
Non-mutable access to the options for loading.
bool loadExperiment | ( | const String & | filename, | |
MSExperiment< PeakType > & | exp, | |||
Type | force_type = UNKNOWN , |
|||
ProgressLogger::LogType | log = ProgressLogger::NONE | |||
) | [inline] |
Loads a file into an MSExperiment.
filename | the Filename of the file to load. | |
exp | The MSExperiment to load the data into. | |
force_type | Forces to load the file with that file type. If no type is forced, it is determined from the extention ( or from the content if that fails). | |
log | Progress logging mode |
const std::string NamesOfTypes[SIZE_OF_TYPE] [static] |
String representations of the file types.
PeakFileOptions options_ [private] |
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 | OpenMS / TOPP 1.1 |