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 // UTF-16 string handling lives in StringManager.
36
40 class OPENMS_DLLAPI XMLHandler
41 {
42public:
43
45 class OPENMS_DLLAPI EndParsingSoftly :
47 {
48 public:
49 EndParsingSoftly(const char * file, int line, const char * function) :
50 Exception::BaseException(file, line, function)
51 {
52 }
53
54 };
55
58 {
60 STORE
61 };
62
64 {
65 LD_ALLDATA, // default; load all data
66 LD_RAWCOUNTS, // only count the total number of spectra and chromatograms (usually very fast)
67 LD_COUNTS_WITHOPTIONS // count the number of spectra, while respecting PeakFileOptions (msLevel and RTRange) and chromatograms (fast)
68 };
69
70
72 XMLHandler(const std::string & filename, const std::string & version);
74 virtual ~XMLHandler();
75
77 void reset();
78
80 void fatalError(ActionMode mode, const std::string & msg, UInt line = 0, UInt column = 0) const;
82 void error(ActionMode mode, const std::string & msg, UInt line = 0, UInt column = 0) const;
84 void warning(ActionMode mode, const std::string & msg, UInt line = 0, UInt column = 0) const;
85
95 virtual void onStartElement(const char16_t * qname, const XMLAttributes & attributes);
97 virtual void onEndElement(const char16_t * qname);
99 virtual void onCharacters(const char16_t * chars, Size length);
108 virtual bool tryOnCharactersUTF8(const char* chars, Size length);
116 virtual bool tryOnStartElementUTF8(std::string_view qname, const XMLAttributes& attributes);
118 virtual bool tryOnEndElementUTF8(std::string_view qname);
119
121
123 virtual void writeTo(std::ostream & /*os*/);
124
126 virtual LOADDETAIL getLoadDetail() const;
127
129 virtual void setLoadDetail(const LOADDETAIL d);
130
138 static std::string writeXMLEscape(const std::string& to_escape)
139 {
140 std::string _copy = to_escape;
141 // has() is cheap, so check before calling substitute(), since substitute() will usually happen rarely
142 if (StringUtils::has(_copy, '&')) StringUtils::substitute(_copy, "&","&amp;");
143 if (StringUtils::has(_copy, '>')) StringUtils::substitute(_copy, ">","&gt;");
144 if (StringUtils::has(_copy, '"')) StringUtils::substitute(_copy, "\"","&quot;");
145 if (StringUtils::has(_copy, '<')) StringUtils::substitute(_copy, "<","&lt;");
146 if (StringUtils::has(_copy, '\'')) StringUtils::substitute(_copy, "'","&apos;");
147
148 return _copy;
149 }
150
164 static DataValue fromXSDString(const std::string& type, const std::string& value)
165 {
166 DataValue data_value;
167 // float type
168 if (type == "xsd:double" || type == "xsd:float" || type == "xsd:decimal")
169 {
170 data_value = DataValue(StringUtils::toDouble(value));
171 }
172 // <=32 bit integer types
173 else if (type == "xsd:byte" || // 8bit signed
174 type == "xsd:int" || // 32bit signed
175 type == "xsd:unsignedShort" || // 16bit unsigned
176 type == "xsd:short" || // 16bit signed
177 type == "xsd:unsignedByte" || type == "xsd:unsignedInt")
178 {
179 data_value = DataValue(StringUtils::toInt32(value));
180 }
181 // 64 bit integer types
182 else if (type == "xsd:long" || type == "xsd:unsignedLong" || // 64bit signed or unsigned respectively
183 type == "xsd:integer" || type == "xsd:negativeInteger" || // any 'integer' has arbitrary size... but we have to cope with 64bit for now.
184 type == "xsd:nonNegativeInteger" || type == "xsd:nonPositiveInteger" || type == "xsd:positiveInteger")
185 {
186 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...
187 }
188 // everything else is treated as a string
189 else
190 {
191 data_value = DataValue(value);
192 }
193 return data_value;
194 }
195
196
209 DataValue cvParamToValue(const ControlledVocabulary& cv, const std::string& parent_tag,
210 const std::string& accession, const std::string& name, const std::string& value,
211 const std::string& unit_accession) const;
212
221 DataValue cvParamToValue(const ControlledVocabulary& cv, const CVTerm& raw_term) const;
222
225 void checkUniqueIdentifiers_(const std::vector<ProteinIdentification>& prot_ids) const;
226
227protected:
229 std::string file_;
230
232 std::string version_;
233
236
242 std::vector<std::string> open_tags_;
243
246
247
249 inline bool equal_(const char16_t * a, const char16_t * b) const
250 {
251 // Guard null pointers before constructing views: u16string_view(nullptr)
252 // is UB, whereas the previous XMLString::compareString tolerated nulls
253 // (both null => equal, one null => unequal), which this reproduces.
254 if (a == nullptr || b == nullptr) return a == b;
255 return std::u16string_view(a) == std::u16string_view(b);
256 }
257
259
260
262 void writeUserParam_(const std::string & tag_name, std::ostream & os, const MetaInfoInterface & meta, UInt indent) const;
263
278 static void writeUserParamValue_(std::ostream & os, const std::string & tag_start, const std::string & name, const DataValue & value);
279
281
283
284
286 std::vector<std::vector<std::string> > cv_terms_;
287
290 SignedSize cvStringToEnum_(const Size section, const std::string & term, const char * message, const SignedSize result_on_error = 0);
291
293
295
296
298 inline Int asInt_(const std::string & in) const
299 {
300 Int res = 0;
301 try
302 {
303 res = StringUtils::toInt32(in);
304 }
306 {
307 error(LOAD,std::string("Int conversion error of \"") + in + "\"");
308 }
309 return res;
310 }
311
313 inline Int asInt_(const char16_t * in) const
314 {
315 return sm_.parseInt(in);
316 }
317
319 inline UInt asUInt_(const std::string & in) const
320 {
321 UInt res = 0;
322 try
323 {
324 Int tmp = StringUtils::toInt32(in);
325 if (tmp < 0)
326 {
327 throw Exception::ConversionError(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION, "");
328 }
329 res = UInt(tmp);
330 }
332 {
333 error(LOAD,std::string("UInt conversion error of \"") + in + "\"");
334 }
335 return res;
336 }
337
339 inline double asDouble_(const std::string & in) const
340 {
341 double res = 0.0;
342 try
343 {
344 res = StringUtils::toDouble(in);
345 }
347 {
348 error(LOAD,std::string("Double conversion error of \"") + in + "\"");
349 }
350 return res;
351 }
352
354 inline float asFloat_(const std::string & in) const
355 {
356 float res = 0.0;
357 try
358 {
359 res = StringUtils::toFloat(in);
360 }
362 {
363 error(LOAD,std::string("Float conversion error of \"") + in + "\"");
364 }
365 return res;
366 }
367
375 inline bool asBool_(const std::string & in) const
376 {
377 if (in == "true" || in == "TRUE" || in == "True" || in == "1")
378 {
379 return true;
380 }
381 else if (in == "false" || in == "FALSE" || in == "False" || in == "0")
382 {
383 return false;
384 }
385 else
386 {
387 error(LOAD,std::string("Boolean conversion error of \"") + in + "\"");
388 }
389 return false;
390 }
391
393 inline DateTime asDateTime_(std::string date_string) const
394 {
395 DateTime date_time;
396 if (!date_string.empty())
397 {
398 try
399 {
400 //strip away milliseconds
401 StringUtils::trim(date_string);
402 date_string = StringUtils::substr(date_string, 0, 19);
403 date_time.set(date_string);
404 }
405 catch (Exception::ParseError& /*err*/ )
406 {
407 error(LOAD,std::string("DateTime conversion error of \"") + date_string + "\"");
408 }
409 }
410 return date_time;
411 }
412
414
416
417
419 inline std::string attributeAsString_(const XMLAttributes & a, const char * name) const
420 {
421 std::string val;
422 if (!a.valueUTF8(name, val)) fatalError(LOAD,std::string("Required attribute '") + name + "' not present!");
423 return val;
424 }
425
427 inline Int attributeAsInt_(const XMLAttributes & a, const char * name) const
428 {
429 std::string val;
430 if (!a.valueUTF8(name, val)) fatalError(LOAD,std::string("Required attribute '") + name + "' not present!");
431 return StringUtils::toInt32(val);
432 }
433
435 inline double attributeAsDouble_(const XMLAttributes & a, const char * name) const
436 {
437 std::string val;
438 if (!a.valueUTF8(name, val)) fatalError(LOAD,std::string("Required attribute '") + name + "' not present!");
439 return StringUtils::toDouble(val);
440 }
441
443 DoubleList attributeAsDoubleList_(const XMLAttributes & a, const char * name) const;
444
446 IntList attributeAsIntList_(const XMLAttributes & a, const char * name) const;
447
449 StringList attributeAsStringList_(const XMLAttributes & a, const char * name) const;
450
456 inline bool optionalAttributeAsString_(std::string & value, const XMLAttributes & a, const char * name) const
457 {
458 return a.valueUTF8(name, value);
459 }
460
466 inline bool optionalAttributeAsInt_(Int & value, const XMLAttributes & a, const char * name) const
467 {
468 std::string val;
469 if (a.valueUTF8(name, val))
470 {
471 value = StringUtils::toInt32(val);
472 return true;
473 }
474 return false;
475 }
476
482 inline bool optionalAttributeAsUInt_(UInt & value, const XMLAttributes & a, const char * name) const
483 {
484 std::string val;
485 if (a.valueUTF8(name, val))
486 {
487 value = StringUtils::toInt32(val);
488 return true;
489 }
490 return false;
491 }
492
498 inline bool optionalAttributeAsDouble_(double & value, const XMLAttributes & a, const char * name) const
499 {
500 std::string val;
501 if (a.valueUTF8(name, val))
502 {
503 value = StringUtils::toDouble(val);
504 return true;
505 }
506 return false;
507 }
508
514 inline bool optionalAttributeAsDoubleList_(DoubleList & value, const XMLAttributes & a, const char * name) const
515 {
516 const char16_t * val = a.value(name);
517 if (val != nullptr)
518 {
519 value = attributeAsDoubleList_(a, name);
520 return true;
521 }
522 return false;
523 }
524
530 inline bool optionalAttributeAsStringList_(StringList & value, const XMLAttributes & a, const char * name) const
531 {
532 const char16_t * val = a.value(name);
533 if (val != nullptr)
534 {
535 value = attributeAsStringList_(a, name);
536 return true;
537 }
538 return false;
539 }
540
546 inline bool optionalAttributeAsIntList_(IntList & value, const XMLAttributes & a, const char * name) const
547 {
548 const char16_t * val = a.value(name);
549 if (val != nullptr)
550 {
551 value = attributeAsIntList_(a, name);
552 return true;
553 }
554 return false;
555 }
556
558 inline std::string attributeAsString_(const XMLAttributes & a, const char16_t * name) const
559 {
560 std::string val;
561 if (!a.valueUTF8(name, val)) fatalError(LOAD,std::string("Required attribute '") + sm_.convert(name) + "' not present!");
562 return val;
563 }
564
566 inline Int attributeAsInt_(const XMLAttributes & a, const char16_t * name) const
567 {
568 std::string val;
569 if (!a.valueUTF8(name, val)) fatalError(LOAD,std::string("Required attribute '") + sm_.convert(name) + "' not present!");
570 return StringUtils::toInt32(val);
571 }
572
574 inline double attributeAsDouble_(const XMLAttributes & a, const char16_t * name) const
575 {
576 std::string val;
577 if (!a.valueUTF8(name, val)) fatalError(LOAD,std::string("Required attribute '") + sm_.convert(name) + "' not present!");
578 return StringUtils::toDouble(val);
579 }
580
582 DoubleList attributeAsDoubleList_(const XMLAttributes & a, const char16_t * name) const;
583
585 IntList attributeAsIntList_(const XMLAttributes & a, const char16_t * name) const;
586
588 StringList attributeAsStringList_(const XMLAttributes & a, const char16_t * name) const;
589
591 inline bool optionalAttributeAsString_(std::string& value, const XMLAttributes & a, const char16_t * name) const
592 {
593 return a.valueUTF8(name, value) && !value.empty();
594 }
595
597 inline bool optionalAttributeAsInt_(Int & value, const XMLAttributes & a, const char16_t * name) const
598 {
599 std::string val;
600 if (a.valueUTF8(name, val))
601 {
602 value = StringUtils::toInt32(val);
603 return true;
604 }
605 return false;
606 }
607
609 inline bool optionalAttributeAsUInt_(UInt & value, const XMLAttributes & a, const char16_t * name) const
610 {
611 std::string val;
612 if (a.valueUTF8(name, val))
613 {
614 value = StringUtils::toInt32(val);
615 return true;
616 }
617 return false;
618 }
619
621 inline bool optionalAttributeAsDouble_(double & value, const XMLAttributes & a, const char16_t * name) const
622 {
623 std::string val;
624 if (a.valueUTF8(name, val))
625 {
626 value = StringUtils::toDouble(val);
627 return true;
628 }
629 return false;
630 }
631
637 inline bool optionalAttributeAsDoubleList_(DoubleList & value, const XMLAttributes & a, const char16_t * name) const
638 {
639 const char16_t * val = a.value(name);
640 if (val != nullptr)
641 {
642 value = attributeAsDoubleList_(a, name);
643 return true;
644 }
645 return false;
646 }
647
653 inline bool optionalAttributeAsIntList_(IntList & value, const XMLAttributes & a, const char16_t * name) const
654 {
655 const char16_t * val = a.value(name);
656 if (val != nullptr)
657 {
658 value = attributeAsIntList_(a, name);
659 return true;
660 }
661 return false;
662 }
663
669 inline bool optionalAttributeAsStringList_(StringList & value, const XMLAttributes & a, const char16_t * name) const
670 {
671 const char16_t * val = a.value(name);
672 if (val != nullptr)
673 {
674 value = attributeAsStringList_(a, name);
675 return true;
676 }
677 return false;
678 }
679
681
682private:
685
686 inline const std::string& expectList_(const std::string& str) const
687 {
688 if (!(StringUtils::hasPrefix(str, '[') && StringUtils::hasSuffix(str, ']')))
689 {
690 fatalError(LOAD,std::string("List argument is not a string representation of a list!"));
691 }
692 return str;
693 }
694
695 };
696
697 } // namespace Internal
698} // namespace OpenMS
699
700
Representation of controlled vocabulary term.
Definition CVTerm.h:28
Definition ControlledVocabulary.h:31
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
Strict UTF-8/UTF-16 conversion and ASCII helpers for XML handlers.
Definition StringManager.h:25
static std::u16string 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.
Non-owning attribute view for an XML start-element callback.
Definition XMLAttributes.h:29
bool valueUTF8(const char16_t *qname, std::string &value) const
Assigns the UTF-8 value of the attribute named qname to value. Returns false (leaving value untouched...
const char16_t * value(const char16_t *qname) const
UTF-16 value by name, 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:47
EndParsingSoftly(const char *file, int line, const char *function)
Definition XMLHandler.h:49
Base class for XML handlers.
Definition XMLHandler.h:41
float asFloat_(const std::string &in) const
Conversion of a std::string to a float value.
Definition XMLHandler.h:354
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:319
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:621
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:591
LOADDETAIL load_detail_
parse only until total number of scans and chroms have been determined from attributes
Definition XMLHandler.h:245
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:546
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:298
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:138
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:566
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 UTF-16 string to an integer value.
Definition XMLHandler.h:313
double attributeAsDouble_(const XMLAttributes &a, const char *name) const
Converts an attribute to a double.
Definition XMLHandler.h:435
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:530
std::string attributeAsString_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a String.
Definition XMLHandler.h:558
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:514
LOADDETAIL
Definition XMLHandler.h:64
@ LD_RAWCOUNTS
Definition XMLHandler.h:66
@ LD_ALLDATA
Definition XMLHandler.h:65
virtual void onCharacters(const char16_t *chars, Size length)
Parsing method for character data.
std::string version_
Schema version.
Definition XMLHandler.h:232
Int attributeAsInt_(const XMLAttributes &a, const char *name) const
Converts an attribute to a Int.
Definition XMLHandler.h:427
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:419
ActionMode
Action to set the current mode (for error messages)
Definition XMLHandler.h:58
@ LOAD
Loading a file.
Definition XMLHandler.h:59
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:375
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:482
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:609
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:164
bool equal_(const char16_t *a, const char16_t *b) const
Returns if two UTF-16 strings are equal.
Definition XMLHandler.h:249
StringManager sm_
Helper class for string conversion.
Definition XMLHandler.h:235
const std::string & expectList_(const std::string &str) const
Definition XMLHandler.h:686
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:339
virtual bool tryOnCharactersUTF8(const char *chars, Size length)
Try to consume UTF-8 character data without UTF-16 conversion.
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:669
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:229
double attributeAsDouble_(const XMLAttributes &a, const char16_t *name) const
Converts an attribute to a double.
Definition XMLHandler.h:574
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:498
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:597
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:653
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:286
virtual bool tryOnStartElementUTF8(std::string_view qname, const XMLAttributes &attributes)
Try to handle an opening tag by its UTF-8 qualified name.
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:393
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:637
void reset()
Release internal memory used for parsing (call.
std::vector< std::string > open_tags_
Stack of open XML tags.
Definition XMLHandler.h:242
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:456
DoubleList attributeAsDoubleList_(const XMLAttributes &a, const char *name) const
Converts an attribute to a DoubleList.
virtual ~XMLHandler()
Destructor.
virtual bool tryOnEndElementUTF8(std::string_view qname)
Closing-tag counterpart of tryOnStartElementUTF8(); falls back to onEndElement().
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:466
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