u5e
UnicodeTextC++Library
|
basic encoding support over string-like objects. More...
#include <u5e/basic_encodedstring.hpp>
Public Types | |
typedef u5e::codepoint_traits | traits_type |
typedef u5e::codepoint | value_type |
typedef u5e::codepoint_traits::pos_type | size_type |
typedef u5e::codepoint_traits::off_type | difference_type |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef NativeString::pointer | pointer |
typedef NativeString::const_pointer | const_pointer |
typedef Encoding::template iterator< NativeString > | iterator |
typedef Encoding::template const_iterator< NativeString > | const_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Public Attributes | |
NativeString | native_string |
Raw buffer as specified by the native type. More... | |
basic encoding support over string-like objects.
u5e::basic_encodedstring implements encoding support on top of a string-like object, it is implemented by simply wrapping the native string type in order to provide a customized iterator that offers codepoint-by-codepoint access instead of iterating over the native type.
Encoding | Text is always represented in a specific encoding, there is no such thing as a "natural", or "native" representation of text, for that reason, the encoding is a part of the type. |
NativeString | In order to re-use the string support, this will always be implemented as a wrapper around an native string-like type. The idea is that the C++ string libraries operate on unencoded memory, while the u5e types offer a layer on top of that for the purposes of implementing unicode in a type-safe way. Note that this applies to any 'string-like' object, such as string or string_view. |
Definition at line 37 of file basic_encodedstring.hpp.
typedef Encoding::template const_iterator<NativeString> u5e::basic_encodedstring< Encoding, NativeString >::const_iterator |
The Encoding template argument must provide iterator and const_iterator member types. Those should iterate over codepoints, regardless of the encoding and the native type.
The iterator and const_iterator member types must be themselves templates that take the NativeString type as a template argument.
Definition at line 68 of file basic_encodedstring.hpp.
typedef NativeString::const_pointer u5e::basic_encodedstring< Encoding, NativeString >::const_pointer |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 52 of file basic_encodedstring.hpp.
typedef const value_type& u5e::basic_encodedstring< Encoding, NativeString >::const_reference |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 50 of file basic_encodedstring.hpp.
typedef std::reverse_iterator<const_iterator> u5e::basic_encodedstring< Encoding, NativeString >::const_reverse_iterator |
Delegated to std::reverse_iterator
Definition at line 76 of file basic_encodedstring.hpp.
typedef u5e::codepoint_traits::off_type u5e::basic_encodedstring< Encoding, NativeString >::difference_type |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 48 of file basic_encodedstring.hpp.
typedef Encoding::template iterator<NativeString> u5e::basic_encodedstring< Encoding, NativeString >::iterator |
The Encoding template argument must provide iterator and const_iterator member types. Those should iterate over codepoints, regardless of the encoding and the native type.
The iterator and const_iterator member types must be themselves templates that take the NativeString type as a template argument.
Definition at line 66 of file basic_encodedstring.hpp.
typedef NativeString::pointer u5e::basic_encodedstring< Encoding, NativeString >::pointer |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 51 of file basic_encodedstring.hpp.
typedef value_type& u5e::basic_encodedstring< Encoding, NativeString >::reference |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 49 of file basic_encodedstring.hpp.
typedef std::reverse_iterator<iterator> u5e::basic_encodedstring< Encoding, NativeString >::reverse_iterator |
Delegated to std::reverse_iterator
Definition at line 75 of file basic_encodedstring.hpp.
typedef u5e::codepoint_traits::pos_type u5e::basic_encodedstring< Encoding, NativeString >::size_type |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 47 of file basic_encodedstring.hpp.
typedef u5e::codepoint_traits u5e::basic_encodedstring< Encoding, NativeString >::traits_type |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 45 of file basic_encodedstring.hpp.
typedef u5e::codepoint u5e::basic_encodedstring< Encoding, NativeString >::value_type |
Offer an interface such that the size of the thing you're iterating over is a codepoint, regardless of the native type.
Definition at line 46 of file basic_encodedstring.hpp.
|
default |
Default constructor, delegated to the native type.
|
inline |
Implicit conversion from the native type.
Definition at line 99 of file basic_encodedstring.hpp.
|
inline |
Append from input iterators.
Note that this is only possible from iterators of the same encoding. This will not perform any conversion.
Definition at line 174 of file basic_encodedstring.hpp.
|
inline |
Append from input iterators.
Note that this is only possible from iterators of the same encoding. This will not perform any conversion.
Definition at line 186 of file basic_encodedstring.hpp.
|
inline |
Append from input iterators.
Note that this is only possible from iterators of the same encoding. This will not perform any conversion.
Definition at line 193 of file basic_encodedstring.hpp.
|
inline |
Append from input iterators.
Note that this is only possible from iterators of the same encoding. This will not perform any conversion.
Definition at line 202 of file basic_encodedstring.hpp.
|
inline |
Append from input iterators.
Note that this is only possible from iterators of the same encoding. This will not perform any conversion.
Definition at line 209 of file basic_encodedstring.hpp.
|
inline |
Get begin and end codepoint iterators.
Definition at line 132 of file basic_encodedstring.hpp.
|
inline |
Get begin and end codepoint iterators.
Definition at line 138 of file basic_encodedstring.hpp.
|
inline |
Get begin and end codepoint iterators.
Definition at line 141 of file basic_encodedstring.hpp.
|
inline |
Get begin and end codepoint iterators.
Definition at line 135 of file basic_encodedstring.hpp.
|
inline |
Get begin and end grapheme iterators. Graphemes are always built from the const iterators, since graphemes are always immutable.
Definition at line 152 of file basic_encodedstring.hpp.
|
inline |
Get begin and end grapheme iterators. Graphemes are always built from the const iterators, since graphemes are always immutable.
Definition at line 157 of file basic_encodedstring.hpp.
|
inline |
Get begin and end native iterators.
Definition at line 114 of file basic_encodedstring.hpp.
|
inline |
Get begin and end native iterators.
Definition at line 120 of file basic_encodedstring.hpp.
|
inline |
Get begin and end native iterators.
Definition at line 123 of file basic_encodedstring.hpp.
|
inline |
Get begin and end native iterators.
Definition at line 117 of file basic_encodedstring.hpp.
|
inline |
Assignment operator, assigns the native type.
Definition at line 106 of file basic_encodedstring.hpp.
NativeString u5e::basic_encodedstring< Encoding, NativeString >::native_string |
Raw buffer as specified by the native type.
This means that this class is exactly as expensive as whichever native type is being used, it also means this class delegates all memory management to that native type.
This member is public because you should be able to completely manage the native object if you need to.
Definition at line 89 of file basic_encodedstring.hpp.