## include/boost/regex/v5/unicode_iterator.hpp

87.8% Lines (288/328) 65.3% List of functions (205/315)
unicode_iterator.hpp
f(x) Functions (315)
Function Calls Lines Blocks
boost::detail::is_high_surrogate(unsigned short) :84 4576344x 100.0% 100.0% <unknown function 86> :86 – – – boost::detail::is_low_surrogate(unsigned short) :88 49122x 100.0% 100.0% bool boost::detail::is_surrogate<char16_t>(char16_t) :93 803640x 100.0% 100.0% bool boost::detail::is_surrogate<int>(int) :93 1253832x 100.0% 100.0% bool boost::detail::is_surrogate<unsigned int>(unsigned int) :93 92975x 100.0% 100.0% bool boost::detail::is_surrogate<unsigned short>(unsigned short) :93 1378550x 100.0% 100.0% boost::detail::utf8_byte_count(unsigned char) :98 4624073x 100.0% 100.0% boost::detail::utf8_trailing_byte_count(unsigned char) :112 1374005x 100.0% 100.0% boost::detail::invalid_utf32_code_point(unsigned int) :124 0 53.3% 0.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::operator*() const :157 573936x 100.0% 100.0% boost::u32_to_u16_iterator<int const*, char16_t>::operator*() const :157 401820x 100.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::operator==(boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short> const&) const :163 1267560x 100.0% 100.0% boost::u32_to_u16_iterator<int const*, char16_t>::operator==(boost::u32_to_u16_iterator<int const*, char16_t> const&) const :163 1605960x 100.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::operator!=(boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short> const&) const :173 1267560x 100.0% 100.0% boost::u32_to_u16_iterator<int const*, char16_t>::operator!=(boost::u32_to_u16_iterator<int const*, char16_t> const&) const :173 1605960x 100.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::operator++() :177 1147872x 100.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned short>::operator++() :177 6481914x 100.0% 100.0% boost::u32_to_u16_iterator<int const*, char16_t>::operator++() :177 803640x 100.0% 100.0% boost::u32_to_u16_iterator<unsigned int const*, unsigned short>::operator++() :177 4x 100.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::operator--() :202 0 0.0% 0.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned short>::operator--() :202 6481914x 92.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::u32_to_u16_iterator(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) :234 119688x 100.0% 100.0% boost::u32_to_u16_iterator<int const*, char16_t>::u32_to_u16_iterator(int const*) :234 802320x 100.0% 100.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned short>::extract_current() const :242 1147872x 50.0% 35.0% boost::u32_to_u16_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned short>::extract_current() const :242 7784441x 85.7% 71.0% boost::u32_to_u16_iterator<int const*, char16_t>::extract_current() const :242 803640x 50.0% 31.0% boost::u32_to_u16_iterator<unsigned int const*, unsigned short>::extract_current() const :242 6x 72.7% 57.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator*() const :291 427644x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator*() const :291 400404x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator*() const :291 50172x 100.0% 100.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::operator*() const :291 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::operator*() const :291 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::operator*() const :291 804671x 100.0% 100.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::operator*() const :291 75328x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator==(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int> const&) const :297 1028856x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator==(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int> const&) const :297 203316x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator==(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int> const&) const :297 864144x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator==(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int> const&) const :297 110460x 100.0% 100.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::operator==(boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int> const&) const :297 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::operator==(boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int> const&) const :297 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::operator==(boost::u16_to_u32_iterator<char16_t const*, int> const&) const :297 1838431x 100.0% 100.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::operator==(boost::u16_to_u32_iterator<char16_t const*, unsigned int> const&) const :297 370922x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator!=(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int> const&) const :301 687516x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator!=(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int> const&) const :301 203316x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator!=(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int> const&) const :301 864144x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator!=(boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int> const&) const :301 80376x 100.0% 100.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::operator!=(boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int> const&) const :301 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::operator!=(boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int> const&) const :301 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::operator!=(boost::u16_to_u32_iterator<char16_t const*, int> const&) const :301 1497527x 100.0% 100.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::operator!=(boost::u16_to_u32_iterator<char16_t const*, unsigned int> const&) const :301 340817x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator++() :305 528756x 100.0% 86.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator++() :305 146916x 100.0% 86.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator++() :305 800808x 100.0% 86.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator++() :305 32388x 100.0% 86.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::operator++() :305 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::operator++() :305 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::operator++() :305 1283296x 100.0% 80.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::operator++() :305 229418x 100.0% 80.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::operator--() :319 24504x 83.3% 86.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::operator--() :319 48x 83.3% 86.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::operator--() :319 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::operator--() :319 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::operator--() :319 24522x 83.3% 80.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::operator--() :319 48x 83.3% 80.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::base() const :334 116124x 100.0% 100.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::base() const :334 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::base() const :334 115234x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::u16_to_u32_iterator() :339 468840x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::u16_to_u32_iterator() :339 23496x 100.0% 100.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::u16_to_u32_iterator() :339 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::u16_to_u32_iterator() :339 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::u16_to_u32_iterator() :339 467361x 100.0% 100.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::u16_to_u32_iterator() :339 23525x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::u16_to_u32_iterator(__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >) :343 24504x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::u16_to_u32_iterator(__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >) :343 112800x 100.0% 100.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::u16_to_u32_iterator(boost::bidirectional_iterator_archetype<char16_t>) :343 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::u16_to_u32_iterator(char16_t const*) :343 24301x 100.0% 100.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::u16_to_u32_iterator(char16_t const*) :343 112080x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::u16_to_u32_iterator(__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, __gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, __gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >) :350 49008x 64.3% 58.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::u16_to_u32_iterator(__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, __gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, __gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >) :350 63336x 64.3% 58.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::u16_to_u32_iterator(__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, __gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, __gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >) :350 3672x 64.3% 58.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned short const*, std::vector<unsigned short, std::allocator<unsigned short> > >, unsigned int>::u16_to_u32_iterator(__gnu_cxx::__normal_iterator<unsigned short const*, std::vector<unsigned short, std::allocator<unsigned short> > >, __gnu_cxx::__normal_iterator<unsigned short const*, std::vector<unsigned short, std::allocator<unsigned short> > >, __gnu_cxx::__normal_iterator<unsigned short const*, std::vector<unsigned short, std::allocator<unsigned short> > >) :350 1112073x 64.3% 58.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::u16_to_u32_iterator(boost::bidirectional_iterator_archetype<char16_t>, boost::bidirectional_iterator_archetype<char16_t>, boost::bidirectional_iterator_archetype<char16_t>) :350 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::u16_to_u32_iterator(boost::bidirectional_iterator_archetype<char16_t>, boost::bidirectional_iterator_archetype<char16_t>, boost::bidirectional_iterator_archetype<char16_t>) :350 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::u16_to_u32_iterator(char16_t const*, char16_t const*, char16_t const*) :350 104602x 64.3% 48.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::u16_to_u32_iterator(char16_t const*, char16_t const*, char16_t const*) :350 11020x 64.3% 48.0% boost::u16_to_u32_iterator<unsigned short const*, unsigned int>::u16_to_u32_iterator(unsigned short const*, unsigned short const*, unsigned short const*) :350 10x 100.0% 100.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned short const*, std::vector<unsigned short, std::allocator<unsigned short> > >, unsigned int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::invalid_code_point(unsigned short) :376 0 0.0% 0.0% boost::u16_to_u32_iterator<unsigned short const*, unsigned int>::invalid_code_point(unsigned short) :376 6x 100.0% 88.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t const*, std::vector<char16_t, std::allocator<char16_t> > >, int>::extract_current() const :387 238104x 41.7% 57.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, int>::extract_current() const :387 400404x 41.7% 57.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<char16_t*, std::vector<char16_t, std::allocator<char16_t> > >, unsigned int>::extract_current() const :387 22548x 41.7% 57.0% boost::u16_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned short const*, std::vector<unsigned short, std::allocator<unsigned short> > >, unsigned int>::extract_current() const :387 4448252x 81.8% 71.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, int>::extract_current() const :387 0 0.0% 0.0% boost::u16_to_u32_iterator<boost::bidirectional_iterator_archetype<char16_t>, unsigned int>::extract_current() const :387 0 0.0% 0.0% boost::u16_to_u32_iterator<char16_t const*, int>::extract_current() const :387 615324x 41.7% 56.0% boost::u16_to_u32_iterator<char16_t const*, unsigned int>::extract_current() const :387 47704x 41.7% 56.0% boost::u16_to_u32_iterator<unsigned short const*, unsigned int>::extract_current() const :387 6x 93.3% 71.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::operator*() const :424 576648x 100.0% 100.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::operator==(boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char> const&) const :430 1272984x 100.0% 78.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::operator!=(boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char> const&) const :441 1272984x 100.0% 100.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::operator++() :445 1153296x 100.0% 100.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned char>::operator++() :445 13147764x 100.0% 100.0% boost::u32_to_u8_iterator<unsigned int const*, unsigned char>::operator++() :445 20x 100.0% 100.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::operator--() :470 0 0.0% 0.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned char>::operator--() :470 17530352x 100.0% 100.0% boost::u32_to_u8_iterator<unsigned int const*, unsigned char>::operator--() :470 20x 100.0% 100.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::u32_to_u8_iterator(__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >) :503 119688x 100.0% 100.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<int const*, std::vector<int, std::allocator<int> > >, unsigned char>::extract_current() const :513 1147872x 80.0% 82.0% boost::u32_to_u8_iterator<__gnu_cxx::__normal_iterator<unsigned int const*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned char>::extract_current() const :513 7784441x 96.0% 90.0% boost::u32_to_u8_iterator<unsigned int const*, unsigned char>::extract_current() const :513 24x 96.6% 90.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::operator*() const :571 1200x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::operator*() const :571 50172x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::operator*() const :571 23184x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::operator*() const :571 50172x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator*() const :571 427644x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator*() const :571 377220x 100.0% 100.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::operator*() const :571 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::operator*() const :571 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::operator*() const :571 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::operator*() const :571 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::operator*() const :571 303x 100.0% 100.0% boost::u8_to_u32_iterator<char const*, unsigned int>::operator*() const :571 25104x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, int>::operator*() const :571 804384x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::operator*() const :571 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int> const&) const :577 2451x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int> const&) const :577 110460x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int> const&) const :577 53712x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int> const&) const :577 110460x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int> const&) const :577 1028856x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int> const&) const :577 201120x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator==(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int> const&) const :577 810432x 100.0% 100.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::operator==(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int> const&) const :577 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::operator==(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int> const&) const :577 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::operator==(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int> const&) const :577 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::operator==(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int> const&) const :577 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::operator==(boost::u8_to_u32_iterator<char const*, int> const&) const :577 616x 100.0% 100.0% boost::u8_to_u32_iterator<char const*, unsigned int>::operator==(boost::u8_to_u32_iterator<char const*, unsigned int> const&) const :577 57552x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, int>::operator==(boost::u8_to_u32_iterator<unsigned char const*, int> const&) const :577 1838052x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::operator==(boost::u8_to_u32_iterator<unsigned char const*, unsigned int> const&) const :577 200580x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int> const&) const :581 1519x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int> const&) const :581 80376x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int> const&) const :581 53712x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int> const&) const :581 80376x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int> const&) const :581 687516x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int> const&) const :581 201120x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator!=(boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int> const&) const :581 810432x 100.0% 100.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::operator!=(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int> const&) const :581 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::operator!=(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int> const&) const :581 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::operator!=(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int> const&) const :581 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::operator!=(boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int> const&) const :581 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::operator!=(boost::u8_to_u32_iterator<char const*, int> const&) const :581 616x 100.0% 100.0% boost::u8_to_u32_iterator<char const*, unsigned int>::operator!=(boost::u8_to_u32_iterator<char const*, unsigned int> const&) const :581 57552x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, int>::operator!=(boost::u8_to_u32_iterator<unsigned char const*, int> const&) const :581 1497264x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::operator!=(boost::u8_to_u32_iterator<unsigned char const*, unsigned int> const&) const :581 200580x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::operator++() :585 1076x 83.3% 79.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::operator++() :585 32388x 83.3% 79.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::operator++() :585 46368x 83.3% 79.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::operator++() :585 32388x 83.3% 79.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator++() :585 528756x 83.3% 88.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::operator++() :585 4593404x 83.3% 87.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator++() :585 754440x 83.3% 88.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::operator++() :585 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::operator++() :585 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::operator++() :585 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::operator++() :585 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::operator++() :585 606x 83.3% 82.0% boost::u8_to_u32_iterator<char const*, unsigned int>::operator++() :585 50208x 83.3% 82.0% boost::u8_to_u32_iterator<unsigned char const*, int>::operator++() :585 1282992x 83.3% 88.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::operator++() :585 144988x 83.3% 59.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::operator--() :616 29x 85.7% 82.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::operator--() :616 48x 85.7% 82.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::operator--() :616 48x 85.7% 82.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::operator--() :616 24504x 85.7% 91.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::operator--() :616 4448252x 83.3% 89.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, unsigned int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<unsigned char const*, int>::operator--() :616 24504x 85.7% 88.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::operator--() :616 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::base() const :633 296x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::base() const :633 116124x 100.0% 100.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::base() const :633 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::base() const :633 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::base() const :633 0 0.0% 0.0% boost::u8_to_u32_iterator<unsigned char const*, int>::base() const :633 115224x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::u8_to_u32_iterator() :638 766x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::u8_to_u32_iterator() :638 23496x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::u8_to_u32_iterator() :638 23496x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::u8_to_u32_iterator() :638 468840x 100.0% 100.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::u8_to_u32_iterator() :638 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::u8_to_u32_iterator() :638 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::u8_to_u32_iterator() :638 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::u8_to_u32_iterator() :638 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::u8_to_u32_iterator() :638 0 0.0% 0.0% boost::u8_to_u32_iterator<unsigned char const*, int>::u8_to_u32_iterator() :638 467328x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) :642 6x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >) :642 24504x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >) :642 111936x 100.0% 100.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::u8_to_u32_iterator(boost::bidirectional_iterator_archetype<char>) :642 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::u8_to_u32_iterator(boost::bidirectional_iterator_archetype<unsigned char>) :642 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::u8_to_u32_iterator(char const*) :642 0 0.0% 0.0% boost::u8_to_u32_iterator<unsigned char const*, int>::u8_to_u32_iterator(unsigned char const*) :642 24300x 100.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::u8_to_u32_iterator(unsigned char const*) :642 111216x 100.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) :649 48x 80.0% 81.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >) :649 3672x 80.0% 81.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >) :649 7344x 80.0% 81.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >) :649 3672x 80.0% 81.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >) :649 49008x 80.0% 83.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >) :649 1112073x 78.6% 79.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::u8_to_u32_iterator(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >) :649 55992x 80.0% 81.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::u8_to_u32_iterator(boost::bidirectional_iterator_archetype<char>, boost::bidirectional_iterator_archetype<char>, boost::bidirectional_iterator_archetype<char>) :649 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::u8_to_u32_iterator(boost::bidirectional_iterator_archetype<char>, boost::bidirectional_iterator_archetype<char>, boost::bidirectional_iterator_archetype<char>) :649 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::u8_to_u32_iterator(boost::bidirectional_iterator_archetype<unsigned char>, boost::bidirectional_iterator_archetype<unsigned char>, boost::bidirectional_iterator_archetype<unsigned char>) :649 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::u8_to_u32_iterator(boost::bidirectional_iterator_archetype<unsigned char>, boost::bidirectional_iterator_archetype<unsigned char>, boost::bidirectional_iterator_archetype<unsigned char>) :649 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::u8_to_u32_iterator(char const*, char const*, char const*) :649 10x 80.0% 80.0% boost::u8_to_u32_iterator<char const*, unsigned int>::u8_to_u32_iterator(char const*, char const*, char const*) :649 7408x 80.0% 80.0% boost::u8_to_u32_iterator<unsigned char const*, int>::u8_to_u32_iterator(unsigned char const*, unsigned char const*, unsigned char const*) :649 104592x 80.0% 80.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::u8_to_u32_iterator(unsigned char const*, unsigned char const*, unsigned char const*) :649 22x 93.3% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, unsigned int>::invalid_sequence() :676 32x 80.0% 100.0% boost::u8_to_u32_iterator<unsigned char const*, int>::invalid_sequence() :676 0 0.0% 0.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::invalid_sequence() :676 14x 80.0% 100.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, int>::extract_current() const :685 741x 75.0% 74.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, unsigned int>::extract_current() const :685 22548x 55.0% 48.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, int>::extract_current() const :685 23184x 55.0% 48.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<char*, std::vector<char, std::allocator<char> > >, unsigned int>::extract_current() const :685 22548x 55.0% 48.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::extract_current() const :685 238104x 75.0% 78.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char const*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned int>::extract_current() const :685 4448252x 72.2% 72.0% boost::u8_to_u32_iterator<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, int>::extract_current() const :685 377220x 75.0% 74.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, int>::extract_current() const :685 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<char>, unsigned int>::extract_current() const :685 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, int>::extract_current() const :685 0 0.0% 0.0% boost::u8_to_u32_iterator<boost::bidirectional_iterator_archetype<unsigned char>, unsigned int>::extract_current() const :685 0 0.0% 0.0% boost::u8_to_u32_iterator<char const*, int>::extract_current() const :685 303x 55.0% 47.0% boost::u8_to_u32_iterator<char const*, unsigned int>::extract_current() const :685 25136x 85.0% 83.0% boost::u8_to_u32_iterator<unsigned char const*, int>::extract_current() const :685 615120x 75.0% 71.0% boost::u8_to_u32_iterator<unsigned char const*, unsigned int>::extract_current() const :685 20x 75.0% 78.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::utf16_output_iterator(boost::output_iterator_archetype<char16_t> const&) :738 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::utf16_output_iterator(boost::re_detail_600::unicode_string_out_iterator const&) :738 1837x 100.0% 100.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::utf16_output_iterator(unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > const&) :738 1836x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::utf16_output_iterator(boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> > const&) :740 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::utf16_output_iterator(boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator> const&) :740 36165x 100.0% 100.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::utf16_output_iterator(boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > > const&) :740 36144x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::operator=(boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> > const&) :742 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::operator=(boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator> const&) :742 5895x 100.0% 100.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::operator=(boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > > const&) :742 5892x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::operator*() const :747 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::operator*() const :747 11371x 100.0% 100.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::operator*() const :747 11352x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::operator=(unsigned int) const :751 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::operator=(unsigned int) const :751 11371x 100.0% 100.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::operator=(unsigned int) const :751 11352x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::operator++() :755 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::operator++() :755 11371x 100.0% 100.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::operator++() :755 11352x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::base() const :763 0 0.0% 0.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::base() const :763 1836x 100.0% 100.0% boost::utf16_output_iterator<boost::output_iterator_archetype<char16_t> >::push(unsigned int) const :768 0 0.0% 0.0% boost::utf16_output_iterator<boost::re_detail_600::unicode_string_out_iterator>::push(unsigned int) const :768 11371x 50.0% 44.0% boost::utf16_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char16_t, std::allocator<char16_t> > > >::push(unsigned int) const :768 11352x 50.0% 44.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::utf8_output_iterator(boost::output_iterator_archetype<char> const&) :801 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::utf8_output_iterator(boost::output_iterator_archetype<unsigned char> const&) :801 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::utf8_output_iterator(boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&) :801 1836x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::utf8_output_iterator(unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > const&) :801 1836x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::utf8_output_iterator(boost::utf8_output_iterator<boost::output_iterator_archetype<char> > const&) :803 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::utf8_output_iterator(boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> > const&) :803 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::utf8_output_iterator(boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) :803 36144x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::utf8_output_iterator(boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > > const&) :803 36144x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::operator=(boost::utf8_output_iterator<boost::output_iterator_archetype<char> > const&) :805 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::operator=(boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> > const&) :805 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator=(boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) :805 5892x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::operator=(boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > > const&) :805 5892x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::operator*() const :810 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::operator*() const :810 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator*() const :810 11352x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::operator*() const :810 11352x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::operator=(unsigned int) const :814 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::operator=(unsigned int) const :814 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator=(unsigned int) const :814 11352x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::operator=(unsigned int) const :814 11352x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::operator++() :818 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::operator++() :818 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::operator++() :818 11352x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::operator++() :818 11352x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::base() const :826 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::base() const :826 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::base() const :826 1836x 100.0% 100.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::base() const :826 1836x 100.0% 100.0% boost::utf8_output_iterator<boost::output_iterator_archetype<char> >::push(unsigned int) const :831 0 0.0% 0.0% boost::utf8_output_iterator<boost::output_iterator_archetype<unsigned char> >::push(unsigned int) const :831 0 0.0% 0.0% boost::utf8_output_iterator<boost::re_detail_600::string_out_iterator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::push(unsigned int) const :831 11352x 29.4% 17.0% boost::utf8_output_iterator<unnecessary_fix::back_insert_iterator<std::vector<char, std::allocator<char> > > >::push(unsigned int) const :831 11352x 29.4% 18.0%

