00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef OPENMS_FORMAT_MZXMLFILE_H
00028 #define OPENMS_FORMAT_MZXMLFILE_H
00029
00030 #include <OpenMS/FORMAT/XMLFile.h>
00031 #include <OpenMS/CONCEPT/ProgressLogger.h>
00032 #include <OpenMS/FORMAT/PeakFileOptions.h>
00033 #include <OpenMS/FORMAT/HANDLERS/MzXMLHandler.h>
00034
00035 namespace OpenMS
00036 {
00037 class String;
00038
00044 class MzXMLFile
00045 : public Internal::XMLFile,
00046 public ProgressLogger
00047 {
00048 public:
00050 MzXMLFile();
00052 ~MzXMLFile();
00053
00055 PeakFileOptions& getOptions();
00056
00058 const PeakFileOptions& getOptions() const;
00059
00065 template <typename MapType>
00066 void load(const String& filename, MapType& map) throw (Exception::FileNotFound, Exception::ParseError)
00067 {
00068 map.reset();
00069
00070 Internal::MzXMLHandler<MapType> handler(map,filename,schema_version_,*this);
00071 handler.setOptions(options_);
00072 parse_(filename, &handler);
00073 }
00074
00080 template <typename MapType>
00081 void store(const String& filename, const MapType& map)
00082 const throw (Exception::UnableToCreateFile)
00083 {
00084 Internal::MzXMLHandler<MapType> handler(map,filename,schema_version_,*this);
00085 save_(filename, &handler);
00086 }
00087
00088 private:
00089 PeakFileOptions options_;
00090 };
00091 }
00092
00093 #endif // OPENMS_FOMAT_MZXMLFILE_H