8#ifndef BOOST_NOWIDE_UTF_CONVERT_HPP_INCLUDED
9#define BOOST_NOWIDE_UTF_CONVERT_HPP_INCLUDED
11#include <boost/nowide/detail/is_string_container.hpp>
13#include <boost/nowide/utf/utf.hpp>
24 template<
typename Char>
40 template<
typename CharOut,
typename CharIn>
42 convert_buffer(CharOut* buffer,
size_t buffer_size,
const CharIn* source_begin,
const CharIn* source_end)
48 while(source_begin != source_end)
56 if(buffer_size < width)
73 template<
typename CharOut,
typename CharIn>
74 std::basic_string<CharOut>
convert_string(
const CharIn* begin,
const CharIn* end)
76 std::basic_string<CharOut> result;
77 result.reserve(end - begin);
78 using inserter_type = std::back_insert_iterator<std::basic_string<CharOut>>;
79 inserter_type inserter(result);
98 template<
typename CharOut,
typename CharIn>
99 std::basic_string<CharOut>
convert_string(
const std::basic_string<CharIn>& s)
Namespace that holds basic operations on UTF encoded sequences.
Definition convert.hpp:19
std::basic_string< CharOut > convert_string(const CharIn *begin, const CharIn *end)
Definition convert.hpp:74
static const code_point incomplete
Special constant that defines incomplete code point.
Definition utf.hpp:37
static const code_point illegal
Special constant that defines illegal code point.
Definition utf.hpp:32
uint32_t code_point
The integral type that can hold a Unicode code point.
Definition utf.hpp:27
CharOut * convert_buffer(CharOut *buffer, size_t buffer_size, const CharIn *source_begin, const CharIn *source_end)
Definition convert.hpp:42
size_t strlen(const Char *s)
Definition convert.hpp:25
#define BOOST_NOWIDE_REPLACEMENT_CHARACTER
Definition replacement.hpp:15
static code_point decode(Iterator &p, Iterator e)
static Iterator encode(code_point value, Iterator out)
static int width(code_point value)