Utf8Appender Class Reference

#include <Pt/Utf8.h>

UTF-8 string output iterator. More...

Public Member Functions

 Utf8Appender (std::string &str)
 Construct from UTF-8 encoded string.
 
 Utf8Appender (const Utf8Appender &other)
 Copy constructor.
 
Utf8Appenderoperator* ()
 No-op.
 
Utf8Appenderoperator++ ()
 No-op.
 
Utf8Appender operator++ (int)
 No-op.
 
Utf8Appenderoperator= (const Utf8Appender &other)
 Assignment operator.
 
Utf8Appenderoperator= (const Char &ch)
 Encodes a unicode character to the target string.
 

Detailed Description

The Utf8Appender is a single-pass output iterator, to append unicode characters to an UTF-8 encoded string. It can be used with standard C++ algorithms.

std::string s;
Char oe = 0366;
std::fill_n(a, 3, oe);
assert(s, "\303\266\303\266\303\266");