OpenMS
Loading...
Searching...
No Matches
XMLHandler.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Chris Bielow $
6// $Authors: Marc Sturm, Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
13
14
19
20#include <iosfwd>
21#include <string>
22#include <string_view>
23
24
25namespace OpenMS
26{
27 class ControlledVocabulary;
28 class CVTerm;
29 class MetaInfoInterface;
30 class ProteinIdentification;
31
32 namespace Internal
33 {
34
35 // XMLCh string handling lives in StringManager (Xerces-free public API);
36 // shared_xerces_ptr / unique_xerces_ptr / CONST_XMLCH are declared there.
37
41 class OPENMS_DLLAPI XMLHandler
42 {
43public:
44
46 class OPENMS_DLLAPI EndParsingSoftly :
48 {
49 public:
50 EndParsingSoftly(const char * file, int line, const char * function) :
51 Exception::BaseException(file, line, function)
52 {
53 }
54
55 };
56
59 {
61 STORE
62 };
63
65 {
66 LD_ALLDATA, // default; load all data
67 LD_RAWCOUNTS, // only count the total number of spectra and chromatograms (usually very fast)
68 LD_COUNTS_WITHOPTIONS // count the number of spectra, while respecting PeakFileOptions (msLevel and RTRange) and chromatograms (fast)
69 };
70
71
73 XMLHandler(const std::string & filename, const std::string & version);
75 virtual ~XMLHandler();
76
78 void reset();
79
81 void fatalError(ActionMode mode, const std::string & msg, UInt line = 0, UInt column = 0) const;
83 void error(ActionMode mode, const std::string & msg, UInt line = 0, UInt column = 0) const;
85 void warning(ActionMode mode, const std::string & msg, UInt line = 0, UInt column = 0) const;
86
97 virtual void onStartElement(const char16_t * qname, const XMLAttributes & attributes);
99 virtual void onEndElement(const char16_t * qname);
101 virtual void onCharacters(const char16_t * chars, Size length);
103
105 virtual void writeTo(std::ostream & /*os*/);
106
108 virtual LOADDETAIL getLoadDetail() const;
109
111 virtual void setLoadDetail(const LOADDETAIL d);
112
120 static std::string writeXMLEscape(const std::string& to_escape)
121 {
122 std::string _copy = to_escape;
123 // has() is cheap, so check before calling substitute(), since substitute() will usually happen rarely
124 if (StringUtils::has(_copy, '&')) StringUtils::substitute(_copy, "&","&amp;");
125 if (StringUtils::has(_copy, '>')) StringUtils::substitute(_copy, ">","&gt;");
126 if (StringUtils::has(_copy, '"')) StringUtils::substitute(_copy, "\"","&quot;");
127 if (StringUtils::has(_copy, '<')) StringUtils::substitute(_copy, "<","&lt;");
128 if (StringUtils::has(_copy, '\'')) StringUtils::substitute(_copy, "'","&apos;");
129
130 return _copy;
131 }
132
146 static DataValue fromXSDString(const std::string& type, const std::string& value)
147 {
148 DataValue data_value;
149 // float type
150 if (type == "xsd:double" || type == "xsd:float" || type == "xsd:decimal")
151 {
152 data_value = DataValue(StringUtils::toDouble(value));
153 }
154 // <=32 bit integer types
155 else if (type == "xsd:byte" || // 8bit signed
156 type == "xsd:int" || // 32bit signed
157 type == "xsd:unsignedShort" || // 16bit unsigned
158 type == "xsd:short" || // 16bit signed
159 type == "xsd:unsignedByte" || type == "xsd:unsignedInt")
160 {
161 data_value = DataValue(StringUtils::toInt32(value));
162 }
163 // 64 bit integer types
164 else if (type == "xsd:long" || type == "xsd:unsignedLong" || // 64bit signed or unsigned respectively
165 type == "xsd:integer" || type == "xsd:negativeInteger" || // any 'integer' has arbitrary size... but we have to cope with 64bit for now.
166 type == "xsd:nonNegativeInteger" || type == "xsd:nonPositiveInteger" || type == "xsd:positiveInteger")
167 {
168 data_value = DataValue(StringUtils::toInt64(value)); // internally a signed 64-bit integer. So if someone uses 2^64-1 as value, toInt64() will raise an exception...
169 }
170 // everything else is treated as a string
171 else
172 {
173 data_value = DataValue(value);
174 }
175 return data_value;
176 }
177
178
191 DataValue cvParamToValue(const ControlledVocabulary& cv, const std::string& parent_tag,
192 const std::string& accession, const std::string& name, const std::string& value,
193 const std::string& unit_accession) const;
194
203 DataValue cvParamToValue(const ControlledVocabulary& cv, const CVTerm& raw_term) const;
204
207 void checkUniqueIdentifiers_(const std::vector<ProteinIdentification>& prot_ids) const;
208
209protected:
211 std::string file_;
212
214 std::string version_;
215
218
224 std::vector<std::string> open_tags_;
225
228
229
231 inline bool equal_(const char16_t * a, const char16_t * b) const
232 {
233 // Guard null pointers before constructing views: u16string_view(nullptr)
234 // is UB, whereas the previous XMLString::compareString tolerated nulls
235 // (both null => equal, one null => unequal), which this reproduces.
236 if (a == nullptr || b == nullptr) return a == b;
237 return std::u16string_view(a) == std::u16string_view(b);
238 }
239
241
242
244 void writeUserParam_(const std::string & tag_name, std::ostream & os, const MetaInfoInterface & meta, UInt indent) const;
245
260 static void writeUserParamValue_(std::ostream & os, const std::string & tag_start, const std::string & name, const DataValue & value);
261
263
265
266
268 std::vector<std::vector<std::string> > cv_terms_;
269
272 SignedSize cvStringToEnum_(const Size section, const std::string & term, const char * message, const SignedSize result_on_error = 0);
273
275
277
278
280 inline Int asInt_(const std::string & in) const
281 {
282 Int res = 0;
283 try
284 {
285 res = StringUtils::toInt32(in);
286 }
288 {
289 error(LOAD,std::string("Int conversion error of \"") + in + "\"");
290 }
291 return res;
292 }
293
295 inline Int asInt_(const char16_t * in) const
296 {
297 return sm_.parseInt(in);
298 }
299
301 inline UInt asUInt_(const std::string & in) const
302 {
303 UInt res = 0;
304 try
305 {
306 Int tmp = StringUtils::toInt32(in);
307 if (tmp < 0)
308 {
309 throw Exception::ConversionError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "");
310 }
311 res = UInt(tmp);
312 }
314 {
315 error(LOAD,std::string("UInt conversion error of \"") + in + "\"");
316 }
317 return res;
318 }
319
321 inline double asDouble_(const std::string & in) const
322 {
323 double res = 0.0;
324 try
325 {
326 res = StringUtils::toDouble(in);
327 }
329 {
330 error(LOAD,std::string("Double conversion error of \"") + in + "\"");
331 }
332 return res;
333 }
334
336 inline float asFloat_(const std::string & in) const
337 {
338 float res = 0.0;
339 try
340 {
341 res = StringUtils::toFloat(in);
342 }
344 {
345 error(LOAD,std::string("Float conversion error of \"") + in + "\"");
346 }
347 return res;
348 }
349
357 inline bool asBool_(const std::string & in) const
358 {
359 if (in == "true" || in == "TRUE" || in == "True" || in == "1")
360 {
361 return true;
362 }
363 else if (in == "false" || in == "FALSE" || in == "False" || in == "0")
364 {
365 return false;
366 }
367 else
368 {
369 error(LOAD,std::string("Boolean conversion error of \"") + in + "\"");
370 }
371 return false;
372 }
373
375 inline DateTime asDateTime_(std::string date_string) const
376 {
377 DateTime date_time;
378 if (!date_string.empty())
379 {
380 try
381 {
382 //strip away milliseconds
383 StringUtils::trim(date_string);
384 date_string = StringUtils::substr(date_string, 0, 19);
385 date_time.set(date_string);
386 }
387 catch (Exception::ParseError& /*err*/ )
388 {
389 error(LOAD,std::string("DateTime conversion error of \"") + date_string + "\"");
390 }
391 }
392 return date_time;
393 }
394
396
398
399
401 inline std::string attributeAsString_(const XMLAttributes & a, const char * name) const
402 {
403 const char16_t * val = a.value(name);
404 if (val == nullptr) fatalError(LOAD,std::string("Required attribute '") + name + "' not present!");
405 return sm_.convert(val);
406 }
407
409 inline Int attributeAsInt_(const XMLAttributes & a, const char * name) const
410 {
411 const char16_t * val = a.value(name);
412 if (val == nullptr) fatalError(LOAD,std::string("Required attribute '") + name + "' not present!");
413 return sm_.parseInt(val);
414 }
415
417 inline double attributeAsDouble_(const XMLAttributes & a, const char * name) const
418 {
419 const char16_t * val = a.value(name);
420 if (val == nullptr) fatalError(LOAD,std::string("Required attribute '") + name + "' not present!");
421 return StringUtils::toDouble(sm_.convert(val));
422 }
423
425 DoubleList attributeAsDoubleList_(const XMLAttributes & a, const char * name) const;
426
428 IntList attributeAsIntList_(const XMLAttributes & a, const char * name) const;
429
431 StringList attributeAsStringList_(const XMLAttributes & a, const char * name) const;
432
438 inline bool optionalAttributeAsString_(std::string & value, const XMLAttributes & a, const char * name) const
439 {
440 const char16_t * val = a.value(name);
441 if (val != nullptr)
442 {
443 value = sm_.convert(val);
444 return true;
445 }
446 return false;
447 }
448
454 inline bool optionalAttributeAsInt_(Int & value, const XMLAttributes & a, const char * name) const
455 {
456 const char16_t * val = a.value(name);
457 if (val != nullptr)
458 {
459 value = sm_.parseInt(val);
460 return true;
461 }
462 return false;
463 }
464
470 inline bool optionalAttributeAsUInt_(UInt & value, const XMLAttributes & a, const char * name) const
471 {
472 const char16_t * val = a.value(name);
473 if (val != nullptr)
474 {
475 value = sm_.parseInt(val);
476 return true;
477 }
478 return false;
479 }
480
486 inline bool optionalAttributeAsDouble_(double & value, const XMLAttributes & a, const char * name) const
487 {
488 const char16_t * val = a.value(name);
489 if (val != nullptr)
490 {
491 value =StringUtils::toDouble(sm_.convert(val));
492 return true;
493 }
494 return false;
495 }
496
502 inline bool optionalAttributeAsDoubleList_(DoubleList & value, const XMLAttributes & a, const char * name) const
503 {
504 const char16_t * val = a.value(name);
505 if (val != nullptr)
506 {
507 value = attributeAsDoubleList_(a, name);
508 return true;
509 }
510 return false;
511 }
512
518 inline bool optionalAttributeAsStringList_(StringList & value, const XMLAttributes & a, const char * name) const
519 {
520 const char16_t * val = a.value(name);
521 if (val != nullptr)
522 {
523 value = attributeAsStringList_(a, name);
524 return true;
525 }
526 return false;
527 }
528
534 inline bool optionalAttributeAsIntList_(IntList & value, const XMLAttributes & a, const char * name) const
535 {
536 const char16_t * val = a.value(name);
537 if (val != nullptr)
538 {
539 value = attributeAsIntList_(a, name);
540 return true;
541 }
542 return false;
543 }
544
546 inline std::string attributeAsString_(const XMLAttributes & a, const char16_t * name) const
547 {
548 const char16_t * val = a.value(name);
549 if (val == nullptr) fatalError(LOAD,std::string("Required attribute '") + sm_.convert(name) + "' not present!");
550 return sm_.convert(val);
551 }
552
554 inline Int attributeAsInt_(const XMLAttributes & a, const char16_t * name) const
555 {
556 const char16_t * val = a.value(name);
557 if (val == nullptr) fatalError(LOAD,std::string("Required attribute '") + sm_.convert(name) + "' not present!");
558 return sm_.parseInt(val);
559 }
560
562 inline double attributeAsDouble_(const XMLAttributes & a, const char16_t * name) const
563 {
564 const char16_t * val = a.value(name);
565 if (val == nullptr) fatalError(LOAD,std::string("Required attribute '") + sm_.convert(name) + "' not present!");
566 return StringUtils::toDouble(sm_.convert(val));
567 }
568
570 DoubleList attributeAsDoubleList_(const XMLAttributes & a, const char16_t * name) const;
571
573 IntList attributeAsIntList_(const XMLAttributes & a, const char16_t * name) const;
574
576 StringList attributeAsStringList_(const XMLAttributes & a, const char16_t * name) const;
577
579 inline bool optionalAttributeAsString_(std::string& value, const XMLAttributes & a, const char16_t * name) const
580 {
581 const char16_t * val = a.value(name);
582 if (val != nullptr)
583 {
584 value = sm_.convert(val);
585 return !value.empty();
586 }
587 return false;
588 }
589
591 inline bool optionalAttributeAsInt_(Int & value, const XMLAttributes & a, const char16_t * name) const
592 {
593 const char16_t * val = a.value(name);
594 if (val != nullptr)
595 {
596 value = sm_.parseInt(val);
597 return true;
598 }
599 return false;
600 }
601
603 inline bool optionalAttributeAsUInt_(UInt & value, const XMLAttributes & a, const char16_t * name) const
604 {
605 const char16_t * val = a.value(name);
606 if (val != nullptr)
607 {
608 value = sm_.parseInt(val);
609 return true;
610 }
611 return false;
612 }
613
615 inline bool optionalAttributeAsDouble_(double & value, const XMLAttributes & a, const char16_t * name) const
616 {
617 const char16_t * val = a.value(name);
618 if (val != nullptr)
619 {
620 value = StringUtils::toDouble(sm_.convert(val));
621 return true;
622 }
623 return false;
624 }
625
631 inline bool optionalAttributeAsDoubleList_(DoubleList & value, const XMLAttributes & a, const char16_t * name) const
632 {
633 const char16_t * val = a.value(name);
634 if (val != nullptr)
635 {
636 value = attributeAsDoubleList_(a, name);
637 return true;
638 }
639 return false;
640 }
641
647 inline bool optionalAttributeAsIntList_(IntList & value, const XMLAttributes & a, const char16_t * name) const
648 {
649 const char16_t * val = a.value(name);
650 if (val != nullptr)
651 {
652 value = attributeAsIntList_(a, name);
653 return true;
654 }
655 return false;
656 }
657
663 inline bool optionalAttributeAsStringList_(StringList & value, const XMLAttributes & a, const char16_t * name) const
664 {
665 const char16_t * val = a.value(name);
666 if (val != nullptr)
667 {
668 value = attributeAsStringList_(a, name);
669 return true;
670 }
671 return false;
672 }
673
675
676private:
679
680 inline const std::string& expectList_(const std::string& str) const
681 {
682 if (!(StringUtils::hasPrefix(str, '[') && StringUtils::hasSuffix(str, ']')))
683 {
684 fatalError(LOAD,std::string("List argument is not a string representation of a list!"));
685 }
686 return str;
687 }
688
689 };
690
691 } // namespace Internal
692} // namespace OpenMS
693
694
Representation of controlled vocabulary term.
Definition CVTerm.h:28
Definition ControlledVocabulary.h:29
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition DataValue.h:33
DateTime Class.
Definition DateTime.h:31
void set(UInt month, UInt day, UInt year, UInt hour, UInt minute, UInt second)
sets data from six integers
Exception base class.
Definition Exception.h:63
Invalid conversion exception.
Definition Exception.h:331
Parse Error exception.
Definition Exception.h:596
Helper class for XML parsing that handles the conversions of Xerces strings.
Definition StringManager.h:197
static XercesString convert(const char *str)
Transcode the supplied C string to a UTF-16 string.
static Int parseInt(const char16_t *str)
Parse an integer from a UTF-16 numeric string (as Xerces' XMLString::parseInt would).
Xerces-free, lightweight view over the attribute list of an XML element.
Definition XMLAttributes.h:32
const char16_t * value(const char16_t *qname) const
Value of the attribute named qname (UTF-16 code units), or nullptr if absent.
Exception that is thrown if the parsing is ended by some event (e.g. if only a prefix of the XML file...
Definition XMLHandler.h:48
EndParsingSoftly(const char *file, int line, const char *function)
Definition XMLHandler.h:50
Base class for XML handlers.
Definition XMLHandler.h:42
float asFloat_(const std::string &in) const
Conversion of a std::string to a float value.
Definition XMLHandler.h:336
SignedSize cvStringToEnum_(const Size section, const std::string &term, const char *message, const SignedSize result_on_error=0)
UInt asUInt_(const std::string &in) const
Conversion of a std::string to an unsigned integer value.
Definition XMLHandler.h:301
virtual LOADDETAIL getLoadDetail() const
handler which support partial loading, implement this method
bool optionalAttributeAsDouble_(double &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the double value if the attribute is present.
Definition XMLHandler.h:615
bool optionalAttributeAsString_(std::string &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the String value if the attribute is present.
Definition XMLHandler.h:579
LOADDETAIL load_detail_
parse only until total number of scans and chroms have been determined from attributes
Definition XMLHandler.h:227
bool optionalAttributeAsIntList_(IntList &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the IntList value if the attribute is present.
Definition XMLHandler.h:534
virtual void setLoadDetail(const LOADDETAIL d)
handler which support partial loading, implement this method
Int asInt_(const std::string &in) const
Conversion of a std::string to an integer value.
Definition XMLHandler.h:280
void checkUniqueIdentifiers_(const std::vector< ProteinIdentification > &prot_ids) const
void warning(ActionMode mode, const std::string &msg, UInt line=0, UInt column=0) const
Warning handler.
static std::string writeXMLEscape(const std::string &to_escape)
Escapes a string and returns the escaped string.
Definition XMLHandler.h:120
StringList attributeAsStringList_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a StringList.
XMLHandler()
Not implemented.
Int attributeAsInt_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a Int.
Definition XMLHandler.h:554
StringList attributeAsStringList_(const XMLAttributes &a, const char *name) const
Converts an attribute to an StringList.
Int asInt_(const char16_t *in) const
Conversion of a Xerces string to an integer value.
Definition XMLHandler.h:295
double attributeAsDouble_(const XMLAttributes &a, const char *name) const
Converts an attribute to a double.
Definition XMLHandler.h:417
DataValue cvParamToValue(const ControlledVocabulary &cv, const std::string &parent_tag, const std::string &accession, const std::string &name, const std::string &value, const std::string &unit_accession) const
Convert the value of a <cvParam value=.> (as commonly found in PSI schemata) to the DataValue with th...
bool optionalAttributeAsStringList_(StringList &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the StringList value if the attribute is present.
Definition XMLHandler.h:518
std::string attributeAsString_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a String.
Definition XMLHandler.h:546
bool optionalAttributeAsDoubleList_(DoubleList &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the DoubleList value if the attribute is present.
Definition XMLHandler.h:502
LOADDETAIL
Definition XMLHandler.h:65
@ LD_RAWCOUNTS
Definition XMLHandler.h:67
@ LD_ALLDATA
Definition XMLHandler.h:66
virtual void onCharacters(const char16_t *chars, Size length)
Parsing method for character data.
std::string version_
Schema version.
Definition XMLHandler.h:214
Int attributeAsInt_(const XMLAttributes &a, const char *name) const
Converts an attribute to a Int.
Definition XMLHandler.h:409
void fatalError(ActionMode mode, const std::string &msg, UInt line=0, UInt column=0) const
Fatal error handler. Throws a ParseError exception.
static void writeUserParamValue_(std::ostream &os, const std::string &tag_start, const std::string &name, const DataValue &value)
Writes one meta value as a user parameter tag, as writeUserParam_() does for each meta value.
std::string attributeAsString_(const XMLAttributes &a, const char *name) const
Converts an attribute to a String.
Definition XMLHandler.h:401
ActionMode
Action to set the current mode (for error messages)
Definition XMLHandler.h:59
@ LOAD
Loading a file.
Definition XMLHandler.h:60
virtual void onStartElement(const char16_t *qname, const XMLAttributes &attributes)
Parsing method for opening tags.
void writeUserParam_(const std::string &tag_name, std::ostream &os, const MetaInfoInterface &meta, UInt indent) const
Writes the content of MetaInfoInterface to the file.
bool asBool_(const std::string &in) const
Conversion of a string to a boolean value.
Definition XMLHandler.h:357
bool optionalAttributeAsUInt_(UInt &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the UInt value if the attribute is present.
Definition XMLHandler.h:470
DoubleList attributeAsDoubleList_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a DoubleList.
bool optionalAttributeAsUInt_(UInt &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the UInt value if the attribute is present.
Definition XMLHandler.h:603
static DataValue fromXSDString(const std::string &type, const std::string &value)
Convert an XSD type (e.g. 'xsd:double') to a DataValue.
Definition XMLHandler.h:146
bool equal_(const char16_t *a, const char16_t *b) const
Returns if two Xerces strings are equal.
Definition XMLHandler.h:231
StringManager sm_
Helper class for string conversion.
Definition XMLHandler.h:217
const std::string & expectList_(const std::string &str) const
Definition XMLHandler.h:680
void error(ActionMode mode, const std::string &msg, UInt line=0, UInt column=0) const
Error handler for recoverable errors.
XMLHandler(const std::string &filename, const std::string &version)
Default constructor.
double asDouble_(const std::string &in) const
Conversion of a std::string to a double value.
Definition XMLHandler.h:321
bool optionalAttributeAsStringList_(StringList &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the StringList value if the attribute is present.
Definition XMLHandler.h:663
DataValue cvParamToValue(const ControlledVocabulary &cv, const CVTerm &raw_term) const
Convert the value of a <cvParam value=.> (as commonly found in PSI schemata) to the DataValue with th...
IntList attributeAsIntList_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a IntList.
std::string file_
File name.
Definition XMLHandler.h:211
double attributeAsDouble_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a double.
Definition XMLHandler.h:562
bool optionalAttributeAsDouble_(double &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the double value if the attribute is present.
Definition XMLHandler.h:486
bool optionalAttributeAsInt_(Int &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the Int value if the attribute is present.
Definition XMLHandler.h:591
virtual void writeTo(std::ostream &)
Writes the contents to a stream.
bool optionalAttributeAsIntList_(IntList &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the IntList value if the attribute is present.
Definition XMLHandler.h:647
std::vector< std::vector< std::string > > cv_terms_
Array of CV term lists (one sublist denotes one term and it's children)
Definition XMLHandler.h:268
IntList attributeAsIntList_(const XMLAttributes &a, const char *name) const
Converts an attribute to an IntList.
DateTime asDateTime_(std::string date_string) const
Conversion of a xs:datetime string to a DateTime value.
Definition XMLHandler.h:375
bool optionalAttributeAsDoubleList_(DoubleList &value, const XMLAttributes &a, const char16_t *name) const
Assigns the attribute content to the DoubleList value if the attribute is present.
Definition XMLHandler.h:631
void reset()
Release internal memory used for parsing (call.
std::vector< std::string > open_tags_
Stack of open XML tags.
Definition XMLHandler.h:224
bool optionalAttributeAsString_(std::string &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the String value if the attribute is present.
Definition XMLHandler.h:438
DoubleList attributeAsDoubleList_(const XMLAttributes &a, const char *name) const
Converts an attribute to a DoubleList.
virtual ~XMLHandler()
Destructor.
bool optionalAttributeAsInt_(Int &value, const XMLAttributes &a, const char *name) const
Assigns the attribute content to the Int value if the attribute is present.
Definition XMLHandler.h:454
virtual void onEndElement(const char16_t *qname)
Parsing method for closing tags.
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition MetaInfoInterface.h:35
int Int
Signed integer type.
Definition Types.h:72
unsigned int UInt
Unsigned integer type.
Definition Types.h:64
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition Types.h:104
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
std::vector< Int > IntList
Vector of signed integers.
Definition TypeAliases.h:24
std::vector< double > DoubleList
Vector of double precision real types.
Definition TypeAliases.h:31
std::vector< std::string > StringList
Vector of String.
Definition TypeAliases.h:39
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19