static void call(std::string const& val, utree& attr) { if (attr.empty()) attr = val; else push_back(attr, val); }
static void call(binary_range_type const& val, utree& attr) { if (attr.empty()) attr = val; else push_back(attr, val); }
static void call (utf8_symbol_type const& val, utree& attr) { if (attr.empty()) attr = val; else push_back(attr, val); }
// any non-container type will be either directly assigned or appended static void call(Attribute const& val, utree& attr, mpl::false_) { if (attr.empty()) attr = val; else push_back(attr, val); }
static void call(Iterator const& first, Iterator const& last, utree& attr) { if (attr.empty()) attr.assign(first, last); else { for (Iterator i = first; i != last; ++i) push_back(attr, traits::deref(i)); } }
// any container type will be converted into a list_type utree static void call(Attribute const& val, utree& attr, mpl::true_) { typedef typename traits::container_iterator<Attribute const>::type iterator_type; // make sure the attribute is a list, at least an empty one if (attr.empty()) attr = empty_list; iterator_type end = traits::end(val); for (iterator_type i = traits::begin(val); i != end; traits::next(i)) push_back(attr, traits::deref(i)); }
static void call(utree const& val, utree& attr) { if (attr.empty()) { attr = val; } else if (detail::is_list(val)) { typedef utree::const_iterator iterator_type; iterator_type end = traits::end(val); for (iterator_type i = traits::begin(val); i != end; traits::next(i)) push_back(attr, traits::deref(i)); } else { push_back(attr, val); } }