u5e
UnicodeTextC++Library
Static Public Member Functions | Public Attributes | List of all members
u5e::utf8_bounds< NativeIterator > Class Template Reference

Check and enforce bounds of utf8 text. More...

#include <u5e/utf8_bounds.hpp>

Collaboration diagram for u5e::utf8_bounds< NativeIterator >:
Collaboration graph
[legend]

Static Public Member Functions

static bool check (NativeIterator begin, NativeIterator end)
 
static bool enforce (NativeIterator begin, NativeIterator end)
 

Public Attributes

iterator_assertion< NativeIterator, char > _assertions
 

Detailed Description

template<typename NativeIterator>
class u5e::utf8_bounds< NativeIterator >

Check and enforce bounds of utf8 text.

This will only look at the last 6 octets of the text and will only look at the first octet. It will not guarantee that the entire text is valid. The intent of this class is to provide a cheap safety check to make sure you will not have any under or overflow when processing this text.

Template Parameters
NativeIteratorThe native type to be iterated over.

Definition at line 21 of file utf8_bounds.hpp.

Member Function Documentation

template<typename NativeIterator >
static bool u5e::utf8_bounds< NativeIterator >::check ( NativeIterator  begin,
NativeIterator  end 
)
inlinestatic

Check the bounds of the utf8 text, returns true if the text has correct bounds.

Definition at line 32 of file utf8_bounds.hpp.

template<typename NativeIterator >
static bool u5e::utf8_bounds< NativeIterator >::enforce ( NativeIterator  begin,
NativeIterator  end 
)
inlinestatic

Enforce the bounds of the utf8 text, replace any bad character in the bounds by '?. Returns false if any substitution was made.

Definition at line 57 of file utf8_bounds.hpp.

Member Data Documentation

template<typename NativeIterator >
iterator_assertion<NativeIterator, char> u5e::utf8_bounds< NativeIterator >::_assertions

The NativeIterator must match the attributes of char

Definition at line 26 of file utf8_bounds.hpp.


The documentation for this class was generated from the following file: