File indexing completed on 2025-01-30 09:44:55
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_LOCALE_BOUNDARY_FACETS_HPP_INCLUDED
0008 #define BOOST_LOCALE_BOUNDARY_FACETS_HPP_INCLUDED
0009
0010 #include <boost/locale/boundary/types.hpp>
0011 #include <boost/locale/detail/facet_id.hpp>
0012 #include <boost/locale/detail/is_supported_char.hpp>
0013 #include <locale>
0014 #include <vector>
0015
0016 #ifdef BOOST_MSVC
0017 # pragma warning(push)
0018 # pragma warning(disable : 4275 4251 4231 4660)
0019 #endif
0020
0021 namespace boost { namespace locale {
0022
0023
0024 namespace boundary {
0025
0026
0027
0028
0029
0030
0031 struct break_info {
0032
0033 break_info() : offset(0), rule(0) {}
0034
0035
0036
0037 break_info(size_t v) : offset(v), rule(0) {}
0038
0039
0040 size_t offset;
0041
0042
0043 rule_type rule;
0044
0045
0046
0047 bool operator<(const break_info& other) const { return offset < other.offset; }
0048 };
0049
0050
0051
0052 typedef std::vector<break_info> index_type;
0053
0054
0055
0056
0057 template<typename Char>
0058 class BOOST_SYMBOL_VISIBLE boundary_indexing : public std::locale::facet,
0059 public boost::locale::detail::facet_id<boundary_indexing<Char>> {
0060 BOOST_LOCALE_ASSERT_IS_SUPPORTED(Char);
0061
0062 public:
0063
0064 boundary_indexing(size_t refs = 0) : std::locale::facet(refs) {}
0065
0066
0067
0068
0069
0070
0071 virtual index_type map(boundary_type t, const Char* begin, const Char* end) const = 0;
0072 };
0073
0074
0075 }
0076
0077 }}
0078
0079 #ifdef BOOST_MSVC
0080 # pragma warning(pop)
0081 #endif
0082
0083 #endif