Line | TLA | Hits | Source Code
--- | --- | --- | ---
1 |  |  | /*
2 |  |  | *
3 |  |  | * Copyright (c) 2004
4 |  |  | * John Maddock
5 |  |  | *
6 |  |  | * Use, modification and distribution are subject to the
7 |  |  | * Boost Software License, Version 1.0. (See accompanying file
8 |  |  | * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 |  |  | *
10 |  |  | */
11 |  |  |
12 |  |  | /*
13 |  |  | * LOCATION: see http://www.boost.org for most recent version.
14 |  |  | * FILE unicode_iterator.hpp
15 |  |  | * VERSION see <boost/version.hpp>
16 |  |  | * DESCRIPTION: Iterator adapters for converting between different Unicode encodings.
17 |  |  | */
18 |  |  |
19 |  |  | /****************************************************************************
20 |  |  |
21 |  |  | Contents:
22 |  |  | ~~~~~~~~~
23 |  |  |
24 |  |  | 1) Read Only, Input Adapters:
25 |  |  | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 |  |  |
27 |  |  | template <class BaseIterator, class U8Type = std::uint8_t>
28 |  |  | class u32_to_u8_iterator;
29 |  |  |
30 |  |  | Adapts sequence of UTF-32 code points to "look like" a sequence of UTF-8.
31 |  |  |
32 |  |  | template <class BaseIterator, class U32Type = std::uint32_t>
33 |  |  | class u8_to_u32_iterator;
34 |  |  |
35 |  |  | Adapts sequence of UTF-8 code points to "look like" a sequence of UTF-32.
36 |  |  |
37 |  |  | template <class BaseIterator, class U16Type = std::uint16_t>
38 |  |  | class u32_to_u16_iterator;
39 |  |  |
40 |  |  | Adapts sequence of UTF-32 code points to "look like" a sequence of UTF-16.
41 |  |  |
42 |  |  | template <class BaseIterator, class U32Type = std::uint32_t>
43 |  |  | class u16_to_u32_iterator;
44 |  |  |
45 |  |  | Adapts sequence of UTF-16 code points to "look like" a sequence of UTF-32.
46 |  |  |
47 |  |  | 2) Single pass output iterator adapters:
48 |  |  |
49 |  |  | template <class BaseIterator>
50 |  |  | class utf8_output_iterator;
51 |  |  |
52 |  |  | Accepts UTF-32 code points and forwards them on as UTF-8 code points.
53 |  |  |
54 |  |  | template <class BaseIterator>
55 |  |  | class utf16_output_iterator;
56 |  |  |
57 |  |  | Accepts UTF-32 code points and forwards them on as UTF-16 code points.
58 |  |  |
59 |  |  | ****************************************************************************/
60 |  |  |
61 |  |  | #ifndef BOOST_REGEX_UNICODE_ITERATOR_HPP
62 |  |  | #define BOOST_REGEX_UNICODE_ITERATOR_HPP
63 |  |  | #include <boost/regex/config.hpp>
64 |  |  | #ifndef BOOST_REGEX_AS_MODULE
65 |  |  | #include <cstdint>
66 |  |  | #include <stdexcept>
67 |  |  | #include <sstream>
68 |  |  | #include <ios>
69 |  |  | #include <limits.h> // CHAR_BIT
70 |  |  | #endif
71 |  |  |
72 |  |  | #ifndef BOOST_REGEX_STANDALONE
73 |  |  | #include <boost/throw_exception.hpp>
74 |  |  | #endif
75 |  |  |
76 |  |  | namespace boost{
77 |  |  |
78 |  |  | namespace detail{
79 |  |  |
80 |  |  | BOOST_REGEX_STATIC_CONST std::uint16_t high_surrogate_base = 0xD7C0u;
81 |  |  | BOOST_REGEX_STATIC_CONST std::uint16_t low_surrogate_base = 0xDC00u;
82 |  |  | BOOST_REGEX_STATIC_CONST std::uint32_t ten_bit_mask = 0x3FFu;
83 |  |  |
84 |  | 4576344x | inline bool is_high_surrogate(std::uint16_t v)
85 |  |  | {
86 |  | 14584939x | return (v & 0xFFFFFC00u) == 0xd800u;
87 |  |  | }
88 |  | 49122x | inline bool is_low_surrogate(std::uint16_t v)
89 |  |  | {
90 |  | 4497374x | return (v & 0xFFFFFC00u) == 0xdc00u;
91 |  |  | }
92 |  |  | template <class T>
93 |  | 3528997x | inline bool is_surrogate(T v)
94 |  |  | {
95 |  | 9533754x | return (v & 0xFFFFF800u) == 0xd800;
96 |  |  | }
97 |  |  |
98 |  | 4624073x | inline unsigned utf8_byte_count(std::uint8_t c)
99 |  |  | {
100 |  |  | // if the most significant bit with a zero in it is in position
101 |  |  | // 8-N then there are N bytes in this UTF-8 sequence:
102 |  | 4624073x | std::uint8_t mask = 0x80u;
103 |  | 4624073x | unsigned result = 0;
104 |  | 76156114x | while(c & mask)
105 |  |  | {
106 |  | 57075062x | ++result;
107 |  | 57075062x | mask >>= 1;
108 |  |  | }
109 |  | 19081052x | return (result == 0) ? 1 : ((result > 4) ? 4 : result);
110 |  |  | }
111 |  |  |
112 |  | 1374005x | inline unsigned utf8_trailing_byte_count(std::uint8_t c)
113 |  |  | {
114 |  | 10270561x | return utf8_byte_count(c) - 1;
115 |  |  | }
116 |  |  |
117 |  |  | #ifdef BOOST_REGEX_MSVC
118 |  |  | #pragma warning(push)
119 |  |  | #pragma warning(disable:4100)
120 |  |  | #endif
121 |  |  | #ifndef BOOST_NO_EXCEPTIONS
122 |  |  | BOOST_REGEX_NORETURN
123 |  |  | #endif
124 |  | ✗ | inline void invalid_utf32_code_point(std::uint32_t val)
125 |  |  | {
126 |  | ✗ | std::stringstream ss;
127 |  | ✗ | ss << "Invalid UTF-32 code point U+" << std::showbase << std::hex << val << " encountered while trying to encode UTF-16 sequence";
128 |  | ✗ | std::out_of_range e(ss.str());
129 |  |  | #ifndef BOOST_REGEX_STANDALONE
130 |  | ✗ | boost::throw_exception(e);
131 |  |  | #else
132 |  | ✗ | throw e;
133 |  |  | #endif
134 |  | ✗ | }
135 |  |  | #ifdef BOOST_REGEX_MSVC
136 |  |  | #pragma warning(pop)
137 |  |  | #endif
138 |  |  |
139 |  |  |
140 |  |  | } // namespace detail
141 |  |  |
142 |  |  | template <class BaseIterator, class U16Type = std::uint16_t>
143 |  |  | class u32_to_u16_iterator
144 |  |  | {
145 |  |  | typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
146 |  |  |
147 |  |  | static_assert(sizeof(base_value_type)*CHAR_BIT == 32, "Incorrectly sized template argument");
148 |  |  | static_assert(sizeof(U16Type)*CHAR_BIT == 16, "Incorrectly sized template argument");
149 |  |  |
150 |  |  | public:
151 |  |  | typedef std::ptrdiff_t difference_type;
152 |  |  | typedef U16Type value_type;
153 |  |  | typedef value_type const* pointer;
154 |  |  | typedef value_type const reference;
155 |  |  | typedef std::bidirectional_iterator_tag iterator_category;
156 |  |  |
157 |  | 975756x | reference operator*()const
158 |  |  | {
159 |  | 5297038x | if(m_current == 2)
160 |  | 2087821x | extract_current();
161 |  | 3136402x | return m_values[m_current];
162 |  |  | }
163 |  | 2873520x | bool operator==(const u32_to_u16_iterator& that)const
164 |  |  | {
165 |  | 15837354x | if(m_position == that.m_position)
166 |  |  | {
167 |  |  | // Both m_currents must be equal, or both even
168 |  |  | // this is the same as saying their sum must be even:
169 |  | 922014x | return (m_current + that.m_current) & 1u ? false : true;
170 |  |  | }
171 |  | 1951512x | return false;
172 |  |  | }
173 |  | 2873520x | bool operator!=(const u32_to_u16_iterator& that)const
174 |  |  | {
175 |  | 2873520x | return !(*this == that);
176 |  |  | }
177 |  | 8433430x | u32_to_u16_iterator& operator++()
178 |  |  | {
179 |  |  | // if we have a pending read then read now, so that we know whether
180 |  |  | // to skip a position, or move to a low-surrogate:
181 |  | 8433430x | if(m_current == 2)
182 |  |  | {
183 |  |  | // pending read:
184 |  | 3199884x | extract_current();
185 |  |  | }
186 |  |  | // move to the next surrogate position:
187 |  | 8433430x | ++m_current;
188 |  |  | // if we've reached the end skip a position:
189 |  | 8433430x | if(m_values[m_current] == 0)
190 |  |  | {
191 |  | 5287703x | m_current = 2;
192 |  | 1951514x | ++m_position;
193 |  |  | }
194 |  | 8433430x | return *this;
195 |  |  | }
196 |  |  | u32_to_u16_iterator operator++(int)
197 |  |  | {
198 |  | 4x | u32_to_u16_iterator r(*this);
199 |  | 2x | ++(*this);
200 |  | 4x | return r;
201 |  |  | }
202 |  | 6481914x | u32_to_u16_iterator& operator--()
203 |  |  | {
204 |  | 8642556x | if(m_current != 1)
205 |  |  | {
206 |  |  | // decrementing an iterator always leads to a valid position:
207 |  | 2x | --m_position;
208 |  | 4448254x | extract_current();
209 |  | 4702206x | m_current = m_values[1] ? 1 : 0;
210 |  |  | }
211 |  |  | else
212 |  |  | {
213 |  | 4194302x | m_current = 0;
214 |  |  | }
215 |  | 6481914x | return *this;
216 |  |  | }
217 |  |  | u32_to_u16_iterator operator--(int)
218 |  |  | {
219 |  |  | u32_to_u16_iterator r(*this);
220 |  |  | --(*this);
221 |  |  | return r;
222 |  |  | }
223 |  |  | BaseIterator base()const
224 |  |  | {
225 |  |  | return m_position;
226 |  |  | }
227 |  |  | // construct:
228 |  |  | u32_to_u16_iterator() : m_position(), m_current(0)
229 |  |  | {
230 |  |  | m_values[0] = 0;
231 |  |  | m_values[1] = 0;
232 |  |  | m_values[2] = 0;
233 |  |  | }
234 |  | 922010x | u32_to_u16_iterator(BaseIterator b) : m_position(b), m_current(2)
235 |  |  | {
236 |  | 922010x | m_values[0] = 0;
237 |  | 922010x | m_values[1] = 0;
238 |  | 922010x | m_values[2] = 0;
239 |  | 922008x | }
240 |  |  | private:
241 |  |  |
242 |  | 9735959x | void extract_current()const
243 |  |  | {
244 |  |  | // begin by checking for a code point out of range:
245 |  | 9735959x | std::uint32_t v = *m_position;
246 |  | 9735959x | if(v >= 0x10000u)
247 |  |  | {
248 |  | 7340031x | if(v > 0x10FFFFu)
249 |  | ✗ | detail::invalid_utf32_code_point(*m_position);
250 |  |  | // split into two surrogates:
251 |  | 7340031x | m_values[0] = static_cast<U16Type>(v >> 10) + detail::high_surrogate_base;
252 |  | 7340031x | m_values[1] = static_cast<U16Type>(v & detail::ten_bit_mask) + detail::low_surrogate_base;
253 |  | 7340031x | m_current = 0;
254 |  | ✗ | BOOST_REGEX_ASSERT(detail::is_high_surrogate(m_values[0]));
255 |  | ✗ | BOOST_REGEX_ASSERT(detail::is_low_surrogate(m_values[1]));
256 |  |  | }
257 |  |  | else
258 |  |  | {
259 |  |  | // 16-bit code point:
260 |  | 2395928x | m_values[0] = static_cast<U16Type>(*m_position);
261 |  | 2395928x | m_values[1] = 0;
262 |  | 2395928x | m_current = 0;
263 |  |  | // value must not be a surrogate:
264 |  | 2395928x | if(detail::is_surrogate(m_values[0]))
265 |  | ✗ | detail::invalid_utf32_code_point(*m_position);
266 |  |  | }
267 |  | 9735959x | }
268 |  |  | BaseIterator m_position;
269 |  |  | mutable U16Type m_values[3];
270 |  |  | mutable unsigned m_current;
271 |  |  | };
272 |  |  |
273 |  |  | template <class BaseIterator, class U32Type = std::uint32_t>
274 |  |  | class u16_to_u32_iterator
275 |  |  | {
276 |  |  | // special values for pending iterator reads:
277 |  |  | static const U32Type pending_read = 0xffffffffu;
278 |  |  |
279 |  |  | typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
280 |  |  |
281 |  |  | static_assert(sizeof(base_value_type)*CHAR_BIT == 16, "Incorrectly sized template argument");
282 |  |  | static_assert(sizeof(U32Type)*CHAR_BIT == 32, "Incorrectly sized template argument");
283 |  |  |
284 |  |  | public:
285 |  |  | typedef std::ptrdiff_t difference_type;
286 |  |  | typedef U32Type value_type;
287 |  |  | typedef value_type const* pointer;
288 |  |  | typedef value_type const reference;
289 |  |  | typedef std::bidirectional_iterator_tag iterator_category;
290 |  |  |
291 |  | 1758219x | reference operator*()const
292 |  |  | {
293 |  | 3982351x | if(m_value == pending_read)
294 |  | 4660279x | extract_current();
295 |  | 5094414x | return m_value;
296 |  |  | }
297 |  | 4416129x | bool operator==(const u16_to_u32_iterator& that)const
298 |  |  | {
299 |  | 4416137x | return m_position == that.m_position;
300 |  |  | }
301 |  | 3673696x | bool operator!=(const u16_to_u32_iterator& that)const
302 |  |  | {
303 |  | 3673696x | return !(*this == that);
304 |  |  | }
305 |  | 3021582x | u16_to_u32_iterator& operator++()
306 |  |  | {
307 |  |  | // skip high surrogate first if there is one:
308 |  | 7469840x | if(detail::is_high_surrogate(*m_position)) ++m_position;
309 |  | 3021588x | ++m_position;
310 |  | 3021585x | m_value = pending_read;
311 |  | 5245714x | return *this;
312 |  |  | }
313 |  |  | u16_to_u32_iterator operator++(int)
314 |  |  | {
315 |  |  | u16_to_u32_iterator r(*this);
316 |  |  | ++(*this);
317 |  |  | return r;
318 |  |  | }
319 |  | 49122x | u16_to_u32_iterator& operator--()
320 |  |  | {
321 |  | 49122x | --m_position;
322 |  |  | // if we have a low surrogate then go back one more:
323 |  | 4497374x | if(detail::is_low_surrogate(*m_position))
324 |  | ✗ | --m_position;
325 |  | 2273248x | m_value = pending_read;
326 |  | 49122x | return *this;
327 |  |  | }
328 |  |  | u16_to_u32_iterator operator--(int)
329 |  |  | {
330 |  |  | u16_to_u32_iterator r(*this);
331 |  |  | --(*this);
332 |  |  | return r;
333 |  |  | }
334 |  | 231358x | BaseIterator base()const
335 |  |  | {
336 |  | 231358x | return m_position;
337 |  |  | }
338 |  |  | // construct:
339 |  | 983222x | u16_to_u32_iterator() : m_position()
340 |  |  | {
341 |  | 983222x | m_value = pending_read;
342 |  | 983222x | }
343 |  | 273685x | u16_to_u32_iterator(BaseIterator b) : m_position(b)
344 |  |  | {
345 |  | 273685x | m_value = pending_read;
346 |  | 273685x | }
347 |  |  | //
348 |  |  | // Range checked version:
349 |  |  | //
350 |  | 1343721x | u16_to_u32_iterator(BaseIterator b, BaseIterator start, BaseIterator end) : m_position(b)
351 |  |  | {
352 |  | 1343721x | m_value = pending_read;
353 |  |  | //
354 |  |  | // The range must not start with a low surrogate, or end in a high surrogate,
355 |  |  | // otherwise we run the risk of running outside the underlying input range.
356 |  |  | // Likewise b must not be located at a low surrogate.
357 |  |  | //
358 |  |  | std::uint16_t val;
359 |  | 1343721x | if(start != end)
360 |  |  | {
361 |  | 1342761x | if((b != start) && (b != end))
362 |  |  | {
363 |  | 2x | val = *b;
364 |  | 2x | if(detail::is_surrogate(val) && ((val & 0xFC00u) == 0xDC00u))
365 |  | 2x | invalid_code_point(val);
366 |  |  | }
367 |  | 1342759x | val = *start;
368 |  | 1342759x | if(detail::is_surrogate(val) && ((val & 0xFC00u) == 0xDC00u))
369 |  | 2x | invalid_code_point(val);
370 |  | 1342757x | val = *--end;
371 |  | 1342757x | if(detail::is_high_surrogate(val))
372 |  | 2x | invalid_code_point(val);
373 |  |  | }
374 |  | 1343715x | }
375 |  |  | private:
376 |  | 6x | static void invalid_code_point(std::uint16_t val)
377 |  |  | {
378 |  | 6x | std::stringstream ss;
379 |  | 6x | ss << "Misplaced UTF-16 surrogate U+" << std::showbase << std::hex << val << " encountered while trying to encode UTF-32 sequence";
380 |  | 6x | std::out_of_range e(ss.str());
381 |  |  | #ifndef BOOST_REGEX_STANDALONE
382 |  | 6x | boost::throw_exception(e);
383 |  |  | #else
384 |  | ✗ | throw e;
385 |  |  | #endif
386 |  | 12x | }
387 |  | 5772342x | void extract_current()const
388 |  |  | {
389 |  | 5772342x | m_value = static_cast<U32Type>(static_cast< std::uint16_t>(*m_position));
390 |  |  | // if the last value is a high surrogate then adjust m_position and m_value as needed:
391 |  | 5772342x | if(detail::is_high_surrogate(*m_position))
392 |  |  | {
393 |  |  | // precondition; next value must have be a low-surrogate:
394 |  | ✗ | BaseIterator next(m_position);
395 |  | 4194306x | std::uint16_t t = *++next;
396 |  | 4194306x | if((t & 0xFC00u) != 0xDC00u)
397 |  | ✗ | invalid_code_point(t);
398 |  | 4194306x | m_value = (m_value - detail::high_surrogate_base) << 10;
399 |  | 4194306x | m_value |= (static_cast<U32Type>(static_cast< std::uint16_t>(t)) & detail::ten_bit_mask);
400 |  |  | }
401 |  |  | // postcondition; result must not be a surrogate:
402 |  | 5772342x | if(detail::is_surrogate(m_value))
403 |  | ✗ | invalid_code_point(static_cast< std::uint16_t>(m_value));
404 |  | 5772342x | }
405 |  |  | BaseIterator m_position;
406 |  |  | mutable U32Type m_value;
407 |  |  | };
408 |  |  |
409 |  |  | template <class BaseIterator, class U8Type = std::uint8_t>
410 |  |  | class u32_to_u8_iterator
411 |  |  | {
412 |  |  | typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
413 |  |  |
414 |  |  | static_assert(sizeof(base_value_type)*CHAR_BIT == 32, "Incorrectly sized template argument");
415 |  |  | static_assert(sizeof(U8Type)*CHAR_BIT == 8, "Incorrectly sized template argument");
416 |  |  |
417 |  |  | public:
418 |  |  | typedef std::ptrdiff_t difference_type;
419 |  |  | typedef U8Type value_type;
420 |  |  | typedef value_type const* pointer;
421 |  |  | typedef value_type const reference;
422 |  |  | typedef std::bidirectional_iterator_tag iterator_category;
423 |  |  |
424 |  | 576648x | reference operator*()const
425 |  |  | {
426 |  | 9341862x | if(m_current == 4)
427 |  | 1686007x | extract_current();
428 |  | 4959276x | return m_values[m_current];
429 |  |  | }
430 |  | 1272984x | bool operator==(const u32_to_u8_iterator& that)const
431 |  |  | {
432 |  | 27568518x | if(m_position == that.m_position)
433 |  |  | {
434 |  |  | // either the m_current's must be equal, or one must be 0 and
435 |  |  | // the other 4: which means neither must have bits 1 or 2 set:
436 |  | 119691x | return (m_current == that.m_current)
437 |  | 119694x | || (((m_current | that.m_current) & 3) == 0);
438 |  |  | }
439 |  | 1153296x | return false;
440 |  |  | }
441 |  | 1272984x | bool operator!=(const u32_to_u8_iterator& that)const
442 |  |  | {
443 |  | 1272984x | return !(*this == that);
444 |  |  | }
445 |  | 14301080x | u32_to_u8_iterator& operator++()
446 |  |  | {
447 |  |  | // if we have a pending read then read now, so that we know whether
448 |  |  | // to skip a position, or move to a low-surrogate:
449 |  | 14301080x | if(m_current == 4)
450 |  |  | {
451 |  |  | // pending read:
452 |  | 2798070x | extract_current();
453 |  |  | }
454 |  |  | // move to the next surrogate position:
455 |  | 14301080x | ++m_current;
456 |  |  | // if we've reached the end skip a position:
457 |  | 14301080x | if(m_values[m_current] == 0)
458 |  |  | {
459 |  | 4484069x | m_current = 4;
460 |  | 1147880x | ++m_position;
461 |  |  | }
462 |  | 14301080x | return *this;
463 |  |  | }
464 |  |  | u32_to_u8_iterator operator++(int)
465 |  |  | {
466 |  | 20x | u32_to_u8_iterator r(*this);
467 |  | 18x | ++(*this);
468 |  | 20x | return r;
469 |  |  | }
470 |  | 17530372x | u32_to_u8_iterator& operator--()
471 |  |  | {
472 |  | 17530372x | if((m_current & 3) == 0)
473 |  |  | {
474 |  | 8x | --m_position;
475 |  | 4448260x | extract_current();
476 |  | 4448260x | m_current = 3;
477 |  | 4710928x | while(m_current && (m_values[m_current] == 0))
478 |  | 262668x | --m_current;
479 |  |  | }
480 |  |  | else
481 |  | 13082112x | --m_current;
482 |  | 17530372x | return *this;
483 |  |  | }
484 |  |  | u32_to_u8_iterator operator--(int)
485 |  |  | {
486 |  |  | u32_to_u8_iterator r(*this);
487 |  |  | --(*this);
488 |  |  | return r;
489 |  |  | }
490 |  |  | BaseIterator base()const
491 |  |  | {
492 |  |  | return m_position;
493 |  |  | }
494 |  |  | // construct:
495 |  |  | u32_to_u8_iterator() : m_position(), m_current(0)
496 |  |  | {
497 |  |  | m_values[0] = 0;
498 |  |  | m_values[1] = 0;
499 |  |  | m_values[2] = 0;
500 |  |  | m_values[3] = 0;
501 |  |  | m_values[4] = 0;
502 |  |  | }
503 |  | 119690x | u32_to_u8_iterator(BaseIterator b) : m_position(b), m_current(4)
504 |  |  | {
505 |  | 119690x | m_values[0] = 0;
506 |  | 119690x | m_values[1] = 0;
507 |  | 119690x | m_values[2] = 0;
508 |  | 119690x | m_values[3] = 0;
509 |  | 119690x | m_values[4] = 0;
510 |  | 119688x | }
511 |  |  | private:
512 |  |  |
513 |  | 8932337x | void extract_current()const
514 |  |  | {
515 |  | 8932337x | std::uint32_t c = *m_position;
516 |  | 8932337x | if(c > 0x10FFFFu)
517 |  | ✗ | detail::invalid_utf32_code_point(c);
518 |  | 8932337x | if(c < 0x80u)
519 |  |  | {
520 |  | 1145222x | m_values[0] = static_cast<unsigned char>(c);
521 |  | 1145222x | m_values[1] = static_cast<unsigned char>(0u);
522 |  | 1145222x | m_values[2] = static_cast<unsigned char>(0u);
523 |  | 1145222x | m_values[3] = static_cast<unsigned char>(0u);
524 |  |  | }
525 |  | 7787115x | else if(c < 0x800u)
526 |  |  | {
527 |  | 15126x | m_values[0] = static_cast<unsigned char>(0xC0u + (c >> 6));
528 |  | 15126x | m_values[1] = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
529 |  | 15126x | m_values[2] = static_cast<unsigned char>(0u);
530 |  | 15126x | m_values[3] = static_cast<unsigned char>(0u);
531 |  |  | }
532 |  | 7771989x | else if(c < 0x10000u)
533 |  |  | {
534 |  | 431958x | m_values[0] = static_cast<unsigned char>(0xE0u + (c >> 12));
535 |  | 431958x | m_values[1] = static_cast<unsigned char>(0x80u + ((c >> 6) & 0x3Fu));
536 |  | 431958x | m_values[2] = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
537 |  | 431958x | m_values[3] = static_cast<unsigned char>(0u);
538 |  |  | }
539 |  |  | else
540 |  |  | {
541 |  | 7340031x | m_values[0] = static_cast<unsigned char>(0xF0u + (c >> 18));
542 |  | 7340031x | m_values[1] = static_cast<unsigned char>(0x80u + ((c >> 12) & 0x3Fu));
543 |  | 7340031x | m_values[2] = static_cast<unsigned char>(0x80u + ((c >> 6) & 0x3Fu));
544 |  | 7340031x | m_values[3] = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
545 |  |  | }
546 |  | 8932337x | m_current= 0;
547 |  | 8932337x | }
548 |  |  | BaseIterator m_position;
549 |  |  | mutable U8Type m_values[5];
550 |  |  | mutable unsigned m_current;
551 |  |  | };
552 |  |  |
553 |  |  | template <class BaseIterator, class U32Type = std::uint32_t>
554 |  |  | class u8_to_u32_iterator
555 |  |  | {
556 |  |  | // special values for pending iterator reads:
557 |  |  | static const U32Type pending_read = 0xffffffffu;
558 |  |  |
559 |  |  | typedef typename std::iterator_traits<BaseIterator>::value_type base_value_type;
560 |  |  |
561 |  |  | static_assert(sizeof(base_value_type)*CHAR_BIT == 8, "Incorrectly sized template argument");
562 |  |  | static_assert(sizeof(U32Type)*CHAR_BIT == 32, "Incorrectly sized template argument");
563 |  |  |
564 |  |  | public:
565 |  |  | typedef std::ptrdiff_t difference_type;
566 |  |  | typedef U32Type value_type;
567 |  |  | typedef value_type const* pointer;
568 |  |  | typedef value_type const reference;
569 |  |  | typedef std::bidirectional_iterator_tag iterator_category;
570 |  |  |
571 |  | 1759383x | reference operator*()const
572 |  |  | {
573 |  | 5095624x | if(m_value == pending_read)
574 |  | 5773176x | extract_current();
575 |  | 5095588x | return m_value;
576 |  |  | }
577 |  | 4414291x | bool operator==(const u8_to_u32_iterator& that)const
578 |  |  | {
579 |  | 4414345x | return m_position == that.m_position;
580 |  |  | }
581 |  | 3671063x | bool operator!=(const u8_to_u32_iterator& that)const
582 |  |  | {
583 |  | 3671063x | return !(*this == that);
584 |  |  | }
585 |  | 7467614x | u8_to_u32_iterator& operator++()
586 |  |  | {
587 |  |  | // We must not start with a continuation character:
588 |  | 7467614x | if((static_cast<std::uint8_t>(*m_position) & 0xC0) == 0x80)
589 |  | ✗ | invalid_sequence();
590 |  |  | // skip high surrogate first if there is one:
591 |  | 3019346x | unsigned c = detail::utf8_byte_count(*m_position);
592 |  | 7467614x | if(m_value == pending_read)
593 |  |  | {
594 |  |  | // Since we haven't read in a value, we need to validate the code points:
595 |  | 14528698x | for(unsigned i = 0; i < c; ++i)
596 |  |  | {
597 |  | 1772242x | ++m_position;
598 |  |  | // We must have a continuation byte:
599 |  | 10537418x | if((i != c - 1) && ((static_cast<std::uint8_t>(*m_position) & 0xC0) != 0x80))
600 |  | ✗ | invalid_sequence();
601 |  |  | }
602 |  |  | }
603 |  |  | else
604 |  |  | {
605 |  | 3476334x | std::advance(m_position, c);
606 |  |  | }
607 |  | 7467614x | m_value = pending_read;
608 |  | 7467614x | return *this;
609 |  |  | }
610 |  |  | u8_to_u32_iterator operator++(int)
611 |  |  | {
612 |  |  | u8_to_u32_iterator r(*this);
613 |  |  | ++(*this);
614 |  |  | return r;
615 |  |  | }
616 |  | 4497385x | u8_to_u32_iterator& operator--()
617 |  |  | {
618 |  |  | // Keep backtracking until we don't have a trailing character:
619 |  | 49133x | unsigned count = 0;
620 |  | 17579581x | while((*--m_position & 0xC0u) == 0x80u) ++count;
621 |  |  | // now check that the sequence was valid:
622 |  | 4497385x | if(count != detail::utf8_trailing_byte_count(*m_position))
623 |  | ✗ | invalid_sequence();
624 |  | 4497385x | m_value = pending_read;
625 |  | 4497385x | return *this;
626 |  |  | }
627 |  |  | u8_to_u32_iterator operator--(int)
628 |  |  | {
629 |  |  | u8_to_u32_iterator r(*this);
630 |  |  | --(*this);
631 |  |  | return r;
632 |  |  | }
633 |  | 231644x | BaseIterator base()const
634 |  |  | {
635 |  | 231644x | return m_position;
636 |  |  | }
637 |  |  | // construct:
638 |  | 983926x | u8_to_u32_iterator() : m_position()
639 |  |  | {
640 |  | 983926x | m_value = pending_read;
641 |  | 983926x | }
642 |  | 271962x | u8_to_u32_iterator(BaseIterator b) : m_position(b)
643 |  |  | {
644 |  | 271962x | m_value = pending_read;
645 |  | 271962x | }
646 |  |  | //
647 |  |  | // Checked constructor:
648 |  |  | //
649 |  | 1343841x | u8_to_u32_iterator(BaseIterator b, BaseIterator start, BaseIterator end) : m_position(b)
650 |  |  | {
651 |  | 1343841x | m_value = pending_read;
652 |  |  | //
653 |  |  | // We must not start with a continuation character, or end with a
654 |  |  | // truncated UTF-8 sequence otherwise we run the risk of going past
655 |  |  | // the start/end of the underlying sequence:
656 |  |  | //
657 |  | 1343841x | if(start != end)
658 |  |  | {
659 |  | 1342881x | unsigned char v = *start;
660 |  | 1342881x | if((v & 0xC0u) == 0x80u)
661 |  | 2x | invalid_sequence();
662 |  | 1342879x | if((b != start) && (b != end) && ((*b & 0xC0u) == 0x80u))
663 |  | 2x | invalid_sequence();
664 |  | 230722x | BaseIterator pos = end;
665 |  |  | do
666 |  |  | {
667 |  | 4686314x | v = *--pos;
668 |  |  | }
669 |  | 5798387x | while((start != pos) && ((v & 0xC0u) == 0x80u));
670 |  | 1342877x | std::ptrdiff_t extra = detail::utf8_byte_count(v);
671 |  | 1342877x | if(std::distance(pos, end) < extra)
672 |  | 6x | invalid_sequence();
673 |  |  | }
674 |  | 1343831x | }
675 |  |  | private:
676 |  | 46x | static void invalid_sequence()
677 |  |  | {
678 |  | 46x | std::out_of_range e("Invalid UTF-8 sequence encountered while trying to encode UTF-32 character");
679 |  |  | #ifndef BOOST_REGEX_STANDALONE
680 |  | 46x | boost::throw_exception(e);
681 |  |  | #else
682 |  | ✗ | throw e;
683 |  |  | #endif
684 |  | 46x | }
685 |  | 5773176x | void extract_current()const
686 |  |  | {
687 |  | 5773176x | m_value = static_cast<U32Type>(static_cast< std::uint8_t>(*m_position));
688 |  |  | // we must not have a continuation character:
689 |  | 5773176x | if((m_value & 0xC0u) == 0x80u)
690 |  | ✗ | invalid_sequence();
691 |  |  | // see how many extra bytes we have:
692 |  | 5773176x | unsigned extra = detail::utf8_trailing_byte_count(*m_position);
693 |  |  | // extract the extra bits, 6 from each extra byte:
694 |  | 1324872x | BaseIterator next(m_position);
695 |  | 18860546x | for(unsigned c = 0; c < extra; ++c)
696 |  |  | {
697 |  | 5274x | ++next;
698 |  | 13087374x | m_value <<= 6;
699 |  |  | // We must have a continuation byte:
700 |  | 13087374x | if((static_cast<std::uint8_t>(*next) & 0xC0) != 0x80)
701 |  | 4x | invalid_sequence();
702 |  | 13087370x | m_value += static_cast<std::uint8_t>(*next) & 0x3Fu;
703 |  |  | }
704 |  |  | // we now need to remove a few of the leftmost bits, but how many depends
705 |  |  | // upon how many extra bytes we've extracted:
706 |  |  | static const std::uint32_t masks[4] =
707 |  |  | {
708 |  |  | 0x7Fu,
709 |  |  | 0x7FFu,
710 |  |  | 0xFFFFu,
711 |  |  | 0x1FFFFFu,
712 |  |  | };
713 |  | 5773172x | m_value &= masks[extra];
714 |  |  | // check the result is in range:
715 |  | 5773172x | if(m_value > static_cast<U32Type>(0x10FFFFu))
716 |  | ✗ | invalid_sequence();
717 |  |  | // The result must not be a surrogate:
718 |  | 5773172x | if((m_value >= static_cast<U32Type>(0xD800)) && (m_value <= static_cast<U32Type>(0xDFFF)))
719 |  | 8x | invalid_sequence();
720 |  |  | // We should not have had an invalidly encoded UTF8 sequence:
721 |  | 5773164x | if((extra > 0) && (m_value <= static_cast<U32Type>(masks[extra - 1])))
722 |  | 24x | invalid_sequence();
723 |  | 5773140x | }
724 |  |  | BaseIterator m_position;
725 |  |  | mutable U32Type m_value;
726 |  |  | };
727 |  |  |
728 |  |  | template <class BaseIterator>
729 |  |  | class utf16_output_iterator
730 |  |  | {
731 |  |  | public:
732 |  |  | typedef void difference_type;
733 |  |  | typedef void value_type;
734 |  |  | typedef std::uint32_t* pointer;
735 |  |  | typedef std::uint32_t& reference;
736 |  |  | typedef std::output_iterator_tag iterator_category;
737 |  |  |
738 |  | 3673x | utf16_output_iterator(const BaseIterator& b)
739 |  | 3673x | : m_position(b){}
740 |  | 72309x | utf16_output_iterator(const utf16_output_iterator& that)
741 |  | 72309x | : m_position(that.m_position){}
742 |  | 11787x | utf16_output_iterator& operator=(const utf16_output_iterator& that)
743 |  |  | {
744 |  | 11787x | m_position = that.m_position;
745 |  | 11787x | return *this;
746 |  |  | }
747 |  | 22723x | const utf16_output_iterator& operator*()const
748 |  |  | {
749 |  | 22723x | return *this;
750 |  |  | }
751 |  | 22723x | void operator=(std::uint32_t val)const
752 |  |  | {
753 |  | 22723x | push(val);
754 |  | 22723x | }
755 |  | 22723x | utf16_output_iterator& operator++()
756 |  |  | {
757 |  | 22723x | return *this;
758 |  |  | }
759 |  |  | utf16_output_iterator& operator++(int)
760 |  |  | {
761 |  |  | return *this;
762 |  |  | }
763 |  | 1836x | BaseIterator base()const
764 |  |  | {
765 |  | 1836x | return m_position;
766 |  |  | }
767 |  |  | private:
768 |  | 22723x | void push(std::uint32_t v)const
769 |  |  | {
770 |  | 22723x | if(v >= 0x10000u)
771 |  |  | {
772 |  |  | // begin by checking for a code point out of range:
773 |  | ✗ | if(v > 0x10FFFFu)
774 |  | ✗ | detail::invalid_utf32_code_point(v);
775 |  |  | // split into two surrogates:
776 |  | ✗ | *m_position++ = static_cast<std::uint16_t>(v >> 10) + detail::high_surrogate_base;
777 |  | ✗ | *m_position++ = static_cast<std::uint16_t>(v & detail::ten_bit_mask) + detail::low_surrogate_base;
778 |  |  | }
779 |  |  | else
780 |  |  | {
781 |  |  | // 16-bit code point:
782 |  |  | // value must not be a surrogate:
783 |  | 22723x | if(detail::is_surrogate(v))
784 |  | ✗ | detail::invalid_utf32_code_point(v);
785 |  | 22723x | *m_position++ = static_cast<std::uint16_t>(v);
786 |  |  | }
787 |  | 22723x | }
788 |  |  | mutable BaseIterator m_position;
789 |  |  | };
790 |  |  |
791 |  |  | template <class BaseIterator>
792 |  |  | class utf8_output_iterator
793 |  |  | {
794 |  |  | public:
795 |  |  | typedef void difference_type;
796 |  |  | typedef void value_type;
797 |  |  | typedef std::uint32_t* pointer;
798 |  |  | typedef std::uint32_t& reference;
799 |  |  | typedef std::output_iterator_tag iterator_category;
800 |  |  |
801 |  | 3672x | utf8_output_iterator(const BaseIterator& b)
802 |  | 3672x | : m_position(b){}
803 |  | 72288x | utf8_output_iterator(const utf8_output_iterator& that)
804 |  | 72288x | : m_position(that.m_position){}
805 |  | 11784x | utf8_output_iterator& operator=(const utf8_output_iterator& that)
806 |  |  | {
807 |  | 11784x | m_position = that.m_position;
808 |  | 11784x | return *this;
809 |  |  | }
810 |  | 22704x | const utf8_output_iterator& operator*()const
811 |  |  | {
812 |  | 22704x | return *this;
813 |  |  | }
814 |  | 22704x | void operator=(std::uint32_t val)const
815 |  |  | {
816 |  | 22704x | push(val);
817 |  | 22704x | }
818 |  | 22704x | utf8_output_iterator& operator++()
819 |  |  | {
820 |  | 22704x | return *this;
821 |  |  | }
822 |  |  | utf8_output_iterator& operator++(int)
823 |  |  | {
824 |  |  | return *this;
825 |  |  | }
826 |  | 3672x | BaseIterator base()const
827 |  |  | {
828 |  | 3672x | return m_position;
829 |  |  | }
830 |  |  | private:
831 |  | 22704x | void push(std::uint32_t c)const
832 |  |  | {
833 |  | 22704x | if(c > 0x10FFFFu)
834 |  | ✗ | detail::invalid_utf32_code_point(c);
835 |  | 22704x | if(c < 0x80u)
836 |  |  | {
837 |  | 22704x | *m_position++ = static_cast<unsigned char>(c);
838 |  |  | }
839 |  | ✗ | else if(c < 0x800u)
840 |  |  | {
841 |  | ✗ | *m_position++ = static_cast<unsigned char>(0xC0u + (c >> 6));
842 |  | ✗ | *m_position++ = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
843 |  |  | }
844 |  | ✗ | else if(c < 0x10000u)
845 |  |  | {
846 |  | ✗ | *m_position++ = static_cast<unsigned char>(0xE0u + (c >> 12));
847 |  | ✗ | *m_position++ = static_cast<unsigned char>(0x80u + ((c >> 6) & 0x3Fu));
848 |  | ✗ | *m_position++ = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
849 |  |  | }
850 |  |  | else
851 |  |  | {
852 |  | ✗ | *m_position++ = static_cast<unsigned char>(0xF0u + (c >> 18));
853 |  | ✗ | *m_position++ = static_cast<unsigned char>(0x80u + ((c >> 12) & 0x3Fu));
854 |  | ✗ | *m_position++ = static_cast<unsigned char>(0x80u + ((c >> 6) & 0x3Fu));
855 |  | ✗ | *m_position++ = static_cast<unsigned char>(0x80u + (c & 0x3Fu));
856 |  |  | }
857 |  | 22704x | }
858 |  |  | mutable BaseIterator m_position;
859 |  |  | };
860 |  |  |
861 |  |  | } // namespace boost
862 |  |  |
863 |  |  | #endif // BOOST_REGEX_UNICODE_ITERATOR_HPP
864 |  |  |
865 |  |  |