123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- #ifndef BOOST_STRING_CLASSIFICATION_HPP
- #define BOOST_STRING_CLASSIFICATION_HPP
- #include <algorithm>
- #include <locale>
- #include <boost/range/value_type.hpp>
- #include <boost/range/as_literal.hpp>
- #include <boost/algorithm/string/detail/classification.hpp>
- #include <boost/algorithm/string/predicate_facade.hpp>
- namespace boost {
- namespace algorithm {
-
-
- inline detail::is_classifiedF
- is_classified(std::ctype_base::mask Type, const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(Type, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_space(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::space, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_alnum(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::alnum, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_alpha(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::alpha, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_cntrl(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::cntrl, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_digit(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::digit, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_graph(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::graph, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_lower(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::lower, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_print(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::print, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_punct(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::punct, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_upper(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::upper, Loc);
- }
-
-
- inline detail::is_classifiedF
- is_xdigit(const std::locale& Loc=std::locale())
- {
- return detail::is_classifiedF(std::ctype_base::xdigit, Loc);
- }
-
-
- template<typename RangeT>
- inline detail::is_any_ofF<
- BOOST_STRING_TYPENAME range_value<RangeT>::type>
- is_any_of( const RangeT& Set )
- {
- iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_set(boost::as_literal(Set));
- return detail::is_any_ofF<BOOST_STRING_TYPENAME range_value<RangeT>::type>(lit_set);
- }
-
-
- template<typename CharT>
- inline detail::is_from_rangeF<CharT> is_from_range(CharT From, CharT To)
- {
- return detail::is_from_rangeF<CharT>(From,To);
- }
-
-
-
-
- template<typename Pred1T, typename Pred2T>
- inline detail::pred_andF<Pred1T, Pred2T>
- operator&&(
- const predicate_facade<Pred1T>& Pred1,
- const predicate_facade<Pred2T>& Pred2 )
- {
-
-
-
- return detail::pred_andF<Pred1T,Pred2T>(
- *static_cast<const Pred1T*>(&Pred1),
- *static_cast<const Pred2T*>(&Pred2) );
- }
-
-
- template<typename Pred1T, typename Pred2T>
- inline detail::pred_orF<Pred1T, Pred2T>
- operator||(
- const predicate_facade<Pred1T>& Pred1,
- const predicate_facade<Pred2T>& Pred2 )
- {
-
-
-
- return detail::pred_orF<Pred1T,Pred2T>(
- *static_cast<const Pred1T*>(&Pred1),
- *static_cast<const Pred2T*>(&Pred2));
- }
-
-
- template<typename PredT>
- inline detail::pred_notF<PredT>
- operator!( const predicate_facade<PredT>& Pred )
- {
-
-
-
- return detail::pred_notF<PredT>(*static_cast<const PredT*>(&Pred));
- }
- }
-
- using algorithm::is_classified;
- using algorithm::is_space;
- using algorithm::is_alnum;
- using algorithm::is_alpha;
- using algorithm::is_cntrl;
- using algorithm::is_digit;
- using algorithm::is_graph;
- using algorithm::is_lower;
- using algorithm::is_upper;
- using algorithm::is_print;
- using algorithm::is_punct;
- using algorithm::is_xdigit;
- using algorithm::is_any_of;
- using algorithm::is_from_range;
- }
- #endif
|