123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- #ifndef BOOST_LOCALE_BOUNDARY_BOUNDARY_POINT_HPP_INCLUDED
- #define BOOST_LOCALE_BOUNDARY_BOUNDARY_POINT_HPP_INCLUDED
- #include <boost/locale/boundary/types.hpp>
- namespace boost {
- namespace locale {
- namespace boundary {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- template<typename IteratorType>
- class boundary_point {
- public:
-
-
-
- typedef IteratorType iterator_type;
-
-
-
- boundary_point() : rule_(0) {}
-
-
-
-
- boundary_point(iterator_type p,rule_type r) :
- iterator_(p),
- rule_(r)
- {
- }
-
-
-
- void iterator(iterator_type i)
- {
- iterator_ = i;
- }
-
-
-
- void rule(rule_type r)
- {
- rule_ = r;
- }
-
-
-
- iterator_type iterator() const
- {
- return iterator_;
- }
-
-
-
- rule_type rule() const
- {
- return rule_;
- }
-
-
-
- bool operator==(boundary_point const &other) const
- {
- return iterator_ == other.iterator_ && rule_ = other.rule_;
- }
-
-
-
- bool operator!=(boundary_point const &other) const
- {
- return !(*this==other);
- }
-
-
-
- bool operator==(iterator_type const &other) const
- {
- return iterator_ == other;
- }
-
-
-
- bool operator!=(iterator_type const &other) const
- {
- return iterator_ != other;
- }
-
-
-
- operator iterator_type ()const
- {
- return iterator_;
- }
- private:
- iterator_type iterator_;
- rule_type rule_;
-
- };
-
-
-
- template<typename BaseIterator>
- bool operator==(BaseIterator const &l,boundary_point<BaseIterator> const &r)
- {
- return r==l;
- }
-
-
-
- template<typename BaseIterator>
- bool operator!=(BaseIterator const &l,boundary_point<BaseIterator> const &r)
- {
- return r!=l;
- }
-
-
- typedef boundary_point<std::string::const_iterator> sboundary_point;
- typedef boundary_point<std::wstring::const_iterator> wsboundary_point;
- #ifdef BOOST_LOCALE_ENABLE_CHAR16_T
- typedef boundary_point<std::u16string::const_iterator> u16sboundary_point;
- #endif
- #ifdef BOOST_LOCALE_ENABLE_CHAR32_T
- typedef boundary_point<std::u32string::const_iterator> u32sboundary_point;
- #endif
-
- typedef boundary_point<char const *> cboundary_point;
- typedef boundary_point<wchar_t const *> wcboundary_point;
- #ifdef BOOST_LOCALE_ENABLE_CHAR16_T
- typedef boundary_point<char16_t const *> u16cboundary_point;
- #endif
- #ifdef BOOST_LOCALE_ENABLE_CHAR32_T
- typedef boundary_point<char32_t const *> u32cboundary_point;
- #endif
-
- }
- }
- }
- #endif
|