boundary_point.hpp
//
// Copyright (c) 2009-2011 Artyom Beilis (Tonkikh)
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
#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
} // boundary
} // locale
} // boost
#endif
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
boost::locale::boundary::boundary_point::boundary_point
boundary_point(iterator_type p, rule_type r)
Definition: boundary_point.hpp:63
boost::locale::boundary::boundary_point::rule
void rule(rule_type r)
Definition: boundary_point.hpp:78
boost::locale::boundary::wcboundary_point
boundary_point< wchar_t const * > wcboundary_point
convenience typedef
Definition: boundary_point.hpp:167
boost::locale::boundary::boundary_point::rule
rule_type rule() const
Definition: boundary_point.hpp:92
boost::locale::boundary::u16cboundary_point
boundary_point< char16_t const * > u16cboundary_point
convenience typedef
Definition: boundary_point.hpp:169
boost::locale::boundary::rule_type
uint32_t rule_type
Flags used with word boundary analysis – the type of the word, line or sentence boundary found...
Definition: types.hpp:51
boost::locale::boundary::sboundary_point
boundary_point< std::string::const_iterator > sboundary_point
convenience typedef
Definition: boundary_point.hpp:157
boost::locale::boundary::boundary_point::operator==
bool operator==(iterator_type const &other) const
Definition: boundary_point.hpp:113
boost::locale::boundary::boundary_point::operator==
bool operator==(boundary_point const &other) const
Definition: boundary_point.hpp:99
boost::locale::boundary::operator==
bool operator==(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:142
boost::locale::boundary::u32sboundary_point
boundary_point< std::u32string::const_iterator > u32sboundary_point
convenience typedef
Definition: boundary_point.hpp:163
boost::locale::boundary::boundary_point::iterator
iterator_type iterator() const
Definition: boundary_point.hpp:85
boost::locale::boundary::wsboundary_point
boundary_point< std::wstring::const_iterator > wsboundary_point
convenience typedef
Definition: boundary_point.hpp:158
boost::locale::boundary::boundary_point::operator!=
bool operator!=(boundary_point const &other) const
Definition: boundary_point.hpp:106
boost::locale::boundary::boundary_point::boundary_point
boundary_point()
Definition: boundary_point.hpp:58
boost::locale::boundary::cboundary_point
boundary_point< char const * > cboundary_point
convenience typedef
Definition: boundary_point.hpp:166
boost::locale::boundary::boundary_point
This class represents a boundary point in the text.
Definition: boundary_point.hpp:48
boost::locale::boundary::boundary_point::iterator
void iterator(iterator_type i)
Definition: boundary_point.hpp:71
boost::locale::boundary::boundary_point::operator!=
bool operator!=(iterator_type const &other) const
Definition: boundary_point.hpp:120
boost::locale::boundary::u32cboundary_point
boundary_point< char32_t const * > u32cboundary_point
convenience typedef
Definition: boundary_point.hpp:172
boost::locale::boundary::boundary_point::iterator_type
IteratorType iterator_type
Definition: boundary_point.hpp:53
boost::locale::boundary::u16sboundary_point
boundary_point< std::u16string::const_iterator > u16sboundary_point
convenience typedef
Definition: boundary_point.hpp:160
boost::locale::boundary::operator!=
bool operator!=(BaseIterator const &l, boundary_point< BaseIterator > const &r)
Definition: boundary_point.hpp:150
- © Copyright 2009-2012 Artyom Beilis, Distributed under the Boost Software License, Version 1.0.