XML handlers for MzXMLFile. More...
#include <OpenMS/FORMAT/HANDLERS/MzXMLHandler.h>
Public Member Functions | |
virtual void | endElement (const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname) |
Parsing method for closing tags. More... | |
virtual void | startElement (const XMLCh *const uri, const XMLCh *const local_name, const XMLCh *const qname, const xercesc::Attributes &attributes) |
Parsing method for opening tags. More... | |
virtual void | characters (const XMLCh *const chars, const XMLSize_t length) |
Parsing method for character data. More... | |
void | writeTo (std::ostream &os) |
Write the contents to a stream. More... | |
void | setOptions (const PeakFileOptions &options) |
Sets the options. More... | |
Constructors and destructor | |
MzXMLHandler (MapType &exp, const String &filename, const String &version, ProgressLogger &logger) | |
Constructor for a read-only handler. More... | |
MzXMLHandler (const MapType &exp, const String &filename, const String &version, const ProgressLogger &logger) | |
Constructor for a write-only handler. More... | |
virtual | ~MzXMLHandler () |
Destructor. More... | |
![]() | |
XMLHandler (const String &filename, const String &version) | |
Default constructor. More... | |
virtual | ~XMLHandler () |
Destructor. More... | |
void | reset () |
Release internal memory used for parsing (call. More... | |
void | fatalError (ActionMode mode, const String &msg, UInt line=0, UInt column=0) const |
Fatal error handler. Throws a ParseError exception. More... | |
void | error (ActionMode mode, const String &msg, UInt line=0, UInt column=0) const |
Error handler for recoverable errors. More... | |
void | warning (ActionMode mode, const String &msg, UInt line=0, UInt column=0) const |
Warning handler. More... | |
String | errorString () |
Returns the last error description. More... | |
void | fatalError (const xercesc::SAXParseException &exception) |
void | error (const xercesc::SAXParseException &exception) |
void | warning (const xercesc::SAXParseException &exception) |
Protected Types | |
typedef MapType::PeakType | PeakType |
Peak type. More... | |
typedef MSSpectrum< PeakType > | SpectrumType |
Spectrum type. More... | |
typedef SpectrumType::Iterator | PeakIterator |
Protected Member Functions | |
void | writeUserParam_ (std::ostream &os, const MetaInfoInterface &meta, int indent=4, String tag="nameValue") |
write metaInfo to xml (usually in nameValue-tag) More... | |
![]() | |
bool | equal_ (const XMLCh *a, const XMLCh *b) |
Returns if two xerces strings are equal. More... | |
void | writeUserParam_ (const String &tag_name, std::ostream &os, const MetaInfoInterface &meta, UInt indent) const |
Writes the content of MetaInfoInterface to the file. More... | |
Int | asInt_ (const String &in) |
Conversion of a String to an integer value. More... | |
Int | asInt_ (const XMLCh *in) |
Conversion of a Xerces string to an integer value. More... | |
UInt | asUInt_ (const String &in) |
Conversion of a String to an unsigned integer value. More... | |
double | asDouble_ (const String &in) |
Conversion of a String to a double value. More... | |
float | asFloat_ (const String &in) |
Conversion of a String to a float value. More... | |
bool | asBool_ (const String &in) |
Conversion of a string to a boolean value. More... | |
DateTime | asDateTime_ (String date_string) |
Conversion of a xs:datetime string to a DataTime value. More... | |
char * | attributeAsString_ (const xercesc::Attributes &a, const char *name) const |
Converts an attribute to a String. More... | |
Int | attributeAsInt_ (const xercesc::Attributes &a, const char *name) const |
Converts an attribute to a Int. More... | |
DoubleReal | attributeAsDouble_ (const xercesc::Attributes &a, const char *name) const |
Converts an attribute to a DoubleReal. More... | |
DoubleList | attributeAsDoubleList_ (const xercesc::Attributes &a, const char *name) const |
Converts an attribute to a DoubleList. More... | |
IntList | attributeAsIntList_ (const xercesc::Attributes &a, const char *name) const |
Converts an attribute to an IntList. More... | |
StringList | attributeAsStringList_ (const xercesc::Attributes &a, const char *name) const |
Converts an attribute to an StringList. More... | |
bool | optionalAttributeAsString_ (String &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the String value if the attribute is present. More... | |
bool | optionalAttributeAsInt_ (Int &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the Int value if the attribute is present. More... | |
bool | optionalAttributeAsUInt_ (UInt &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the UInt value if the attribute is present. More... | |
bool | optionalAttributeAsDouble_ (DoubleReal &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the DoubleReal value if the attribute is present. More... | |
bool | optionalAttributeAsDoubleList_ (DoubleList &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the DoubleList value if the attribute is present. More... | |
bool | optionalAttributeAsStringList_ (StringList &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the StringList value if the attribute is present. More... | |
bool | optionalAttributeAsIntList_ (IntList &value, const xercesc::Attributes &a, const char *name) const |
Assigns the attribute content to the IntList value if the attribute is present. More... | |
char * | attributeAsString_ (const xercesc::Attributes &a, const XMLCh *name) const |
Converts an attribute to a String. More... | |
Int | attributeAsInt_ (const xercesc::Attributes &a, const XMLCh *name) const |
Converts an attribute to a Int. More... | |
DoubleReal | attributeAsDouble_ (const xercesc::Attributes &a, const XMLCh *name) const |
Converts an attribute to a DoubleReal. More... | |
DoubleList | attributeAsDoubleList_ (const xercesc::Attributes &a, const XMLCh *name) const |
Converts an attribute to a DoubleList. More... | |
IntList | attributeAsIntList_ (const xercesc::Attributes &a, const XMLCh *name) const |
Converts an attribute to a IntList. More... | |
StringList | attributeAsStringList_ (const xercesc::Attributes &a, const XMLCh *name) const |
Converts an attribute to a StringList. More... | |
bool | optionalAttributeAsString_ (String &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the String value if the attribute is present. More... | |
bool | optionalAttributeAsInt_ (Int &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the Int value if the attribute is present. More... | |
bool | optionalAttributeAsUInt_ (UInt &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the UInt value if the attribute is present. More... | |
bool | optionalAttributeAsDouble_ (DoubleReal &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the DoubleReal value if the attribute is present. More... | |
bool | optionalAttributeAsDoubleList_ (DoubleList &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the DoubleList value if the attribute is present. More... | |
bool | optionalAttributeAsIntList_ (IntList &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the IntList value if the attribute is present. More... | |
bool | optionalAttributeAsStringList_ (StringList &value, const xercesc::Attributes &a, const XMLCh *name) const |
Assigns the attribute content to the StringList value if the attribute is present. More... | |
SignedSize | cvStringToEnum_ (const Size section, const String &term, const char *message, const SignedSize result_on_error=0) |
Protected Attributes | |
MapType * | exp_ |
map pointer for reading More... | |
const MapType * | cexp_ |
map pointer for writing More... | |
PeakFileOptions | options_ |
Options for loading and storing. More... | |
bool | skip_spectrum_ |
Flag that indicates whether this spectrum should be skipped (due to options) More... | |
UInt | spec_write_counter_ |
spectrum counter (spectra without peaks are not written) More... | |
const ProgressLogger & | logger_ |
Progress logging class. More... | |
std::vector< DataProcessing > | data_processing_ |
data processing auxilary variable More... | |
temporary data structures to hold parsed data | |
Base64 | decoder_ |
UInt | peak_count_ |
String | precision_ |
String | compressionType_ |
String | char_rest_ |
![]() | |
String | error_message_ |
Error message of the last error. More... | |
String | file_ |
File name. More... | |
String | version_ |
Schema version. More... | |
StringManager | sm_ |
Helper class for string conversion. More... | |
std::vector< String > | open_tags_ |
Stack of open XML tags. More... | |
std::vector< std::vector < String > > | cv_terms_ |
Array of CV term lists (one sublist denotes one term and it's children) More... | |
Private Member Functions | |
void | init_ () |
MzXMLHandler () | |
Not implemented. More... | |
void | initStaticMembers_ () |
Static Private Attributes | |
static const XMLCh * | s_value_ = 0 |
static const XMLCh * | s_count_ = 0 |
static const XMLCh * | s_type_ = 0 |
static const XMLCh * | s_name_ = 0 |
static const XMLCh * | s_version_ = 0 |
static const XMLCh * | s_filename_ = 0 |
static const XMLCh * | s_filetype_ = 0 |
static const XMLCh * | s_filesha1_ = 0 |
static const XMLCh * | s_completiontime_ = 0 |
static const XMLCh * | s_precision_ = 0 |
static const XMLCh * | s_byteorder_ = 0 |
static const XMLCh * | s_pairorder_ = 0 |
static const XMLCh * | s_compressionType_ = 0 |
static const XMLCh * | s_precursorintensity_ = 0 |
static const XMLCh * | s_precursorcharge_ = 0 |
static const XMLCh * | s_windowwideness_ = 0 |
static const XMLCh * | s_mslevel_ = 0 |
static const XMLCh * | s_peakscount_ = 0 |
static const XMLCh * | s_polarity_ = 0 |
static const XMLCh * | s_scantype_ = 0 |
static const XMLCh * | s_retentiontime_ = 0 |
static const XMLCh * | s_startmz_ = 0 |
static const XMLCh * | s_endmz_ = 0 |
static const XMLCh * | s_first_ = 0 |
static const XMLCh * | s_last_ = 0 |
static const XMLCh * | s_phone_ = 0 |
static const XMLCh * | s_email_ = 0 |
static const XMLCh * | s_uri_ = 0 |
static const XMLCh * | s_num_ = 0 |
static const XMLCh * | s_intensitycutoff_ = 0 |
static const XMLCh * | s_centroided_ = 0 |
static const XMLCh * | s_deisotoped_ = 0 |
static const XMLCh * | s_chargedeconvoluted_ = 0 |
Additional Inherited Members | |
![]() | |
enum | ActionMode { LOAD, STORE } |
Action to set the current mode (for error messages) More... | |
XML handlers for MzXMLFile.
MapType has to be a MSExperiment or have the same interface. Do not use this class. It is only needed in MzXMLFile.
|
protected |
|
protected |
Peak type.
|
protected |
Spectrum type.
|
inline |
Constructor for a read-only handler.
|
inline |
Constructor for a write-only handler.
References MzXMLHandler< MapType >::init_().
|
inlinevirtual |
Destructor.
|
private |
Not implemented.
|
virtual |
|
virtual |
Parsing method for closing tags.
Reimplemented from XMLHandler.
References Base64::BYTEORDER_BIGENDIAN.
|
inlineprivate |
|
inlineprivate |
References MzXMLHandler< MapType >::s_byteorder_, MzXMLHandler< MapType >::s_centroided_, MzXMLHandler< MapType >::s_chargedeconvoluted_, MzXMLHandler< MapType >::s_completiontime_, MzXMLHandler< MapType >::s_compressionType_, MzXMLHandler< MapType >::s_count_, MzXMLHandler< MapType >::s_deisotoped_, MzXMLHandler< MapType >::s_email_, MzXMLHandler< MapType >::s_endmz_, MzXMLHandler< MapType >::s_filename_, MzXMLHandler< MapType >::s_filesha1_, MzXMLHandler< MapType >::s_filetype_, MzXMLHandler< MapType >::s_first_, MzXMLHandler< MapType >::s_intensitycutoff_, MzXMLHandler< MapType >::s_last_, MzXMLHandler< MapType >::s_mslevel_, MzXMLHandler< MapType >::s_name_, MzXMLHandler< MapType >::s_num_, MzXMLHandler< MapType >::s_pairorder_, MzXMLHandler< MapType >::s_peakscount_, MzXMLHandler< MapType >::s_phone_, MzXMLHandler< MapType >::s_polarity_, MzXMLHandler< MapType >::s_precision_, MzXMLHandler< MapType >::s_precursorcharge_, MzXMLHandler< MapType >::s_precursorintensity_, MzXMLHandler< MapType >::s_retentiontime_, MzXMLHandler< MapType >::s_scantype_, MzXMLHandler< MapType >::s_startmz_, MzXMLHandler< MapType >::s_type_, MzXMLHandler< MapType >::s_uri_, MzXMLHandler< MapType >::s_value_, MzXMLHandler< MapType >::s_version_, and MzXMLHandler< MapType >::s_windowwideness_.
|
inline |
|
virtual |
Parsing method for opening tags.
Reimplemented from XMLHandler.
References ScanWindow::begin, DataProcessing::CHARGE_DECONVOLUTION, InstrumentSettings::CRM, DataProcessing::DEISOTOPING, ScanWindow::end, String::has(), InstrumentSettings::MASSSPECTRUM, InstrumentSettings::MSNSPECTRUM, DataProcessing::PEAK_PICKING, String::prefix(), SourceFile::setChecksum(), SourceFile::setFileType(), SourceFile::setNameOfFile(), SourceFile::SHA1, InstrumentSettings::SIM, InstrumentSettings::SRM, and String::suffix().
|
virtual |
Write the contents to a stream.
Reimplemented from XMLHandler.
References Base64::BYTEORDER_BIGENDIAN, DataProcessing::CHARGE_DECONVOLUTION, InstrumentSettings::CRM, DataProcessing::DEISOTOPING, DateTime::get(), Precursor::getCharge(), SourceFile::getChecksum(), SourceFile::getChecksumType(), SpectrumSettings::getComment(), DataProcessing::getCompletionTime(), ContactPerson::getEmail(), SourceFile::getFileType(), ContactPerson::getFirstName(), SpectrumSettings::getInstrumentSettings(), Peak1D::getIntensity(), Instrument::getIonDetectors(), Instrument::getIonSources(), Precursor::getIsolationWindowLowerOffset(), Precursor::getIsolationWindowUpperOffset(), ContactPerson::getLastName(), Instrument::getMassAnalyzers(), MetaInfoInterface::getMetaValue(), Instrument::getModel(), MSSpectrum< PeakT >::getMSLevel(), Peak1D::getMZ(), Software::getName(), SourceFile::getNameOfFile(), SpectrumSettings::getNativeID(), InstrumentSettings::getPolarity(), SpectrumSettings::getPrecursors(), DataProcessing::getProcessingActions(), MSSpectrum< PeakT >::getRT(), InstrumentSettings::getScanMode(), InstrumentSettings::getScanWindows(), DataProcessing::getSoftware(), Instrument::getSoftware(), ContactPerson::getURL(), Instrument::getVendor(), Software::getVersion(), InstrumentSettings::getZoomScan(), String::hasPrefix(), String::hasSubstring(), InstrumentSettings::MASSSPECTRUM, MetaInfoInterface::metaValueExists(), InstrumentSettings::MS1SPECTRUM, InstrumentSettings::MSNSPECTRUM, InstrumentSettings::NamesOfScanMode, IonSource::NEGATIVE, DataProcessing::PEAK_PICKING, IonSource::POSITIVE, SourceFile::SHA1, InstrumentSettings::SIM, InstrumentSettings::SRM, String::substr(), String::toInt(), String::toLower(), DataValue::toString(), and InstrumentSettings::UNKNOWN.
|
inlineprotected |
write metaInfo to xml (usually in nameValue-tag)
References MetaInfoInterface::getKeys(), and MetaInfoInterface::getMetaValue().
|
protected |
map pointer for writing
|
protected |
|
protected |
|
protected |
data processing auxilary variable
|
protected |
|
protected |
map pointer for reading
|
protected |
Progress logging class.
|
protected |
Options for loading and storing.
Referenced by MzXMLHandler< MapType >::setOptions().
|
protected |
|
protected |
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
staticprivate |
Referenced by MzXMLHandler< MapType >::initStaticMembers_().
|
protected |
Flag that indicates whether this spectrum should be skipped (due to options)
|
protected |
spectrum counter (spectra without peaks are not written)
OpenMS / TOPP release 1.11.1 | Documentation generated on Thu Nov 14 2013 11:19:37 using doxygen 1.8.5 |