10 #ifndef BOOST_PROPERTY_TREE_DETAIL_PTREE_UTILS_HPP_INCLUDED
11 #define BOOST_PROPERTY_TREE_DETAIL_PTREE_UTILS_HPP_INCLUDED
21 namespace boost {
namespace property_tree {
namespace detail
27 typedef typename T::value_type
Ch;
35 return std::lexicographical_compare(t1.begin(), t1.end(),
36 t2.begin(), t2.end(), *
this);
40 template <
typename Ch>
52 has_internal_type<T>, has_external_type<T> > {};
57 template<
typename Str>
63 result +=
typename Str::value_type(*text);
70 template<
typename Str,
typename char_type>
76 if (*text < 0 || *text > (std::numeric_limits<char>::max)())
79 result +=
typename Str::value_type(*text);
87 Str
trim(
const Str &s,
const std::locale &loc = std::locale())
89 typename Str::const_iterator first =
s.begin();
90 typename Str::const_iterator
end =
s.end();
91 while (first !=
end && std::isspace(*first, loc))
95 typename Str::const_iterator last =
end;
96 do --last;
while (std::isspace(*last, loc));
97 if (first !=
s.begin() || last + 1 !=
end)
98 return Str(first, last + 1);