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

Method startElement

src/openms/source/FORMAT/HANDLERS/ConsensusXMLHandler.cpp:133–599  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 }
132
133 void ConsensusXMLHandler::startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes)
134 {
135 const String& parent_tag = (open_tags_.empty() ? "" : open_tags_.back());
136 open_tags_.push_back(sm_.convert(qname));
137 const String& tag = open_tags_.back();
138
139 String tmp_str;
140 if (tag == "map")
141 {
142 setProgress(++progress_);
143 Size last_map = attributeAsInt_(attributes, "id");
144 last_meta_ = &consensus_map_->getColumnHeaders()[last_map];
145 consensus_map_->getColumnHeaders()[last_map].filename = attributeAsString_(attributes, "name");
146 String unique_id;
147 if (XMLHandler::optionalAttributeAsString_(unique_id, attributes, "unique_id"))
148 {
149 UniqueIdInterface tmp;
150 tmp.setUniqueId(unique_id);
151 consensus_map_->getColumnHeaders()[last_map].unique_id = tmp.getUniqueId();
152 }
153 String label;
154 if (XMLHandler::optionalAttributeAsString_(label, attributes, "label"))
155 {
156 consensus_map_->getColumnHeaders()[last_map].label = label;
157 }
158 UInt size;
159 if (XMLHandler::optionalAttributeAsUInt_(size, attributes, "size"))
160 {
161 consensus_map_->getColumnHeaders()[last_map].size = size;
162 }
163 }
164 else if (tag == "consensusElement")
165 {
166 setProgress(++progress_);
167 act_cons_element_ = ConsensusFeature();
168 last_meta_ = &act_cons_element_;
169 // quality
170 if (double quality; optionalAttributeAsDouble_(quality, attributes, "quality"))
171 {
172 act_cons_element_.setQuality(quality);
173 }
174 // charge
175 if (Int charge; optionalAttributeAsInt_(charge, attributes, "charge"))
176 {
177 act_cons_element_.setCharge(charge);
178 }
179 // unique id
180 act_cons_element_.setUniqueId(attributeAsString_(attributes, "id"));
181 last_meta_ = &act_cons_element_;
182 }
183 else if (tag == "centroid")
184 {
185 tmp_str = attributeAsString_(attributes, "rt");
186 if (!tmp_str.empty())
187 {
188 pos_[Peak2D::RT] = asDouble_(tmp_str);
189 }
190

Callers

nothing calls this directly

Calls 15

attributeAsInt_Function · 0.85
attributeAsString_Function · 0.85
optionalAttributeAsUInt_Function · 0.85
optionalAttributeAsInt_Function · 0.85
asDouble_Function · 0.85
attributeAsDouble_Function · 0.85
attributeAsIntList_Function · 0.85
attributeAsDoubleList_Function · 0.85
attributeAsStringList_Function · 0.85
getUniqueIdFunction · 0.85

Tested by

no test coverage detected