8#ifndef BOOST_NOWIDE_CONVERT_HPP_INCLUDED
9#define BOOST_NOWIDE_CONVERT_HPP_INCLUDED
11#include <boost/nowide/detail/is_string_container.hpp>
12#include <boost/nowide/utf/convert.hpp>
25 inline char*
narrow(
char* output,
size_t output_size,
const wchar_t* begin,
const wchar_t* end)
36 inline char*
narrow(
char* output,
size_t output_size,
const wchar_t* source)
48 inline wchar_t*
widen(
wchar_t* output,
size_t output_size,
const char* begin,
const char* end)
59 inline wchar_t*
widen(
wchar_t* output,
size_t output_size,
const char* source)
71 template<
typename T_Char,
typename = detail::requires_w
ide_
char<T_Char>>
72 inline std::string
narrow(
const T_Char* s,
size_t count)
74 return utf::convert_string<char>(s, s + count);
82 template<
typename T_Char,
typename = detail::requires_w
ide_
char<T_Char>>
83 inline std::string
narrow(
const T_Char* s)
93 template<
typename StringOrStringView,
typename = detail::requires_w
ide_
string_container<StringOrStringView>>
94 inline std::string
narrow(
const StringOrStringView& s)
96 return utf::convert_string<char>(s.data(), s.data() + s.size());
106 template<
typename T_Char,
typename = detail::requires_narrow_
char<T_Char>>
107 inline std::wstring
widen(
const T_Char* s,
size_t count)
109 return utf::convert_string<wchar_t>(s, s + count);
117 template<
typename T_Char,
typename = detail::requires_narrow_
char<T_Char>>
118 inline std::wstring
widen(
const T_Char* s)
128 template<
typename StringOrStringView,
typename = detail::requires_narrow_
string_container<StringOrStringView>>
129 inline std::wstring
widen(
const StringOrStringView& s)
131 return utf::convert_string<wchar_t>(s.data(), s.data() + s.size());
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
wchar_t * widen(wchar_t *output, size_t output_size, const char *begin, const char *end)
Definition: convert.hpp:48
char * narrow(char *output, size_t output_size, const wchar_t *begin, const wchar_t *end)
Definition: convert.hpp:25