| 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 |
no test coverage detected