|
|
|
@ -90,8 +90,11 @@ public:
|
|
|
|
|
// IMPROVE ME
|
|
|
|
|
// add cbegin(), cend(), rbegin(), rend(), crbegin(), crend()
|
|
|
|
|
|
|
|
|
|
void to_string(std::string & str, bool clear_string = true) const;
|
|
|
|
|
void to_string(std::wstring & str, bool clear_string = true) const;
|
|
|
|
|
void to_str(std::string & str, bool clear_string = true) const;
|
|
|
|
|
void to_str(std::wstring & str, bool clear_string = true) const;
|
|
|
|
|
|
|
|
|
|
std::string to_str() const;
|
|
|
|
|
std::wstring to_wstr() const;
|
|
|
|
|
|
|
|
|
|
char_type & operator[](size_t index);
|
|
|
|
|
char_type operator[](size_t index) const;
|
|
|
|
@ -224,7 +227,7 @@ TextStreamBase<char_type, stack_size, heap_block_size>::end() const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
|
|
|
void TextStreamBase<char_type, stack_size, heap_block_size>::to_string(std::string & str, bool clear_string) const
|
|
|
|
|
void TextStreamBase<char_type, stack_size, heap_block_size>::to_str(std::string & str, bool clear_string) const
|
|
|
|
|
{
|
|
|
|
|
if( clear_string )
|
|
|
|
|
str.clear();
|
|
|
|
@ -250,7 +253,7 @@ void TextStreamBase<char_type, stack_size, heap_block_size>::to_string(std::stri
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
|
|
|
void TextStreamBase<char_type, stack_size, heap_block_size>::to_string(std::wstring & str, bool clear_string) const
|
|
|
|
|
void TextStreamBase<char_type, stack_size, heap_block_size>::to_str(std::wstring & str, bool clear_string) const
|
|
|
|
|
{
|
|
|
|
|
if( clear_string )
|
|
|
|
|
str.clear();
|
|
|
|
@ -269,13 +272,41 @@ void TextStreamBase<char_type, stack_size, heap_block_size>::to_string(std::wstr
|
|
|
|
|
{
|
|
|
|
|
// IMPROVE ME don't use a temporary object
|
|
|
|
|
std::string utf8;
|
|
|
|
|
to_string(utf8);
|
|
|
|
|
to_str(utf8);
|
|
|
|
|
utf8_to_wide(utf8, str, false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
|
|
|
std::string TextStreamBase<char_type, stack_size, heap_block_size>::to_str() const
|
|
|
|
|
{
|
|
|
|
|
std::string str;
|
|
|
|
|
to_str(str, false);
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
|
|
|
std::wstring TextStreamBase<char_type, stack_size, heap_block_size>::to_wstr() const
|
|
|
|
|
{
|
|
|
|
|
std::wstring str;
|
|
|
|
|
to_str(str, false);
|
|
|
|
|
|
|
|
|
|
return str;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
|
|
|
|
char_type & TextStreamBase<char_type, stack_size, heap_block_size>::operator[](size_t index)
|
|
|
|
|