MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / startElement

Method startElement

src/openms/source/FORMAT/HANDLERS/MzMLHandler.cpp:667–1200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

665
666
667 void MzMLHandler::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes)
668 {
669 constexpr XMLCh s_count[] = {'c','o','u','n','t', 0};
670 constexpr XMLCh s_default_array_length[] = { 'd','e','f','a','u','l','t','A','r','r','a','y','L','e','n','g','t','h' , 0};
671 constexpr XMLCh s_array_length[] = { 'a','r','r','a','y','L','e','n','g','t','h' , 0};
672 constexpr XMLCh s_accession[] = { 'a','c','c','e','s','s','i','o','n' , 0};
673 constexpr XMLCh s_name[] = { 'n','a','m','e' , 0};
674 constexpr XMLCh s_type[] = { 't','y','p','e' , 0};
675 constexpr XMLCh s_value[] = { 'v','a','l','u','e' , 0};
676 constexpr XMLCh s_unit_accession[] = { 'u','n','i','t','A','c','c','e','s','s','i','o','n' , 0};
677 constexpr XMLCh s_id[] = { 'i','d' , 0};
678 constexpr XMLCh s_ref[] = { 'r','e','f' , 0};
679 constexpr XMLCh s_version[] = { 'v','e','r','s','i','o','n' , 0};
680 constexpr XMLCh s_version_mzml[] = { 'm','z','M','L',':','v','e','r','s','i','o','n' , 0};
681 constexpr XMLCh s_order[] = { 'o','r','d','e','r' , 0};
682 constexpr XMLCh s_location[] = { 'l','o','c','a','t','i','o','n' , 0};
683 constexpr XMLCh s_sample_ref[] = { 's','a','m','p','l','e','R','e','f' , 0};
684 constexpr XMLCh s_software_ref[] = { 's','o','f','t','w','a','r','e','R','e','f' , 0};
685 constexpr XMLCh s_source_file_ref[] = { 's','o','u','r','c','e','F','i','l','e','R','e','f' , 0};
686 constexpr XMLCh s_spectrum_ref[] = { 's','p','e','c','t','r','u','m','R','e','f' , 0};
687 constexpr XMLCh s_default_instrument_configuration_ref[] = { 'd','e','f','a','u','l','t','I','n','s','t','r','u','m','e','n','t','C','o','n','f','i','g','u','r','a','t','i','o','n','R','e','f' , 0};
688 constexpr XMLCh s_instrument_configuration_ref[] = { 'i','n','s','t','r','u','m','e','n','t','C','o','n','f','i','g','u','r','a','t','i','o','n','R','e','f' , 0};
689 constexpr XMLCh s_default_data_processing_ref[] = { 'd','e','f','a','u','l','t','D','a','t','a','P','r','o','c','e','s','s','i','n','g','R','e','f' , 0};
690 constexpr XMLCh s_data_processing_ref[] = { 'd','a','t','a','P','r','o','c','e','s','s','i','n','g','R','e','f' , 0};
691 constexpr XMLCh s_start_time_stamp[] = { 's','t','a','r','t','T','i','m','e','S','t','a','m','p' , 0};
692 constexpr XMLCh s_external_spectrum_id[] = { 'e','x','t','e','r','n','a','l','S','p','e','c','t','r','u','m','I','D' , 0};
693 // constexpr XMLCh s_default_source_file_ref[] = { 'd','e','f','a','u','l','t','S','o','u','r','c','e','F','i','l','e','R','e','f' , 0};
694 constexpr XMLCh s_scan_settings_ref[] = { 's','c','a','n','S','e','t','t','i','n','g','s','R','e','f' , 0};
695 String tag = sm_.convert(qname);
696 open_tags_.push_back(tag);
697
698 // do nothing until a spectrum/chromatogram/spectrumList ends
699 if (skip_spectrum_ || skip_chromatogram_)
700 {
701 return;
702 }
703
704 //determine parent tag
705 String parent_tag;
706 if (open_tags_.size() > 1)
707 {
708 parent_tag = *(open_tags_.end() - 2);
709 }
710 String parent_parent_tag;
711 if (open_tags_.size() > 2)
712 {
713 parent_parent_tag = *(open_tags_.end() - 3);
714 }
715
716 if (tag == "spectrum")
717 {
718 // for cppcheck
719 constexpr XMLCh s_spot_id[] = { 's','p','o','t','I','D', 0 };
720
721 //number of peaks
722 spec_ = SpectrumType();
723 default_array_length_ = attributeAsInt_(attributes, s_default_array_length);
724 //spectrum source file

Callers

nothing calls this directly

Calls 15

SpectrumTypeEnum · 0.85
attributeAsInt_Function · 0.85
attributeAsString_Function · 0.85
ChromatogramTypeEnum · 0.85
optionalAttributeAsInt_Function · 0.85
asDateTime_Function · 0.85
reserveSpaceSpectraMethod · 0.80
emplace_backMethod · 0.80
backMethod · 0.80
setNameOfFileMethod · 0.80

Tested by

no test coverage detected