MyGUI_UString.h
Go to the documentation of this file.
// Modified from OpenGUI under lenient license
// Original copyright details and licensing below:
// OpenGUI (http://opengui.sourceforge.net)
// This source code is released under the BSD License
// Permission is given to the MyGUI project to use the contents of file within its
// source and binary applications, as well as any derivative works, in accordance
// with the terms of any license under which MyGUI is or will be distributed.
//
// MyGUI may relicense its copy of this file, as well as any OpenGUI released updates
// to this file, under any terms that it deems fit, and is not required to maintain
// the original BSD licensing terms of this file, however OpenGUI retains the right
// to present its copy of this file under the terms of any license under which
// OpenGUI is distributed.
//
// MyGUI is not required to release to OpenGUI any future changes that it makes to
// this file, and understands and agrees that any such changes that are released
// back to OpenGUI will become available under the terms of any license under which
// OpenGUI is distributed.
//
// For brevity, this permission text may be removed from this file if desired.
// The original record kept within the SourceForge (http://sourceforge.net/) tracker
// is sufficient.
//
// - Eric Shorkey (zero/zeroskill) <opengui@rightbracket.com> [January 20th, 2007]
#ifndef MYGUI_U_STRING_H_
#define MYGUI_U_STRING_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Types.h"
// these are explained later
#include <iterator>
#include <string>
#include <string_view>
#include <stdexcept>
namespace MyGUI
{
/* READ THIS NOTICE BEFORE USING IN YOUR OWN APPLICATIONS
=NOTICE=
This class is not a complete Unicode solution. It purposefully does not
provide certain functionality, such as proper lexical sorting for
Unicode values. It does provide comparison operators for the sole purpose
of using UString as an index with std::map and other operator< sorted
containers, but it should NOT be relied upon for meaningful lexical
operations, such as alphabetical sorts. If you need this type of
functionality, look into using ICU instead (http://icu.sourceforge.net/).
=REQUIREMENTS=
There are a few requirements for proper operation. They are fairly small,
and shouldn't restrict usage on any reasonable target.
* Compiler must support unsigned 16-bit integer types
* Compiler must support signed 32-bit integer types
* wchar_t must be either UTF-16 or UTF-32 encoding, and specified as such
using the WCHAR_UTF16 macro as outlined below.
* You must include <iterator>, <string>, and <wchar>. Probably more, but
these are the most obvious.
=REQUIRED PREPROCESSOR MACROS=
This class requires two preprocessor macros to be defined in order to
work as advertised.
INT32 - must be mapped to a signed 32 bit integer (ex. #define INT32 int)
UINT16 - must be mapped to an unsigned 16 bit integer (ex. #define UINT32 unsigned short)
Additionally, a third macro should be defined to control the evaluation of wchar_t:
WCHAR_UTF16 - should be defined when wchar_t represents UTF-16 code points,
such as in Windows. Otherwise it is assumed that wchar_t is a 32-bit
integer representing UTF-32 code points.
*/
// THIS IS A VERY BRIEF AUTO DETECTION. YOU MAY NEED TO TWEAK THIS
#ifdef __STDC_ISO_10646__
// for any compiler that provides this, wchar_t is guaranteed to hold any Unicode value with a single code point (32-bit or larger)
// so we can safely skip the rest of the testing
#else // #ifdef __STDC_ISO_10646__
#if defined(__WIN32__) || defined(_WIN32)
#define WCHAR_UTF16 // All currently known Windows platforms utilize UTF-16 encoding in wchar_t
#else // #if defined( __WIN32__ ) || defined( _WIN32 )
#if WCHAR_MAX <= 0xFFFF // this is a last resort fall back test; WCHAR_MAX is defined in <wchar.h>
#define WCHAR_UTF16 // best we can tell, wchar_t is not larger than 16-bit
#endif // #if WCHAR_MAX <= 0xFFFF
#endif // #if defined( __WIN32__ ) || defined( _WIN32 )
#endif // #ifdef __STDC_ISO_10646__
// MYGUI_IS_NATIVE_WCHAR_T means that wchar_t isn't a typedef of
// uint16_t or uint32_t.
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
// Don't define wchar_t related functions since it'll duplicate
// with UString::code_point related functions when compile
// without /Zc:wchar_t, because in this case both of them are
// a typedef of uint16_t.
#if defined(_NATIVE_WCHAR_T_DEFINED)
#define MYGUI_IS_NATIVE_WCHAR_T 1
#else
#define MYGUI_IS_NATIVE_WCHAR_T 0
#endif
#else // MYGUI_COMPILER != MYGUI_COMPILER_MSVC
// Assumed wchar_t is natively for other compilers
#define MYGUI_IS_NATIVE_WCHAR_T 1
#endif // MYGUI_COMPILER == MYGUI_COMPILER_MSVC
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
// disable: warning C4275: non dll-interface class '***' used as base for dll-interface clas '***'
#pragma warning(push)
#pragma warning(disable : 4275)
#endif
class MYGUI_EXPORT UString
{
// constants used in UTF-8 conversions
static const unsigned char _lead1 = 0xC0; //110xxxxx
static const unsigned char _lead1_mask = 0x1F; //00011111
static const unsigned char _lead2 = 0xE0; //1110xxxx
static const unsigned char _lead2_mask = 0x0F; //00001111
static const unsigned char _lead3 = 0xF0; //11110xxx
static const unsigned char _lead3_mask = 0x07; //00000111
static const unsigned char _lead4 = 0xF8; //111110xx
static const unsigned char _lead4_mask = 0x03; //00000011
static const unsigned char _lead5 = 0xFC; //1111110x
static const unsigned char _lead5_mask = 0x01; //00000001
static const unsigned char _cont = 0x80; //10xxxxxx
static const unsigned char _cont_mask = 0x3F; //00111111
public:
using size_type = size_t;
static const size_type npos = std::numeric_limits<size_t>::max();
using unicode_char = char32_t;
using code_point = char16_t;
using value_type = code_point;
using dstring = std::basic_string<code_point>; // data string
using utf32string = std::basic_string<unicode_char>;
class MYGUI_EXPORT invalid_data : public std::runtime_error
{
public:
explicit invalid_data(const std::string& _message) :
std::runtime_error(_message)
{
/* The thing is, Bob, it's not that I'm lazy, it's that I just don't care. */
}
};
//#########################################################################
class MYGUI_EXPORT _base_iterator
{
friend class UString;
protected:
using difference_type = ptrdiff_t;
void _seekFwd(size_type c);
void _seekRev(size_type c);
void _become(const _base_iterator& i);
bool _test_begin() const;
bool _test_end() const;
size_type _get_index() const;
void _jump_to(size_type index);
unicode_char _getCharacter() const;
int _setCharacter(unicode_char uc);
void _moveNext();
void _movePrev();
dstring::iterator mIter;
UString* mString{nullptr};
};
//#########################################################################
// FORWARD ITERATORS
//#########################################################################
class _const_fwd_iterator; // forward declaration
class MYGUI_EXPORT _fwd_iterator : public _base_iterator
{
public:
_fwd_iterator& operator++();
_fwd_iterator operator++(int);
_fwd_iterator& operator--();
_fwd_iterator operator--(int);
_fwd_iterator operator+(difference_type n);
_fwd_iterator operator-(difference_type n);
_fwd_iterator& operator+=(difference_type n);
_fwd_iterator& operator-=(difference_type n);
value_type& operator*() const;
value_type& operator[](difference_type n) const;
_fwd_iterator& moveNext();
_fwd_iterator& movePrev();
unicode_char getCharacter() const;
int setCharacter(unicode_char uc);
};
//#########################################################################
class MYGUI_EXPORT _const_fwd_iterator : public _base_iterator
{
public:
_const_fwd_iterator();
_const_fwd_iterator(const _fwd_iterator& i);
_const_fwd_iterator& operator++();
_const_fwd_iterator operator++(int);
_const_fwd_iterator& operator--();
_const_fwd_iterator operator--(int);
_const_fwd_iterator operator+(difference_type n);
_const_fwd_iterator operator-(difference_type n);
_const_fwd_iterator& operator+=(difference_type n);
_const_fwd_iterator& operator-=(difference_type n);
const value_type& operator*() const;
const value_type& operator[](difference_type n) const;
_const_fwd_iterator& moveNext();
_const_fwd_iterator& movePrev();
unicode_char getCharacter() const;
friend size_type operator-(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
friend bool operator==(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
friend bool operator!=(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
friend bool operator<(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
friend bool operator<=(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
friend bool operator>(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
friend bool operator>=(const _const_fwd_iterator& left, const _const_fwd_iterator& right);
};
//#########################################################################
// REVERSE ITERATORS
//#########################################################################
class _const_rev_iterator; // forward declaration
class MYGUI_EXPORT _rev_iterator : public _base_iterator
{
public:
_rev_iterator& operator++();
_rev_iterator operator++(int);
_rev_iterator& operator--();
_rev_iterator operator--(int);
_rev_iterator operator+(difference_type n);
_rev_iterator operator-(difference_type n);
_rev_iterator& operator+=(difference_type n);
_rev_iterator& operator-=(difference_type n);
value_type& operator*() const;
value_type& operator[](difference_type n) const;
};
//#########################################################################
class MYGUI_EXPORT _const_rev_iterator : public _base_iterator
{
public:
_const_rev_iterator();
_const_rev_iterator(const _rev_iterator& i);
_const_rev_iterator& operator++();
_const_rev_iterator operator++(int);
_const_rev_iterator& operator--();
_const_rev_iterator operator--(int);
_const_rev_iterator operator+(difference_type n);
_const_rev_iterator operator-(difference_type n);
_const_rev_iterator& operator+=(difference_type n);
_const_rev_iterator& operator-=(difference_type n);
const value_type& operator*() const;
const value_type& operator[](difference_type n) const;
friend size_type operator-(const _const_rev_iterator& left, const _const_rev_iterator& right);
friend bool operator==(const _const_rev_iterator& left, const _const_rev_iterator& right);
friend bool operator!=(const _const_rev_iterator& left, const _const_rev_iterator& right);
friend bool operator<(const _const_rev_iterator& left, const _const_rev_iterator& right);
friend bool operator<=(const _const_rev_iterator& left, const _const_rev_iterator& right);
friend bool operator>(const _const_rev_iterator& left, const _const_rev_iterator& right);
friend bool operator>=(const _const_rev_iterator& left, const _const_rev_iterator& right);
};
//#########################################################################
using iterator = _fwd_iterator;
using reverse_iterator = _rev_iterator;
using const_iterator = _const_fwd_iterator;
using const_reverse_iterator = _const_rev_iterator;
UString();
UString(const UString& copy);
UString(size_type length, const code_point& ch);
UString(const code_point* str);
UString(const code_point* str, size_type length);
UString(const UString& str, size_type index, size_type length);
#if MYGUI_IS_NATIVE_WCHAR_T
UString(const wchar_t* w_str);
UString(const wchar_t* w_str, size_type length);
#endif
UString(const std::wstring& wstr);
UString(const char* c_str);
UString(const char* c_str, size_type length);
UString(const std::string& str);
explicit UString(const utf32string& str);
template<size_type num>
UString(const char (&str)[num]) :
UString(str, num)
{
}
explicit UString(std::string_view str) :
UString(str.data(), str.size())
{
}
~UString();
size_type size() const;
size_type length() const;
size_type length_Characters() const;
size_type max_size() const;
void reserve(size_type size);
void resize(size_type num, const code_point& val = 0);
void swap(UString& from);
bool empty() const;
const code_point* c_str() const;
const code_point* data() const;
size_type capacity() const;
void clear();
UString substr(size_type index, size_type num = npos) const;
void push_back(unicode_char val);
#if MYGUI_IS_NATIVE_WCHAR_T
void push_back(wchar_t val);
#endif
void push_back(code_point val);
void push_back(char val);
bool inString(unicode_char ch) const;
const std::string& asUTF8() const;
const char* asUTF8_c_str() const;
const utf32string& asUTF32() const;
const unicode_char* asUTF32_c_str() const;
const std::wstring& asWStr() const;
const wchar_t* asWStr_c_str() const;
code_point& at(size_type loc);
const code_point& at(size_type loc) const;
unicode_char getChar(size_type loc) const;
int setChar(size_type loc, unicode_char ch);
iterator begin();
const_iterator begin() const;
iterator end();
const_iterator end() const;
reverse_iterator rbegin();
const_reverse_iterator rbegin() const;
reverse_iterator rend();
const_reverse_iterator rend() const;
UString& assign(iterator start, iterator end);
UString& assign(const UString& str);
UString& assign(const code_point* str);
UString& assign(const code_point* str, size_type num);
UString& assign(const UString& str, size_type index, size_type len);
UString& assign(size_type num, const code_point& ch);
UString& assign(const std::wstring& wstr);
#if MYGUI_IS_NATIVE_WCHAR_T
UString& assign(const wchar_t* w_str);
UString& assign(const wchar_t* w_str, size_type num);
#endif
UString& assign(std::string_view str)
{
return assign(str.data(), str.size());
}
UString& assign(const utf32string& str);
UString& assign(const char* c_str, size_type num);
UString& append(const UString& str);
UString& append(const code_point* str);
UString& append(const UString& str, size_type index, size_type len);
UString& append(const code_point* str, size_type num);
UString& append(size_type num, code_point ch);
UString& append(iterator start, iterator end);
#if MYGUI_IS_NATIVE_WCHAR_T
UString& append(const wchar_t* w_str, size_type num);
UString& append(size_type num, wchar_t ch);
#endif
UString& append(const char* c_str, size_type num);
UString& append(size_type num, char ch);
UString& append(size_type num, unicode_char ch);
iterator insert(iterator i, const code_point& ch);
UString& insert(size_type index, const UString& str);
UString& insert(size_type index, const code_point* str)
{
mData.insert(index, str);
return *this;
}
UString& insert(size_type index1, const UString& str, size_type index2, size_type num);
void insert(iterator i, iterator start, iterator end);
UString& insert(size_type index, const code_point* str, size_type num);
#if MYGUI_IS_NATIVE_WCHAR_T
UString& insert(size_type index, const wchar_t* w_str, size_type num);
#endif
UString& insert(size_type index, const char* c_str, size_type num);
UString& insert(size_type index, size_type num, code_point ch);
#if MYGUI_IS_NATIVE_WCHAR_T
UString& insert(size_type index, size_type num, wchar_t ch);
#endif
UString& insert(size_type index, size_type num, char ch);
UString& insert(size_type index, size_type num, unicode_char ch);
void insert(iterator i, size_type num, const code_point& ch);
#if MYGUI_IS_NATIVE_WCHAR_T
void insert(iterator i, size_type num, const wchar_t& ch);
#endif
void insert(iterator i, size_type num, const char& ch);
void insert(iterator i, size_type num, const unicode_char& ch);
iterator erase(iterator loc);
iterator erase(iterator start, iterator end);
UString& erase(size_type index = 0, size_type num = npos);
UString& replace(size_type index1, size_type num1, const UString& str);
UString& replace(size_type index1, size_type num1, const UString& str, size_type num2);
UString& replace(size_type index1, size_type num1, const UString& str, size_type index2, size_type num2);
UString& replace(iterator start, iterator end, const UString& str, size_type num = npos);
UString& replace(size_type index, size_type num1, size_type num2, code_point ch);
UString& replace(iterator start, iterator end, size_type num, code_point ch);
int compare(const UString& str) const;
int compare(const code_point* str) const;
int compare(size_type index, size_type length, const UString& str) const;
int compare(size_type index, size_type length, const UString& str, size_type index2, size_type length2) const;
int compare(size_type index, size_type length, const code_point* str, size_type length2) const;
#if MYGUI_IS_NATIVE_WCHAR_T
int compare(size_type index, size_type length, const wchar_t* w_str, size_type length2) const;
#endif
int compare(size_type index, size_type length, const char* c_str, size_type length2) const;
size_type find(const UString& str, size_type index = 0) const;
size_type find(const code_point* cp_str, size_type index, size_type length) const;
size_type find(const char* c_str, size_type index, size_type length) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type find(const wchar_t* w_str, size_type index, size_type length) const;
#endif
size_type find(char ch, size_type index = 0) const;
size_type find(code_point ch, size_type index = 0) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type find(wchar_t ch, size_type index = 0) const;
#endif
size_type find(unicode_char ch, size_type index = 0) const;
size_type rfind(const UString& str, size_type index = 0) const;
size_type rfind(const code_point* cp_str, size_type index, size_type num) const;
size_type rfind(const char* c_str, size_type index, size_type num) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type rfind(const wchar_t* w_str, size_type index, size_type num) const;
#endif
size_type rfind(char ch, size_type index = 0) const;
size_type rfind(code_point ch, size_type index) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type rfind(wchar_t ch, size_type index = 0) const;
#endif
size_type rfind(unicode_char ch, size_type index = 0) const;
size_type find_first_of(const UString& str, size_type index = 0, size_type num = npos) const;
size_type find_first_of(code_point ch, size_type index = 0) const;
size_type find_first_of(char ch, size_type index = 0) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type find_first_of(wchar_t ch, size_type index = 0) const;
#endif
size_type find_first_of(unicode_char ch, size_type index = 0) const;
size_type find_first_not_of(const UString& str, size_type index = 0, size_type num = npos) const;
size_type find_first_not_of(code_point ch, size_type index = 0) const;
size_type find_first_not_of(char ch, size_type index = 0) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type find_first_not_of(wchar_t ch, size_type index = 0) const;
#endif
size_type find_first_not_of(unicode_char ch, size_type index = 0) const;
size_type find_last_of(const UString& str, size_type index = npos, size_type num = npos) const;
size_type find_last_of(code_point ch, size_type index = npos) const;
size_type find_last_of(char ch, size_type index = npos) const
{
return find_last_of(static_cast<code_point>(ch), index);
}
#if MYGUI_IS_NATIVE_WCHAR_T
size_type find_last_of(wchar_t ch, size_type index = npos) const;
#endif
size_type find_last_of(unicode_char ch, size_type index = npos) const;
size_type find_last_not_of(const UString& str, size_type index = npos, size_type num = npos) const;
size_type find_last_not_of(code_point ch, size_type index = npos) const;
size_type find_last_not_of(char ch, size_type index = npos) const;
#if MYGUI_IS_NATIVE_WCHAR_T
size_type find_last_not_of(wchar_t ch, size_type index = npos) const;
#endif
size_type find_last_not_of(unicode_char ch, size_type index = npos) const;
bool operator<(const UString& right) const;
bool operator<=(const UString& right) const;
bool operator>(const UString& right) const;
bool operator>=(const UString& right) const;
bool operator==(const UString& right) const;
bool operator!=(const UString& right) const;
UString& operator=(const UString& s);
UString& operator=(code_point ch);
UString& operator=(char ch);
#if MYGUI_IS_NATIVE_WCHAR_T
UString& operator=(wchar_t ch);
#endif
UString& operator=(unicode_char ch);
code_point& operator[](size_type index);
const code_point& operator[](size_type index) const;
operator std::string() const;
operator std::wstring() const;
operator std::string_view() const
{
return asUTF8();
}
static bool _utf16_independent_char(code_point cp);
static bool _utf16_surrogate_lead(code_point cp);
static bool _utf16_surrogate_follow(code_point cp);
static size_t _utf16_char_length(code_point cp);
static size_t _utf16_char_length(unicode_char uc);
static size_t _utf16_to_utf32(const code_point in_cp[2], unicode_char& out_uc);
static size_t _utf32_to_utf16(const unicode_char& in_uc, code_point out_cp[2]);
static bool _utf8_start_char(unsigned char cp);
static size_t _utf8_char_length(unsigned char cp);
static size_t _utf8_char_length(unicode_char uc);
static size_t _utf8_to_utf32(const unsigned char in_cp[6], unicode_char& out_uc);
static size_t _utf32_to_utf8(const unicode_char& in_uc, unsigned char out_cp[6]);
static size_type _verifyUTF8(const unsigned char* c_str);
static size_type _verifyUTF8(std::string_view str)
{
return _verifyUTF8(str.data(), str.size());
}
static size_type _verifyUTF8(const char* c_str, size_type num);
private:
dstring mData;
enum BufferType
{
bt_none,
bt_string,
bt_wstring,
bt_utf32string
};
void _init();
// Scratch buffer
void _cleanBuffer() const;
void _getBufferStr() const;
void _getBufferWStr() const;
void _getBufferUTF32Str() const;
void _load_buffer_UTF8() const;
void _load_buffer_WStr() const;
void _load_buffer_UTF32() const;
mutable BufferType m_bufferType; // identifies the data type held in m_buffer
mutable size_t m_bufferSize; // size of the CString buffer
// multi-purpose buffer used everywhere we need a throw-away buffer
union
{
mutable void* mVoidBuffer;
mutable std::string* mStrBuffer;
mutable std::wstring* mWStrBuffer;
mutable utf32string* mUTF32StrBuffer;
} m_buffer;
};
inline UString operator+(const UString& s1, const UString& s2)
{
return UString(s1).append(s2);
}
inline UString operator+(const UString& s1, UString::code_point c)
{
return UString(s1).append(1, c);
}
inline UString operator+(const UString& s1, UString::unicode_char c)
{
return UString(s1).append(1, c);
}
inline UString operator+(const UString& s1, char c)
{
return UString(s1).append(1, c);
}
#if MYGUI_IS_NATIVE_WCHAR_T
inline UString operator+(const UString& s1, wchar_t c)
{
return UString(s1).append(1, c);
}
#endif
inline UString operator+(UString::code_point c, const UString& s2)
{
return UString().append(1, c).append(s2);
}
inline UString operator+(UString::unicode_char c, const UString& s2)
{
return UString().append(1, c).append(s2);
}
inline UString operator+(char c, const UString& s2)
{
return UString().append(1, c).append(s2);
}
#if MYGUI_IS_NATIVE_WCHAR_T
inline UString operator+(wchar_t c, const UString& s2)
{
return UString().append(1, c).append(s2);
}
#endif
// (const) forward iterator common operators
inline UString::size_type operator-(
const UString::_const_fwd_iterator& left,
const UString::_const_fwd_iterator& right)
{
return (left.mIter - right.mIter);
}
inline bool operator==(const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right)
{
return left.mIter == right.mIter;
}
inline bool operator!=(const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right)
{
return left.mIter != right.mIter;
}
inline bool operator<(const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right)
{
return left.mIter < right.mIter;
}
inline bool operator<=(const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right)
{
return left.mIter <= right.mIter;
}
inline bool operator>(const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right)
{
return left.mIter > right.mIter;
}
inline bool operator>=(const UString::_const_fwd_iterator& left, const UString::_const_fwd_iterator& right)
{
return left.mIter >= right.mIter;
}
// (const) reverse iterator common operators
// NB: many of these operations are evaluated in reverse because this is a reverse iterator wrapping a forward iterator
inline UString::size_type operator-(
const UString::_const_rev_iterator& left,
const UString::_const_rev_iterator& right)
{
return (right.mIter - left.mIter);
}
inline bool operator==(const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right)
{
return left.mIter == right.mIter;
}
inline bool operator!=(const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right)
{
return left.mIter != right.mIter;
}
inline bool operator<(const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right)
{
return right.mIter < left.mIter;
}
inline bool operator<=(const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right)
{
return right.mIter <= left.mIter;
}
inline bool operator>(const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right)
{
return right.mIter > left.mIter;
}
inline bool operator>=(const UString::_const_rev_iterator& left, const UString::_const_rev_iterator& right)
{
return right.mIter >= left.mIter;
}
inline std::ostream& operator<<(std::ostream& os, const UString& s)
{
return os << s.asUTF8();
}
inline std::wostream& operator<<(std::wostream& os, const UString& s)
{
return os << s.asWStr();
}
#if MYGUI_COMPILER == MYGUI_COMPILER_MSVC
#pragma warning(pop)
#endif
} // namespace MyGUI
#endif // __MYGUI_U_STRING_H__
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition MyGUI_Platform.h:77
MyGUI_Prerequest.h
MyGUI_Types.h
MyGUI::UString::_base_iterator
base iterator class for UString
Definition MyGUI_UString.h:194
MyGUI::UString::_base_iterator::_movePrev
void _movePrev()
Definition MyGUI_UString.cpp:83
MyGUI::UString::_base_iterator::difference_type
ptrdiff_t difference_type
Definition MyGUI_UString.h:198
MyGUI::UString::_base_iterator::UString
friend class UString
Definition MyGUI_UString.h:195
MyGUI::UString::_base_iterator::_setCharacter
int _setCharacter(unicode_char uc)
Definition MyGUI_UString.cpp:56
MyGUI::UString::_base_iterator::_get_index
size_type _get_index() const
Definition MyGUI_UString.cpp:40
MyGUI::UString::_base_iterator::_become
void _become(const _base_iterator &i)
Definition MyGUI_UString.cpp:24
MyGUI::UString::_base_iterator::mIter
dstring::iterator mIter
Definition MyGUI_UString.h:214
MyGUI::UString::_base_iterator::_seekRev
void _seekRev(size_type c)
Definition MyGUI_UString.cpp:19
MyGUI::UString::_base_iterator::_test_begin
bool _test_begin() const
Definition MyGUI_UString.cpp:30
MyGUI::UString::_base_iterator::_test_end
bool _test_end() const
Definition MyGUI_UString.cpp:35
MyGUI::UString::_base_iterator::_jump_to
void _jump_to(size_type index)
Definition MyGUI_UString.cpp:45
MyGUI::UString::_base_iterator::mString
UString * mString
Definition MyGUI_UString.h:215
MyGUI::UString::_base_iterator::_seekFwd
void _seekFwd(size_type c)
Definition MyGUI_UString.cpp:14
MyGUI::UString::_base_iterator::_moveNext
void _moveNext()
Definition MyGUI_UString.cpp:64
MyGUI::UString::_base_iterator::_getCharacter
unicode_char _getCharacter() const
Definition MyGUI_UString.cpp:50
MyGUI::UString::_const_fwd_iterator
const forward iterator for UString
Definition MyGUI_UString.h:267
MyGUI::UString::_const_fwd_iterator::operator<=
friend bool operator<=(const _const_fwd_iterator &left, const _const_fwd_iterator &right)
less than or equal
Definition MyGUI_UString.h:1071
MyGUI::UString::_const_fwd_iterator::operator>=
friend bool operator>=(const _const_fwd_iterator &left, const _const_fwd_iterator &right)
greater than or equal
Definition MyGUI_UString.h:1079
MyGUI::UString::_const_fwd_iterator::operator!=
friend bool operator!=(const _const_fwd_iterator &left, const _const_fwd_iterator &right)
inequality operator
Definition MyGUI_UString.h:1063
MyGUI::UString::_const_fwd_iterator::operator<
friend bool operator<(const _const_fwd_iterator &left, const _const_fwd_iterator &right)
less than
Definition MyGUI_UString.h:1067
MyGUI::UString::_const_fwd_iterator::_const_fwd_iterator
_const_fwd_iterator()
MyGUI::UString::_const_fwd_iterator::operator+=
_const_fwd_iterator & operator+=(difference_type n)
addition assignment operator
Definition MyGUI_UString.cpp:258
MyGUI::UString::_const_fwd_iterator::operator++
_const_fwd_iterator & operator++()
pre-increment
Definition MyGUI_UString.cpp:212
MyGUI::UString::_const_fwd_iterator::operator-
_const_fwd_iterator operator-(difference_type n)
subtraction operator
Definition MyGUI_UString.cpp:248
MyGUI::UString::_const_fwd_iterator::operator-=
_const_fwd_iterator & operator-=(difference_type n)
subtraction assignment operator
Definition MyGUI_UString.cpp:267
MyGUI::UString::_const_fwd_iterator::moveNext
_const_fwd_iterator & moveNext()
advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream
Definition MyGUI_UString.cpp:288
MyGUI::UString::_const_fwd_iterator::operator[]
const value_type & operator[](difference_type n) const
dereference at offset operator
Definition MyGUI_UString.cpp:281
MyGUI::UString::_const_fwd_iterator::operator--
_const_fwd_iterator & operator--()
pre-decrement
Definition MyGUI_UString.cpp:225
MyGUI::UString::_const_fwd_iterator::operator==
friend bool operator==(const _const_fwd_iterator &left, const _const_fwd_iterator &right)
equality operator
Definition MyGUI_UString.h:1059
MyGUI::UString::_const_fwd_iterator::operator+
_const_fwd_iterator operator+(difference_type n)
addition operator
Definition MyGUI_UString.cpp:238
MyGUI::UString::_const_fwd_iterator::operator>
friend bool operator>(const _const_fwd_iterator &left, const _const_fwd_iterator &right)
greater than
Definition MyGUI_UString.h:1075
MyGUI::UString::_const_fwd_iterator::movePrev
_const_fwd_iterator & movePrev()
rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream
Definition MyGUI_UString.cpp:294
MyGUI::UString::_const_fwd_iterator::getCharacter
unicode_char getCharacter() const
Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed...
Definition MyGUI_UString.cpp:300
MyGUI::UString::_const_fwd_iterator::operator*
const value_type & operator*() const
dereference operator
Definition MyGUI_UString.cpp:276
MyGUI::UString::_const_rev_iterator
const reverse iterator for UString
Definition MyGUI_UString.h:359
MyGUI::UString::_const_rev_iterator::operator-
_const_rev_iterator operator-(difference_type n)
subtraction operator
Definition MyGUI_UString.cpp:429
MyGUI::UString::_const_rev_iterator::operator+
_const_rev_iterator operator+(difference_type n)
addition operator
Definition MyGUI_UString.cpp:419
MyGUI::UString::_const_rev_iterator::operator!=
friend bool operator!=(const _const_rev_iterator &left, const _const_rev_iterator &right)
inequality operator
Definition MyGUI_UString.h:1096
MyGUI::UString::_const_rev_iterator::operator++
_const_rev_iterator & operator++()
pre-increment
Definition MyGUI_UString.cpp:393
MyGUI::UString::_const_rev_iterator::operator+=
_const_rev_iterator & operator+=(difference_type n)
addition assignment operator
Definition MyGUI_UString.cpp:439
MyGUI::UString::_const_rev_iterator::operator>=
friend bool operator>=(const _const_rev_iterator &left, const _const_rev_iterator &right)
greater than or equal
Definition MyGUI_UString.h:1112
MyGUI::UString::_const_rev_iterator::operator<=
friend bool operator<=(const _const_rev_iterator &left, const _const_rev_iterator &right)
less than or equal
Definition MyGUI_UString.h:1104
MyGUI::UString::_const_rev_iterator::_const_rev_iterator
_const_rev_iterator()
MyGUI::UString::_const_rev_iterator::operator==
friend bool operator==(const _const_rev_iterator &left, const _const_rev_iterator &right)
equality operator
Definition MyGUI_UString.h:1092
MyGUI::UString::_const_rev_iterator::operator[]
const value_type & operator[](difference_type n) const
dereference at offset operator
Definition MyGUI_UString.cpp:462
MyGUI::UString::_const_rev_iterator::operator<
friend bool operator<(const _const_rev_iterator &left, const _const_rev_iterator &right)
less than
Definition MyGUI_UString.h:1100
MyGUI::UString::_const_rev_iterator::operator>
friend bool operator>(const _const_rev_iterator &left, const _const_rev_iterator &right)
greater than
Definition MyGUI_UString.h:1108
MyGUI::UString::_const_rev_iterator::operator--
_const_rev_iterator & operator--()
pre-decrement
Definition MyGUI_UString.cpp:406
MyGUI::UString::_const_rev_iterator::operator*
const value_type & operator*() const
dereference operator
Definition MyGUI_UString.cpp:457
MyGUI::UString::_const_rev_iterator::operator-=
_const_rev_iterator & operator-=(difference_type n)
subtraction assignment operator
Definition MyGUI_UString.cpp:448
MyGUI::UString::_fwd_iterator
forward iterator for UString
Definition MyGUI_UString.h:225
MyGUI::UString::_fwd_iterator::getCharacter
unicode_char getCharacter() const
Returns the Unicode value of the character at the current position (decodes surrogate pairs if needed...
Definition MyGUI_UString.cpp:192
MyGUI::UString::_fwd_iterator::operator++
_fwd_iterator & operator++()
pre-increment
Definition MyGUI_UString.cpp:104
MyGUI::UString::_fwd_iterator::operator-
_fwd_iterator operator-(difference_type n)
subtraction operator
Definition MyGUI_UString.cpp:140
MyGUI::UString::_fwd_iterator::setCharacter
int setCharacter(unicode_char uc)
Sets the Unicode value of the character at the current position (adding a surrogate pair if needed); ...
Definition MyGUI_UString.cpp:197
MyGUI::UString::_fwd_iterator::moveNext
_fwd_iterator & moveNext()
advances to the next Unicode character, honoring surrogate pairs in the UTF-16 stream
Definition MyGUI_UString.cpp:180
MyGUI::UString::_fwd_iterator::movePrev
_fwd_iterator & movePrev()
rewinds to the previous Unicode character, honoring surrogate pairs in the UTF-16 stream
Definition MyGUI_UString.cpp:186
MyGUI::UString::_fwd_iterator::operator+=
_fwd_iterator & operator+=(difference_type n)
addition assignment operator
Definition MyGUI_UString.cpp:150
MyGUI::UString::_fwd_iterator::operator-=
_fwd_iterator & operator-=(difference_type n)
subtraction assignment operator
Definition MyGUI_UString.cpp:159
MyGUI::UString::_fwd_iterator::operator+
_fwd_iterator operator+(difference_type n)
addition operator
Definition MyGUI_UString.cpp:130
MyGUI::UString::_fwd_iterator::operator*
value_type & operator*() const
dereference operator
Definition MyGUI_UString.cpp:168
MyGUI::UString::_fwd_iterator::operator--
_fwd_iterator & operator--()
pre-decrement
Definition MyGUI_UString.cpp:117
MyGUI::UString::_fwd_iterator::operator[]
value_type & operator[](difference_type n) const
dereference at offset operator
Definition MyGUI_UString.cpp:173
MyGUI::UString::_rev_iterator
forward iterator for UString
Definition MyGUI_UString.h:328
MyGUI::UString::_rev_iterator::operator+=
_rev_iterator & operator+=(difference_type n)
addition assignment operator
Definition MyGUI_UString.cpp:354
MyGUI::UString::_rev_iterator::operator--
_rev_iterator & operator--()
pre-decrement
Definition MyGUI_UString.cpp:321
MyGUI::UString::_rev_iterator::operator*
value_type & operator*() const
dereference operator
Definition MyGUI_UString.cpp:372
MyGUI::UString::_rev_iterator::operator++
_rev_iterator & operator++()
pre-increment
Definition MyGUI_UString.cpp:308
MyGUI::UString::_rev_iterator::operator-
_rev_iterator operator-(difference_type n)
subtraction operator
Definition MyGUI_UString.cpp:344
MyGUI::UString::_rev_iterator::operator-=
_rev_iterator & operator-=(difference_type n)
subtraction assignment operator
Definition MyGUI_UString.cpp:363
MyGUI::UString::_rev_iterator::operator[]
value_type & operator[](difference_type n) const
dereference at offset operator
Definition MyGUI_UString.cpp:377
MyGUI::UString::_rev_iterator::operator+
_rev_iterator operator+(difference_type n)
addition operator
Definition MyGUI_UString.cpp:334
MyGUI::UString::invalid_data::invalid_data
invalid_data(const std::string &_message)
constructor takes a string message that can be later retrieved by the what() function
Definition MyGUI_UString.h:184
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition MyGUI_UString.h:144
MyGUI::UString::mStrBuffer
std::string * mStrBuffer
Definition MyGUI_UString.h:996
MyGUI::UString::rend
reverse_iterator rend()
returns a reverse iterator just past the beginning of the string
Definition MyGUI_UString.cpp:815
MyGUI::UString::operator+
UString operator+(UString::code_point c, const UString &s2)
string addition operator
Definition MyGUI_UString.h:1030
MyGUI::UString::_verifyUTF8
static size_type _verifyUTF8(const unsigned char *c_str)
verifies a UTF-8 stream, returning the total number of Unicode characters found
Definition MyGUI_UString.cpp:1840
MyGUI::UString::length
size_type length() const
Returns the number of code points in the current string.
Definition MyGUI_UString.cpp:561
MyGUI::UString::insert
iterator insert(iterator i, const code_point &ch)
inserts ch before the code point denoted by i
Definition MyGUI_UString.cpp:1042
MyGUI::UString::asWStr_c_str
const wchar_t * asWStr_c_str() const
returns the current string in the native form of a nul-terminated wchar_t array
Definition MyGUI_UString.cpp:703
MyGUI::UString::operator>
bool operator>(const UString &right) const
greater than operator
Definition MyGUI_UString.cpp:1590
MyGUI::UString::find
size_type find(wchar_t ch, size_type index=0) const
returns the index of the first occurrence ch within the current string, starting at index; returns US...
MyGUI::UString::size
size_type size() const
Returns the number of code points in the current string.
Definition MyGUI_UString.cpp:556
MyGUI::UString::data
const code_point * data() const
returns a pointer to the first character in the current string
Definition MyGUI_UString.cpp:609
MyGUI::UString::UString
UString()
default constructor, creates an empty string
Definition MyGUI_UString.cpp:472
MyGUI::UString::compare
int compare(size_type index, size_type length, const wchar_t *w_str, size_type length2) const
compare a substring of str to a substring of the current string, where the substring of str begins at...
MyGUI::UString::asUTF8_c_str
const char * asUTF8_c_str() const
returns the current string in UTF-8 form as a nul-terminated char array
Definition MyGUI_UString.cpp:679
MyGUI::UString::_verifyUTF8
static size_type _verifyUTF8(std::string_view str)
verifies a UTF-8 stream, returning the total number of Unicode characters found
Definition MyGUI_UString.h:950
MyGUI::UString::operator==
bool operator==(const UString &right) const
equality operator
Definition MyGUI_UString.cpp:1600
MyGUI::UString::operator!=
bool operator!=(const UString &right) const
inequality operator
Definition MyGUI_UString.cpp:1605
MyGUI::UString::assign
UString & assign(const wchar_t *w_str)
assign w_str to the current string
MyGUI::UString::asUTF32_c_str
const unicode_char * asUTF32_c_str() const
returns the current string in UTF-32 form as a nul-terminated unicode_char array
Definition MyGUI_UString.cpp:691
MyGUI::UString::find
size_type find(const UString &str, size_type index=0) const
returns the index of the first occurrence of str within the current string, starting at index; return...
Definition MyGUI_UString.cpp:1268
MyGUI::UString::operator>=
bool operator>=(const UString &right) const
greater than or equal operator
Definition MyGUI_UString.cpp:1595
MyGUI::UString::rfind
size_type rfind(const UString &str, size_type index=0) const
returns the location of the first occurrence of str in the current string, doing a reverse search fro...
Definition MyGUI_UString.cpp:1317
MyGUI::UString::assign
UString & assign(std::string_view str)
assign str to the current string (str is treated as a UTF-8 stream)
Definition MyGUI_UString.h:598
MyGUI::UString::const_reverse_iterator
_const_rev_iterator const_reverse_iterator
const reverse iterator
Definition MyGUI_UString.h:410
MyGUI::UString::assign
UString & assign(const wchar_t *w_str, size_type num)
assign the first num characters of w_str to the current string
MyGUI::UString::insert
UString & insert(size_type index, const code_point *str)
inserts str into the current string, at location index
Definition MyGUI_UString.h:647
MyGUI::UString::operator+
UString operator+(const UString &s1, UString::unicode_char c)
string addition operator
Definition MyGUI_UString.h:1013
MyGUI::UString::mWStrBuffer
std::wstring * mWStrBuffer
Definition MyGUI_UString.h:997
MyGUI::UString::operator+
UString operator+(wchar_t c, const UString &s2)
string addition operator
Definition MyGUI_UString.h:1046
MyGUI::UString::asUTF32
const utf32string & asUTF32() const
returns the current string in UTF-32 form within a utf32string
Definition MyGUI_UString.cpp:685
MyGUI::UString::setChar
int setChar(size_type loc, unicode_char ch)
sets the value of the character at loc to the Unicode value ch (UTF-32)
Definition MyGUI_UString.cpp:737
MyGUI::UString::insert
UString & insert(size_type index, size_type num, wchar_t ch)
inserts num copies of ch into the current string, at location index
MyGUI::UString::assign
UString & assign(iterator start, iterator end)
gives the current string the values from start to end
Definition MyGUI_UString.cpp:831
MyGUI::UString::code_point
char16_t code_point
a single UTF-16 code point
Definition MyGUI_UString.h:169
MyGUI::UString::find_last_of
size_type find_last_of(char ch, size_type index=npos) const
returns the index of the first occurrence of ch in the current string, doing a reverse search from in...
Definition MyGUI_UString.h:828
MyGUI::UString::compare
int compare(const UString &str) const
compare str to the current string
Definition MyGUI_UString.cpp:1228
MyGUI::UString::value_type
code_point value_type
value type typedef for use in iterators
Definition MyGUI_UString.h:172
MyGUI::UString::operator<=
bool operator<=(const UString &right) const
less than or equal operator
Definition MyGUI_UString.cpp:1554
MyGUI::UString::find_first_of
size_type find_first_of(wchar_t ch, size_type index=0) const
returns the index of the first occurrence of ch in the current string, starting the search at index; ...
MyGUI::UString::unicode_char
char32_t unicode_char
a single 32-bit Unicode character
Definition MyGUI_UString.h:166
MyGUI::UString::rfind
size_type rfind(wchar_t ch, size_type index=0) const
returns the location of the first occurrence of ch in the current string, doing a reverse search from...
MyGUI::UString::utf32string
std::basic_string< unicode_char > utf32string
string type used for returning UTF-32 formatted data
Definition MyGUI_UString.h:177
MyGUI::UString::operator+
UString operator+(UString::unicode_char c, const UString &s2)
string addition operator
Definition MyGUI_UString.h:1035
MyGUI::UString::operator<<
std::ostream & operator<<(std::ostream &os, const UString &s)
std::ostream write operator
Definition MyGUI_UString.h:1118
MyGUI::UString::UString
UString(std::string_view str)
Definition MyGUI_UString.h:450
MyGUI::UString::append
UString & append(size_type num, wchar_t ch)
appends num repetitions of ch on to the end of the current string
MyGUI::UString::find_first_of
size_type find_first_of(const UString &str, size_type index=0, size_type num=npos) const
Returns the index of the first character within the current string that matches any character in str,...
Definition MyGUI_UString.cpp:1366
MyGUI::UString::rfind
size_type rfind(const wchar_t *w_str, size_type index, size_type num) const
returns the location of the first occurrence of str in the current string, doing a reverse search fro...
MyGUI::UString::operator+
UString operator+(const UString &s1, char c)
string addition operator
Definition MyGUI_UString.h:1018
MyGUI::UString::operator+
UString operator+(const UString &s1, const UString &s2)
string addition operator
Definition MyGUI_UString.h:1003
MyGUI::UString::find_first_not_of
size_type find_first_not_of(wchar_t ch, size_type index=0) const
returns the index of the first character within the current string that does not match ch,...
MyGUI::UString::insert
UString & insert(size_type index, const wchar_t *w_str, size_type num)
inserts num code points of str into the current string, at location index
MyGUI::UString::erase
iterator erase(iterator loc)
removes the code point pointed to by loc, returning an iterator to the next character
Definition MyGUI_UString.cpp:1161
MyGUI::UString::dstring
std::basic_string< code_point > dstring
Definition MyGUI_UString.h:174
MyGUI::UString::operator<
bool operator<(const UString &right) const
less than operator
Definition MyGUI_UString.cpp:1549
MyGUI::UString::UString
UString(const wchar_t *w_str, size_type length)
duplicate of w_str, length characters long
MyGUI::UString::mVoidBuffer
void * mVoidBuffer
Definition MyGUI_UString.h:995
MyGUI::UString::find_last_of
size_type find_last_of(const UString &str, size_type index=npos, size_type num=npos) const
returns the index of the first character within the current string that matches any character in str,...
Definition MyGUI_UString.cpp:1450
MyGUI::UString::end
iterator end()
returns an iterator just past the end of the string
Definition MyGUI_UString.cpp:783
MyGUI::UString::getChar
unicode_char getChar(size_type loc) const
returns the data point loc evaluated as a UTF-32 value
Definition MyGUI_UString.cpp:719
MyGUI::UString::npos
static const size_type npos
the usual constant representing: not found, no limit, etc
Definition MyGUI_UString.h:163
MyGUI::UString::operator=
UString & operator=(const UString &s)
assignment operator, implicitly casts all compatible types
Definition MyGUI_UString.cpp:1559
MyGUI::UString::insert
void insert(iterator i, size_type num, const wchar_t &ch)
inserts num copies of ch into the current string, before the code point denoted by i
MyGUI::UString::iterator
_fwd_iterator iterator
iterator
Definition MyGUI_UString.h:407
MyGUI::UString::asWStr
const std::wstring & asWStr() const
returns the current string in the native form of std::wstring
Definition MyGUI_UString.cpp:697
MyGUI::UString::mUTF32StrBuffer
utf32string * mUTF32StrBuffer
Definition MyGUI_UString.h:998
MyGUI::UString::operator=
UString & operator=(wchar_t ch)
assignment operator
MyGUI::UString::inString
bool inString(unicode_char ch) const
returns true if the given Unicode character ch is in this string
Definition MyGUI_UString.cpp:661
MyGUI::UString::operator[]
code_point & operator[](size_type index)
code point dereference operator
Definition MyGUI_UString.cpp:1610
MyGUI::UString::find_last_of
size_type find_last_of(wchar_t ch, size_type index=npos) const
returns the index of the first occurrence of ch in the current string, doing a reverse search from in...
MyGUI::UString::find_first_not_of
size_type find_first_not_of(const UString &str, size_type index=0, size_type num=npos) const
returns the index of the first character within the current string that does not match any character ...
Definition MyGUI_UString.cpp:1407
MyGUI::UString::push_back
void push_back(wchar_t val)
appends val to the end of the string
MyGUI::UString::find
size_type find(const wchar_t *w_str, size_type index, size_type length) const
returns the index of the first occurrence of str within the current string and within length code poi...
MyGUI::UString::append
UString & append(const UString &str)
appends str on to the end of the current string
Definition MyGUI_UString.cpp:960
MyGUI::UString::c_str
const code_point * c_str() const
returns a pointer to the first character in the current string
Definition MyGUI_UString.cpp:604
MyGUI::UString::at
code_point & at(size_type loc)
returns a reference to the element in the string at index loc
Definition MyGUI_UString.cpp:709
MyGUI::UString::const_iterator
_const_fwd_iterator const_iterator
const iterator
Definition MyGUI_UString.h:409
MyGUI::UString::append
UString & append(const wchar_t *w_str, size_type num)
appends num characters of str on to the end of the current string
MyGUI::UString::rbegin
reverse_iterator rbegin()
returns a reverse iterator to the last element of the string
Definition MyGUI_UString.cpp:799
MyGUI::UString::size_type
size_t size_type
size type used to indicate string size and character positions within the string
Definition MyGUI_UString.h:161
MyGUI::UString::replace
UString & replace(size_type index1, size_type num1, const UString &str)
replaces up to num1 code points of the current string (starting at index1) with str
Definition MyGUI_UString.cpp:1186
MyGUI::UString::asUTF8
const std::string & asUTF8() const
returns the current string in UTF-8 form within a std::string
Definition MyGUI_UString.cpp:673
MyGUI::UString::push_back
void push_back(unicode_char val)
appends val to the end of the string
Definition MyGUI_UString.cpp:633
MyGUI::UString::operator+
UString operator+(const UString &s1, UString::code_point c)
string addition operator
Definition MyGUI_UString.h:1008
MyGUI::UString::find_last_not_of
size_type find_last_not_of(wchar_t ch, size_type index=npos) const
returns the index of the last occurrence of a character that does not match ch in the current string,...
MyGUI::UString::UString
UString(const char(&str)[num])
Definition MyGUI_UString.h:445
MyGUI::UString::operator+
UString operator+(const UString &s1, wchar_t c)
string addition operator
Definition MyGUI_UString.h:1024
MyGUI::UString::operator<<
std::wostream & operator<<(std::wostream &os, const UString &s)
std::wostream write operator
Definition MyGUI_UString.h:1124
MyGUI::UString::begin
iterator begin()
returns an iterator to the first element of the string
Definition MyGUI_UString.cpp:767
MyGUI::UString::find_last_not_of
size_type find_last_not_of(const UString &str, size_type index=npos, size_type num=npos) const
returns the index of the last character within the current string that does not match any character i...
Definition MyGUI_UString.cpp:1496
MyGUI::UString::operator+
UString operator+(char c, const UString &s2)
string addition operator
Definition MyGUI_UString.h:1040
MyGUI::UString::reverse_iterator
_rev_iterator reverse_iterator
reverse iterator
Definition MyGUI_UString.h:408
MyGUI::UString::UString
UString(const wchar_t *w_str)
duplicate of nul-terminated wchar_t array
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::operator-
UString::size_type operator-(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1053
MyGUI::operator<=
bool operator<=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1071
MyGUI::operator==
bool operator==(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1059
MyGUI::operator>=
bool operator>=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1079
MyGUI::operator>
bool operator>(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1075
MyGUI::operator!=
bool operator!=(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1063
MyGUI::len
float len(float x, float y)
Definition MyGUI_PolygonalSkin.cpp:22
MyGUI::operator<
bool operator<(const UString::_const_fwd_iterator &left, const UString::_const_fwd_iterator &right)
Definition MyGUI_UString.h:1067