7#ifndef BOOST_NOWIDE_STACKSTRING_HPP_INCLUDED
8#define BOOST_NOWIDE_STACKSTRING_HPP_INCLUDED
10#include <boost/nowide/convert.hpp>
11#include <boost/nowide/utf/utf.hpp>
30 template<
typename CharOut =
wchar_t,
typename CharIn =
char,
size_t BufferSize = 256>
69 const size_t len = other.
length();
79 std::memcpy(data_, other.data_,
sizeof(
output_char) * (len + 1));
106 const size_t input_len = end - begin;
108 const size_t min_output_size = input_len + 1;
150 std::swap(lhs.buffer_[i], rhs.buffer_[i]);
153 lhs.data_ = rhs.data_;
154 rhs.data_ = rhs.buffer_;
156 rhs.buffer_[i] = lhs.buffer_[i];
160 rhs.data_ = lhs.data_;
161 lhs.data_ = lhs.buffer_;
163 lhs.buffer_[i] = rhs.buffer_[i];
165 std::swap(lhs.data_, rhs.data_);
172 return data_ == buffer_;
A class that allows to create a temporary wide or narrow UTF strings from wide or narrow UTF source.
Definition: stackstring.hpp:32
basic_stackstring()
Creates a NULL stackstring.
Definition: stackstring.hpp:42
basic_stackstring(const basic_stackstring &other)
Copy construct from other.
Definition: stackstring.hpp:59
static const size_t buffer_size
Size of the stack buffer.
Definition: stackstring.hpp:35
size_t length() const
Definition: stackstring.hpp:176
basic_stackstring(const input_char *begin, const input_char *end)
Definition: stackstring.hpp:54
bool uses_stack_memory() const
True if the stack memory is used.
Definition: stackstring.hpp:170
basic_stackstring(const input_char *input)
Definition: stackstring.hpp:48
CharIn input_char
Type of the input character (converted from)
Definition: stackstring.hpp:39
friend void swap(basic_stackstring &lhs, basic_stackstring &rhs)
Swap lhs with rhs.
Definition: stackstring.hpp:143
CharOut output_char
Type of the output character (converted to)
Definition: stackstring.hpp:37
output_char * convert(const input_char *input)
Definition: stackstring.hpp:91
void clear()
Reset the internal buffer to NULL.
Definition: stackstring.hpp:136
const output_char * get() const
Return the converted, NULL-terminated string or NULL if no string was converted.
Definition: stackstring.hpp:131
basic_stackstring & operator=(const basic_stackstring &other)
Copy assign from other.
Definition: stackstring.hpp:64
output_char * get()
Return the converted, NULL-terminated string or NULL if no string was converted.
Definition: stackstring.hpp:126
output_char * convert(const input_char *begin, const input_char *end)
Definition: stackstring.hpp:100
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
UTF Traits class - functions to convert UTF sequences to and from Unicode code points.
Definition: utf.hpp:57