MCPcopy Create free account
hub / github.com/ablab/spades / reduce

Method reduce

ext/include/boost/property_tree/string_path.hpp:206–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204
205 template <typename String, typename Translator>
206 typename Translator::external_type string_path<String, Translator>::reduce()
207 {
208 BOOST_ASSERT(!empty() && "Reducing empty path");
209
210 s_iter next_sep = std::find(m_start, m_value.end(), m_separator);
211 String part(m_start, next_sep);
212 m_start = next_sep;
213 if(!empty()) {
214 // Unless we're at the end, skip the separator we found.
215 ++m_start;
216 }
217
218 if(optional<key_type> key = m_tr.get_value(part)) {
219 return *key;
220 }
221 BOOST_PROPERTY_TREE_THROW(ptree_bad_path("Path syntax error", *this));
222 }
223
224 template <typename String, typename Translator> inline
225 bool string_path<String, Translator>::empty() const

Callers 2

walk_pathMethod · 0.45

Calls 5

ptree_bad_pathClass · 0.70
emptyFunction · 0.50
findFunction · 0.50
endMethod · 0.45
get_valueMethod · 0.45

Tested by

no test coverage detected