diff options
Diffstat (limited to 'source/modules/asura-core/font')
-rw-r--r-- | source/modules/asura-core/font/string.cpp | 752 | ||||
-rw-r--r-- | source/modules/asura-core/font/string.hpp | 1189 |
2 files changed, 971 insertions, 970 deletions
diff --git a/source/modules/asura-core/font/string.cpp b/source/modules/asura-core/font/string.cpp index 8c9c55a..72acaa6 100644 --- a/source/modules/asura-core/font/string.cpp +++ b/source/modules/asura-core/font/string.cpp @@ -1,376 +1,376 @@ -#include "String.hpp" -#include "Utf.hpp" - -namespace AsuraEngine -{ - namespace Text - { - - - //////////////////////////////////////////////////////////// - const std::size_t String::InvalidPos = std::basic_string<uint32>::npos; - - - //////////////////////////////////////////////////////////// - String::String() - { - } - - - //////////////////////////////////////////////////////////// - String::String(char ansiChar, const std::locale& locale) - { - mString += Utf32::DecodeAnsi(ansiChar, locale); - } - - - //////////////////////////////////////////////////////////// - String::String(wchar_t wideChar) - { - mString += Utf32::DecodeWide(wideChar); - } - - - //////////////////////////////////////////////////////////// - String::String(uint32 utf32Char) - { - mString += utf32Char; - } - - - //////////////////////////////////////////////////////////// - String::String(const char* ansiString, const std::locale& locale) - { - if (ansiString) - { - std::size_t length = strlen(ansiString); - if (length > 0) - { - mString.reserve(length + 1); - Utf32::FromAnsi(ansiString, ansiString + length, std::back_inserter(mString), locale); - } - } - } - - - //////////////////////////////////////////////////////////// - String::String(const std::string& ansiString, const std::locale& locale) - { - mString.reserve(ansiString.length() + 1); - Utf32::FromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(mString), locale); - } - - - //////////////////////////////////////////////////////////// - String::String(const wchar_t* wideString) - { - if (wideString) - { - std::size_t length = std::wcslen(wideString); - if (length > 0) - { - mString.reserve(length + 1); - Utf32::FromWide(wideString, wideString + length, std::back_inserter(mString)); - } - } - } - - - //////////////////////////////////////////////////////////// - String::String(const std::wstring& wideString) - { - mString.reserve(wideString.length() + 1); - Utf32::FromWide(wideString.begin(), wideString.end(), std::back_inserter(mString)); - } - - - //////////////////////////////////////////////////////////// - String::String(const uint32* utf32String) - { - if (utf32String) - mString = utf32String; - } - - - //////////////////////////////////////////////////////////// - String::String(const std::basic_string<uint32>& utf32String) : - mString(utf32String) - { - } - - - //////////////////////////////////////////////////////////// - String::String(const String& copy) : - mString(copy.mString) - { - } - - - //////////////////////////////////////////////////////////// - String::operator std::string() const - { - return ToAnsiString(); - } - - - //////////////////////////////////////////////////////////// - String::operator std::wstring() const - { - return ToWideString(); - } - - - //////////////////////////////////////////////////////////// - std::string String::ToAnsiString(const std::locale& locale) const - { - // Prepare the output string - std::string output; - output.reserve(mString.length() + 1); - - // Convert - Utf32::ToAnsi(mString.begin(), mString.end(), std::back_inserter(output), 0, locale); - - return output; - } - - - //////////////////////////////////////////////////////////// - std::wstring String::ToWideString() const - { - // Prepare the output string - std::wstring output; - output.reserve(mString.length() + 1); - - // Convert - Utf32::ToWide(mString.begin(), mString.end(), std::back_inserter(output), 0); - - return output; - } - - - //////////////////////////////////////////////////////////// - std::basic_string<uint8> String::ToUtf8() const - { - // Prepare the output string - std::basic_string<uint8> output; - output.reserve(mString.length()); - - // Convert - Utf32::ToUtf8(mString.begin(), mString.end(), std::back_inserter(output)); - - return output; - } - - - //////////////////////////////////////////////////////////// - std::basic_string<uint16> String::ToUtf16() const - { - // Prepare the output string - std::basic_string<uint16> output; - output.reserve(mString.length()); - - // Convert - Utf32::ToUtf16(mString.begin(), mString.end(), std::back_inserter(output)); - - return output; - } - - - //////////////////////////////////////////////////////////// - std::basic_string<uint32> String::ToUtf32() const - { - return mString; - } - - - //////////////////////////////////////////////////////////// - String& String::operator =(const String& right) - { - mString = right.mString; - return *this; - } - - - //////////////////////////////////////////////////////////// - String& String::operator +=(const String& right) - { - mString += right.mString; - return *this; - } - - - //////////////////////////////////////////////////////////// - uint32 String::operator [](std::size_t index) const - { - return mString[index]; - } - - - //////////////////////////////////////////////////////////// - uint32& String::operator [](std::size_t index) - { - return mString[index]; - } - - - //////////////////////////////////////////////////////////// - void String::Clear() - { - mString.clear(); - } - - - //////////////////////////////////////////////////////////// - std::size_t String::GetSize() const - { - return mString.size(); - } - - - //////////////////////////////////////////////////////////// - bool String::IsEmpty() const - { - return mString.empty(); - } - - - //////////////////////////////////////////////////////////// - void String::Erase(std::size_t position, std::size_t count) - { - mString.erase(position, count); - } - - - //////////////////////////////////////////////////////////// - void String::Insert(std::size_t position, const String& str) - { - mString.insert(position, str.mString); - } - - - //////////////////////////////////////////////////////////// - std::size_t String::Find(const String& str, std::size_t start) const - { - return mString.find(str.mString, start); - } - - - //////////////////////////////////////////////////////////// - void String::Replace(std::size_t position, std::size_t length, const String& replaceWith) - { - mString.replace(position, length, replaceWith.mString); - } - - - //////////////////////////////////////////////////////////// - void String::Replace(const String& searchFor, const String& replaceWith) - { - std::size_t step = replaceWith.GetSize(); - std::size_t len = searchFor.GetSize(); - std::size_t pos = Find(searchFor); - - // Replace each occurrence of search - while (pos != InvalidPos) - { - Replace(pos, len, replaceWith); - pos = Find(searchFor, pos + step); - } - } - - - //////////////////////////////////////////////////////////// - String String::Substring(std::size_t position, std::size_t length) const - { - return mString.substr(position, length); - } - - - //////////////////////////////////////////////////////////// - const uint32* String::GetData() const - { - return mString.c_str(); - } - - - //////////////////////////////////////////////////////////// - String::Iterator String::Begin() - { - return mString.begin(); - } - - - //////////////////////////////////////////////////////////// - String::ConstIterator String::Begin() const - { - return mString.begin(); - } - - - //////////////////////////////////////////////////////////// - String::Iterator String::End() - { - return mString.end(); - } - - - //////////////////////////////////////////////////////////// - String::ConstIterator String::End() const - { - return mString.end(); - } - - - //////////////////////////////////////////////////////////// - bool operator ==(const String& left, const String& right) - { - return left.mString == right.mString; - } - - - //////////////////////////////////////////////////////////// - bool operator !=(const String& left, const String& right) - { - return !(left == right); - } - - - //////////////////////////////////////////////////////////// - bool operator <(const String& left, const String& right) - { - return left.mString < right.mString; - } - - - //////////////////////////////////////////////////////////// - bool operator >(const String& left, const String& right) - { - return right < left; - } - - - //////////////////////////////////////////////////////////// - bool operator <=(const String& left, const String& right) - { - return !(right < left); - } - - - //////////////////////////////////////////////////////////// - bool operator >=(const String& left, const String& right) - { - return !(left < right); - } - - - //////////////////////////////////////////////////////////// - String operator +(const String& left, const String& right) - { - String string = left; - string += right; - - return string; - } - - - } -} +//#include "String.hpp" +//#include "Utf.hpp" +// +//namespace AsuraEngine +//{ +// namespace Text +// { +// +// +// //////////////////////////////////////////////////////////// +// const std::size_t String::InvalidPos = std::basic_string<uint32>::npos; +// +// +// //////////////////////////////////////////////////////////// +// String::String() +// { +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(char ansiChar, const std::locale& locale) +// { +// mString += Utf32::DecodeAnsi(ansiChar, locale); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(wchar_t wideChar) +// { +// mString += Utf32::DecodeWide(wideChar); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(uint32 utf32Char) +// { +// mString += utf32Char; +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const char* ansiString, const std::locale& locale) +// { +// if (ansiString) +// { +// std::size_t length = strlen(ansiString); +// if (length > 0) +// { +// mString.reserve(length + 1); +// Utf32::FromAnsi(ansiString, ansiString + length, std::back_inserter(mString), locale); +// } +// } +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const std::string& ansiString, const std::locale& locale) +// { +// mString.reserve(ansiString.length() + 1); +// Utf32::FromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(mString), locale); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const wchar_t* wideString) +// { +// if (wideString) +// { +// std::size_t length = std::wcslen(wideString); +// if (length > 0) +// { +// mString.reserve(length + 1); +// Utf32::FromWide(wideString, wideString + length, std::back_inserter(mString)); +// } +// } +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const std::wstring& wideString) +// { +// mString.reserve(wideString.length() + 1); +// Utf32::FromWide(wideString.begin(), wideString.end(), std::back_inserter(mString)); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const uint32* utf32String) +// { +// if (utf32String) +// mString = utf32String; +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const std::basic_string<uint32>& utf32String) : +// mString(utf32String) +// { +// } +// +// +// //////////////////////////////////////////////////////////// +// String::String(const String& copy) : +// mString(copy.mString) +// { +// } +// +// +// //////////////////////////////////////////////////////////// +// String::operator std::string() const +// { +// return ToAnsiString(); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::operator std::wstring() const +// { +// return ToWideString(); +// } +// +// +// //////////////////////////////////////////////////////////// +// std::string String::ToAnsiString(const std::locale& locale) const +// { +// // Prepare the output string +// std::string output; +// output.reserve(mString.length() + 1); +// +// // Convert +// Utf32::ToAnsi(mString.begin(), mString.end(), std::back_inserter(output), 0, locale); +// +// return output; +// } +// +// +// //////////////////////////////////////////////////////////// +// std::wstring String::ToWideString() const +// { +// // Prepare the output string +// std::wstring output; +// output.reserve(mString.length() + 1); +// +// // Convert +// Utf32::ToWide(mString.begin(), mString.end(), std::back_inserter(output), 0); +// +// return output; +// } +// +// +// //////////////////////////////////////////////////////////// +// std::basic_string<uint8> String::ToUtf8() const +// { +// // Prepare the output string +// std::basic_string<uint8> output; +// output.reserve(mString.length()); +// +// // Convert +// Utf32::ToUtf8(mString.begin(), mString.end(), std::back_inserter(output)); +// +// return output; +// } +// +// +// //////////////////////////////////////////////////////////// +// std::basic_string<uint16> String::ToUtf16() const +// { +// // Prepare the output string +// std::basic_string<uint16> output; +// output.reserve(mString.length()); +// +// // Convert +// Utf32::ToUtf16(mString.begin(), mString.end(), std::back_inserter(output)); +// +// return output; +// } +// +// +// //////////////////////////////////////////////////////////// +// std::basic_string<uint32> String::ToUtf32() const +// { +// return mString; +// } +// +// +// //////////////////////////////////////////////////////////// +// String& String::operator =(const String& right) +// { +// mString = right.mString; +// return *this; +// } +// +// +// //////////////////////////////////////////////////////////// +// String& String::operator +=(const String& right) +// { +// mString += right.mString; +// return *this; +// } +// +// +// //////////////////////////////////////////////////////////// +// uint32 String::operator [](std::size_t index) const +// { +// return mString[index]; +// } +// +// +// //////////////////////////////////////////////////////////// +// uint32& String::operator [](std::size_t index) +// { +// return mString[index]; +// } +// +// +// //////////////////////////////////////////////////////////// +// void String::Clear() +// { +// mString.clear(); +// } +// +// +// //////////////////////////////////////////////////////////// +// std::size_t String::GetSize() const +// { +// return mString.size(); +// } +// +// +// //////////////////////////////////////////////////////////// +// bool String::IsEmpty() const +// { +// return mString.empty(); +// } +// +// +// //////////////////////////////////////////////////////////// +// void String::Erase(std::size_t position, std::size_t count) +// { +// mString.erase(position, count); +// } +// +// +// //////////////////////////////////////////////////////////// +// void String::Insert(std::size_t position, const String& str) +// { +// mString.insert(position, str.mString); +// } +// +// +// //////////////////////////////////////////////////////////// +// std::size_t String::Find(const String& str, std::size_t start) const +// { +// return mString.find(str.mString, start); +// } +// +// +// //////////////////////////////////////////////////////////// +// void String::Replace(std::size_t position, std::size_t length, const String& replaceWith) +// { +// mString.replace(position, length, replaceWith.mString); +// } +// +// +// //////////////////////////////////////////////////////////// +// void String::Replace(const String& searchFor, const String& replaceWith) +// { +// std::size_t step = replaceWith.GetSize(); +// std::size_t len = searchFor.GetSize(); +// std::size_t pos = Find(searchFor); +// +// // Replace each occurrence of search +// while (pos != InvalidPos) +// { +// Replace(pos, len, replaceWith); +// pos = Find(searchFor, pos + step); +// } +// } +// +// +// //////////////////////////////////////////////////////////// +// String String::Substring(std::size_t position, std::size_t length) const +// { +// return mString.substr(position, length); +// } +// +// +// //////////////////////////////////////////////////////////// +// const uint32* String::GetData() const +// { +// return mString.c_str(); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::Iterator String::Begin() +// { +// return mString.begin(); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::ConstIterator String::Begin() const +// { +// return mString.begin(); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::Iterator String::End() +// { +// return mString.end(); +// } +// +// +// //////////////////////////////////////////////////////////// +// String::ConstIterator String::End() const +// { +// return mString.end(); +// } +// +// +// //////////////////////////////////////////////////////////// +// bool operator ==(const String& left, const String& right) +// { +// return left.mString == right.mString; +// } +// +// +// //////////////////////////////////////////////////////////// +// bool operator !=(const String& left, const String& right) +// { +// return !(left == right); +// } +// +// +// //////////////////////////////////////////////////////////// +// bool operator <(const String& left, const String& right) +// { +// return left.mString < right.mString; +// } +// +// +// //////////////////////////////////////////////////////////// +// bool operator >(const String& left, const String& right) +// { +// return right < left; +// } +// +// +// //////////////////////////////////////////////////////////// +// bool operator <=(const String& left, const String& right) +// { +// return !(right < left); +// } +// +// +// //////////////////////////////////////////////////////////// +// bool operator >=(const String& left, const String& right) +// { +// return !(left < right); +// } +// +// +// //////////////////////////////////////////////////////////// +// String operator +(const String& left, const String& right) +// { +// String string = left; +// string += right; +// +// return string; +// } +// +// +// } +//} diff --git a/source/modules/asura-core/font/string.hpp b/source/modules/asura-core/font/string.hpp index 226735b..5a48eb7 100644 --- a/source/modules/asura-core/font/string.hpp +++ b/source/modules/asura-core/font/string.hpp @@ -1,594 +1,595 @@ -#ifndef __ASURA_ENGINE_STRING_H__ -#define __ASURA_ENGINE_STRING_H__ - -#include "Config.h" -#include <iterator> -#include <locale> -#include <string> - -namespace AsuraEngine -{ - namespace Text - { - - - //////////////////////////////////////////////////////////// - /// \brief Utility string class that automatically handles - /// conversions between types and encodings - /// - //////////////////////////////////////////////////////////// - class String - { - public: - - //////////////////////////////////////////////////////////// - // Types - //////////////////////////////////////////////////////////// - typedef std::basic_string<uint32>::iterator Iterator; ///< Iterator type - typedef std::basic_string<uint32>::const_iterator ConstIterator; ///< Read-only iterator type - - //////////////////////////////////////////////////////////// - // Static member data - //////////////////////////////////////////////////////////// - static const std::size_t InvalidPos; ///< Represents an invalid position in the string - - //////////////////////////////////////////////////////////// - /// \brief Default constructor - /// - /// This constructor creates an empty string. - /// - //////////////////////////////////////////////////////////// - String(); - - //////////////////////////////////////////////////////////// - /// \brief Construct from a single ANSI character and a locale - /// - /// The source character is converted to UTF-32 according - /// to the given locale. - /// - /// \param ansiChar ANSI character to convert - /// \param locale Locale to use for conversion - /// - //////////////////////////////////////////////////////////// - String(char ansiChar, const std::locale& locale = std::locale()); - - //////////////////////////////////////////////////////////// - /// \brief Construct from single wide character - /// - /// \param wideChar Wide character to convert - /// - //////////////////////////////////////////////////////////// - String(wchar_t wideChar); - - //////////////////////////////////////////////////////////// - /// \brief Construct from single UTF-32 character - /// - /// \param utf32Char UTF-32 character to convert - /// - //////////////////////////////////////////////////////////// - String(uint utf32Char); - - //////////////////////////////////////////////////////////// - /// \brief Construct from a null-terminated C-style ANSI string and a locale - /// - /// The source string is converted to UTF-32 according - /// to the given locale. - /// - /// \param ansiString ANSI string to convert - /// \param locale Locale to use for conversion - /// - //////////////////////////////////////////////////////////// - String(const char* ansiString, const std::locale& locale = std::locale()); - - //////////////////////////////////////////////////////////// - /// \brief Construct from an ANSI string and a locale - /// - /// The source string is converted to UTF-32 according - /// to the given locale. - /// - /// \param ansiString ANSI string to convert - /// \param locale Locale to use for conversion - /// - //////////////////////////////////////////////////////////// - String(const std::string& ansiString, const std::locale& locale = std::locale()); - - //////////////////////////////////////////////////////////// - /// \brief Construct from null-terminated C-style wide string - /// - /// \param wideString Wide string to convert - /// - //////////////////////////////////////////////////////////// - String(const wchar_t* wideString); - - //////////////////////////////////////////////////////////// - /// \brief Construct from a wide string - /// - /// \param wideString Wide string to convert - /// - //////////////////////////////////////////////////////////// - String(const std::wstring& wideString); - - //////////////////////////////////////////////////////////// - /// \brief Construct from a null-terminated C-style UTF-32 string - /// - /// \param utf32String UTF-32 string to assign - /// - //////////////////////////////////////////////////////////// - String(const uint* utf32String); - - //////////////////////////////////////////////////////////// - /// \brief Construct from an UTF-32 string - /// - /// \param utf32String UTF-32 string to assign - /// - //////////////////////////////////////////////////////////// - String(const std::basic_string<uint>& utf32String); - - //////////////////////////////////////////////////////////// - /// \brief Copy constructor - /// - /// \param copy Instance to copy - /// - //////////////////////////////////////////////////////////// - String(const String& copy); - - //////////////////////////////////////////////////////////// - /// \brief Create a new sf::String from a UTF-8 encoded string - /// - /// \param begin Forward iterator to the beginning of the UTF-8 sequence - /// \param end Forward iterator to the end of the UTF-8 sequence - /// - /// \return A sf::String containing the source string - /// - /// \see fromUtf16, fromUtf32 - /// - //////////////////////////////////////////////////////////// - template <typename T> - static String FromUtf8(T begin, T end); - - //////////////////////////////////////////////////////////// - /// \brief Create a new sf::String from a UTF-16 encoded string - /// - /// \param begin Forward iterator to the beginning of the UTF-16 sequence - /// \param end Forward iterator to the end of the UTF-16 sequence - /// - /// \return A sf::String containing the source string - /// - /// \see fromUtf8, fromUtf32 - /// - //////////////////////////////////////////////////////////// - template <typename T> - static String FromUtf16(T begin, T end); - - //////////////////////////////////////////////////////////// - /// \brief Create a new sf::String from a UTF-32 encoded string - /// - /// This function is provided for consistency, it is equivalent to - /// using the constructors that takes a const sf::uint* or - /// a std::basic_string<sf::uint>. - /// - /// \param begin Forward iterator to the beginning of the UTF-32 sequence - /// \param end Forward iterator to the end of the UTF-32 sequence - /// - /// \return A sf::String containing the source string - /// - /// \see fromUtf8, fromUtf16 - /// - //////////////////////////////////////////////////////////// - template <typename T> - static String FromUtf32(T begin, T end); - - //////////////////////////////////////////////////////////// - /// \brief Implicit conversion operator to std::string (ANSI string) - /// - /// The current global locale is used for conversion. If you - /// want to explicitly specify a locale, see toAnsiString. - /// Characters that do not fit in the target encoding are - /// discarded from the returned string. - /// This operator is defined for convenience, and is equivalent - /// to calling toAnsiString(). - /// - /// \return Converted ANSI string - /// - /// \see toAnsiString, operator std::wstring - /// - //////////////////////////////////////////////////////////// - operator std::string() const; - - //////////////////////////////////////////////////////////// - /// \brief Implicit conversion operator to std::wstring (wide string) - /// - /// Characters that do not fit in the target encoding are - /// discarded from the returned string. - /// This operator is defined for convenience, and is equivalent - /// to calling toWideString(). - /// - /// \return Converted wide string - /// - /// \see toWideString, operator std::string - /// - //////////////////////////////////////////////////////////// - operator std::wstring() const; - - //////////////////////////////////////////////////////////// - /// \brief Convert the Unicode string to an ANSI string - /// - /// The UTF-32 string is converted to an ANSI string in - /// the encoding defined by \a locale. - /// Characters that do not fit in the target encoding are - /// discarded from the returned string. - /// - /// \param locale Locale to use for conversion - /// - /// \return Converted ANSI string - /// - /// \see toWideString, operator std::string - /// - //////////////////////////////////////////////////////////// - std::string ToAnsiString(const std::locale& locale = std::locale()) const; - - //////////////////////////////////////////////////////////// - /// \brief Convert the Unicode string to a wide string - /// - /// Characters that do not fit in the target encoding are - /// discarded from the returned string. - /// - /// \return Converted wide string - /// - /// \see toAnsiString, operator std::wstring - /// - //////////////////////////////////////////////////////////// - std::wstring ToWideString() const; - - //////////////////////////////////////////////////////////// - /// \brief Convert the Unicode string to a UTF-8 string - /// - /// \return Converted UTF-8 string - /// - /// \see toUtf16, toUtf32 - /// - //////////////////////////////////////////////////////////// - std::basic_string<uint8> ToUtf8() const; - - //////////////////////////////////////////////////////////// - /// \brief Convert the Unicode string to a UTF-16 string - /// - /// \return Converted UTF-16 string - /// - /// \see toUtf8, toUtf32 - /// - //////////////////////////////////////////////////////////// - std::basic_string<uint16> ToUtf16() const; - - //////////////////////////////////////////////////////////// - /// \brief Convert the Unicode string to a UTF-32 string - /// - /// This function doesn't perform any conversion, since the - /// string is already stored as UTF-32 internally. - /// - /// \return Converted UTF-32 string - /// - /// \see toUtf8, toUtf16 - /// - //////////////////////////////////////////////////////////// - std::basic_string<uint> ToUtf32() const; - - //////////////////////////////////////////////////////////// - /// \brief Overload of assignment operator - /// - /// \param right Instance to assign - /// - /// \return Reference to self - /// - //////////////////////////////////////////////////////////// - String& operator =(const String& right); - - //////////////////////////////////////////////////////////// - /// \brief Overload of += operator to append an UTF-32 string - /// - /// \param right String to append - /// - /// \return Reference to self - /// - //////////////////////////////////////////////////////////// - String& operator +=(const String& right); - - //////////////////////////////////////////////////////////// - /// \brief Overload of [] operator to access a character by its position - /// - /// This function provides read-only access to characters. - /// Note: the behavior is undefined if \a index is out of range. - /// - /// \param index Index of the character to get - /// - /// \return Character at position \a index - /// - //////////////////////////////////////////////////////////// - uint operator [](std::size_t index) const; - - //////////////////////////////////////////////////////////// - /// \brief Overload of [] operator to access a character by its position - /// - /// This function provides read and write access to characters. - /// Note: the behavior is undefined if \a index is out of range. - /// - /// \param index Index of the character to get - /// - /// \return Reference to the character at position \a index - /// - //////////////////////////////////////////////////////////// - uint& operator [](std::size_t index); - - //////////////////////////////////////////////////////////// - /// \brief Clear the string - /// - /// This function removes all the characters from the string. - /// - /// \see isEmpty, erase - /// - //////////////////////////////////////////////////////////// - void Clear(); - - //////////////////////////////////////////////////////////// - /// \brief Get the size of the string - /// - /// \return Number of characters in the string - /// - /// \see isEmpty - /// - //////////////////////////////////////////////////////////// - std::size_t GetSize() const; - - //////////////////////////////////////////////////////////// - /// \brief Check whether the string is empty or not - /// - /// \return True if the string is empty (i.e. contains no character) - /// - /// \see clear, getSize - /// - //////////////////////////////////////////////////////////// - bool IsEmpty() const; - - //////////////////////////////////////////////////////////// - /// \brief Erase one or more characters from the string - /// - /// This function removes a sequence of \a count characters - /// starting from \a position. - /// - /// \param position Position of the first character to erase - /// \param count Number of characters to erase - /// - //////////////////////////////////////////////////////////// - void Erase(std::size_t position, std::size_t count = 1); - - //////////////////////////////////////////////////////////// - /// \brief Insert one or more characters into the string - /// - /// This function inserts the characters of \a str - /// into the string, starting from \a position. - /// - /// \param position Position of insertion - /// \param str Characters to insert - /// - //////////////////////////////////////////////////////////// - void Insert(std::size_t position, const String& str); - - //////////////////////////////////////////////////////////// - /// \brief Find a sequence of one or more characters in the string - /// - /// This function searches for the characters of \a str - /// in the string, starting from \a start. - /// - /// \param str Characters to find - /// \param start Where to begin searching - /// - /// \return Position of \a str in the string, or String::InvalidPos if not found - /// - //////////////////////////////////////////////////////////// - std::size_t Find(const String& str, std::size_t start = 0) const; - - //////////////////////////////////////////////////////////// - /// \brief Replace a substring with another string - /// - /// This function replaces the substring that starts at index \a position - /// and spans \a length characters with the string \a replaceWith. - /// - /// \param position Index of the first character to be replaced - /// \param length Number of characters to replace. You can pass InvalidPos to - /// replace all characters until the end of the string. - /// \param replaceWith String that replaces the given substring. - /// - //////////////////////////////////////////////////////////// - void Replace(std::size_t position, std::size_t length, const String& replaceWith); - - //////////////////////////////////////////////////////////// - /// \brief Replace all occurrences of a substring with a replacement string - /// - /// This function replaces all occurrences of \a searchFor in this string - /// with the string \a replaceWith. - /// - /// \param searchFor The value being searched for - /// \param replaceWith The value that replaces found \a searchFor values - /// - //////////////////////////////////////////////////////////// - void Replace(const String& searchFor, const String& replaceWith); - - //////////////////////////////////////////////////////////// - /// \brief Return a part of the string - /// - /// This function returns the substring that starts at index \a position - /// and spans \a length characters. - /// - /// \param position Index of the first character - /// \param length Number of characters to include in the substring (if - /// the string is shorter, as many characters as possible - /// are included). \ref InvalidPos can be used to include all - /// characters until the end of the string. - /// - /// \return String object containing a substring of this object - /// - //////////////////////////////////////////////////////////// - String Substring(std::size_t position, std::size_t length = InvalidPos) const; - - //////////////////////////////////////////////////////////// - /// \brief Get a pointer to the C-style array of characters - /// - /// This functions provides a read-only access to a - /// null-terminated C-style representation of the string. - /// The returned pointer is temporary and is meant only for - /// immediate use, thus it is not recommended to store it. - /// - /// \return Read-only pointer to the array of characters - /// - //////////////////////////////////////////////////////////// - const uint* GetData() const; - - //////////////////////////////////////////////////////////// - /// \brief Return an iterator to the beginning of the string - /// - /// \return Read-write iterator to the beginning of the string characters - /// - /// \see end - /// - //////////////////////////////////////////////////////////// - Iterator Begin(); - - //////////////////////////////////////////////////////////// - /// \brief Return an iterator to the beginning of the string - /// - /// \return Read-only iterator to the beginning of the string characters - /// - /// \see end - /// - //////////////////////////////////////////////////////////// - ConstIterator Begin() const; - - //////////////////////////////////////////////////////////// - /// \brief Return an iterator to the end of the string - /// - /// The end iterator refers to 1 position past the last character; - /// thus it represents an invalid character and should never be - /// accessed. - /// - /// \return Read-write iterator to the end of the string characters - /// - /// \see begin - /// - //////////////////////////////////////////////////////////// - Iterator End(); - - //////////////////////////////////////////////////////////// - /// \brief Return an iterator to the end of the string - /// - /// The end iterator refers to 1 position past the last character; - /// thus it represents an invalid character and should never be - /// accessed. - /// - /// \return Read-only iterator to the end of the string characters - /// - /// \see begin - /// - //////////////////////////////////////////////////////////// - ConstIterator End() const; - - private: - - friend bool operator ==(const String& left, const String& right); - friend bool operator <(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - // Member data - //////////////////////////////////////////////////////////// - std::basic_string<uint> mString; ///< Internal string of UTF-32 characters - }; - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of == operator to compare two UTF-32 strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return True if both strings are equal - /// - //////////////////////////////////////////////////////////// - bool operator ==(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of != operator to compare two UTF-32 strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return True if both strings are different - /// - //////////////////////////////////////////////////////////// - bool operator !=(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of < operator to compare two UTF-32 strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return True if \a left is lexicographically before \a right - /// - //////////////////////////////////////////////////////////// - bool operator <(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of > operator to compare two UTF-32 strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return True if \a left is lexicographically after \a right - /// - //////////////////////////////////////////////////////////// - bool operator >(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of <= operator to compare two UTF-32 strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return True if \a left is lexicographically before or equivalent to \a right - /// - //////////////////////////////////////////////////////////// - bool operator <=(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of >= operator to compare two UTF-32 strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return True if \a left is lexicographically after or equivalent to \a right - /// - //////////////////////////////////////////////////////////// - bool operator >=(const String& left, const String& right); - - //////////////////////////////////////////////////////////// - /// \relates String - /// \brief Overload of binary + operator to concatenate two strings - /// - /// \param left Left operand (a string) - /// \param right Right operand (a string) - /// - /// \return Concatenated string - /// - //////////////////////////////////////////////////////////// - String operator +(const String& left, const String& right); - - #include "String.inl" - - } -} - -#endif
\ No newline at end of file +//#ifndef __ASURA_ENGINE_STRING_H__ +//#define __ASURA_ENGINE_STRING_H__ +// +//#include <asura-utils/type.h> +// +//#include <iterator> +//#include <locale> +//#include <string> +// +//namespace AsuraEngine +//{ +// namespace Text +// { +// +// +// //////////////////////////////////////////////////////////// +// /// \brief Utility string class that automatically handles +// /// conversions between types and encodings +// /// +// //////////////////////////////////////////////////////////// +// class String +// { +// public: +// +// //////////////////////////////////////////////////////////// +// // Types +// //////////////////////////////////////////////////////////// +// typedef std::basic_string<uint32>::iterator Iterator; ///< Iterator type +// typedef std::basic_string<uint32>::const_iterator ConstIterator; ///< Read-only iterator type +// +// //////////////////////////////////////////////////////////// +// // Static member data +// //////////////////////////////////////////////////////////// +// static const std::size_t InvalidPos; ///< Represents an invalid position in the string +// +// //////////////////////////////////////////////////////////// +// /// \brief Default constructor +// /// +// /// This constructor creates an empty string. +// /// +// //////////////////////////////////////////////////////////// +// String(); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from a single ANSI character and a locale +// /// +// /// The source character is converted to UTF-32 according +// /// to the given locale. +// /// +// /// \param ansiChar ANSI character to convert +// /// \param locale Locale to use for conversion +// /// +// //////////////////////////////////////////////////////////// +// String(char ansiChar, const std::locale& locale = std::locale()); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from single wide character +// /// +// /// \param wideChar Wide character to convert +// /// +// //////////////////////////////////////////////////////////// +// String(wchar_t wideChar); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from single UTF-32 character +// /// +// /// \param utf32Char UTF-32 character to convert +// /// +// //////////////////////////////////////////////////////////// +// String(uint utf32Char); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from a null-terminated C-style ANSI string and a locale +// /// +// /// The source string is converted to UTF-32 according +// /// to the given locale. +// /// +// /// \param ansiString ANSI string to convert +// /// \param locale Locale to use for conversion +// /// +// //////////////////////////////////////////////////////////// +// String(const char* ansiString, const std::locale& locale = std::locale()); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from an ANSI string and a locale +// /// +// /// The source string is converted to UTF-32 according +// /// to the given locale. +// /// +// /// \param ansiString ANSI string to convert +// /// \param locale Locale to use for conversion +// /// +// //////////////////////////////////////////////////////////// +// String(const std::string& ansiString, const std::locale& locale = std::locale()); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from null-terminated C-style wide string +// /// +// /// \param wideString Wide string to convert +// /// +// //////////////////////////////////////////////////////////// +// String(const wchar_t* wideString); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from a wide string +// /// +// /// \param wideString Wide string to convert +// /// +// //////////////////////////////////////////////////////////// +// String(const std::wstring& wideString); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from a null-terminated C-style UTF-32 string +// /// +// /// \param utf32String UTF-32 string to assign +// /// +// //////////////////////////////////////////////////////////// +// String(const uint* utf32String); +// +// //////////////////////////////////////////////////////////// +// /// \brief Construct from an UTF-32 string +// /// +// /// \param utf32String UTF-32 string to assign +// /// +// //////////////////////////////////////////////////////////// +// String(const std::basic_string<uint>& utf32String); +// +// //////////////////////////////////////////////////////////// +// /// \brief Copy constructor +// /// +// /// \param copy Instance to copy +// /// +// //////////////////////////////////////////////////////////// +// String(const String& copy); +// +// //////////////////////////////////////////////////////////// +// /// \brief Create a new sf::String from a UTF-8 encoded string +// /// +// /// \param begin Forward iterator to the beginning of the UTF-8 sequence +// /// \param end Forward iterator to the end of the UTF-8 sequence +// /// +// /// \return A sf::String containing the source string +// /// +// /// \see fromUtf16, fromUtf32 +// /// +// //////////////////////////////////////////////////////////// +// template <typename T> +// static String FromUtf8(T begin, T end); +// +// //////////////////////////////////////////////////////////// +// /// \brief Create a new sf::String from a UTF-16 encoded string +// /// +// /// \param begin Forward iterator to the beginning of the UTF-16 sequence +// /// \param end Forward iterator to the end of the UTF-16 sequence +// /// +// /// \return A sf::String containing the source string +// /// +// /// \see fromUtf8, fromUtf32 +// /// +// //////////////////////////////////////////////////////////// +// template <typename T> +// static String FromUtf16(T begin, T end); +// +// //////////////////////////////////////////////////////////// +// /// \brief Create a new sf::String from a UTF-32 encoded string +// /// +// /// This function is provided for consistency, it is equivalent to +// /// using the constructors that takes a const sf::uint* or +// /// a std::basic_string<sf::uint>. +// /// +// /// \param begin Forward iterator to the beginning of the UTF-32 sequence +// /// \param end Forward iterator to the end of the UTF-32 sequence +// /// +// /// \return A sf::String containing the source string +// /// +// /// \see fromUtf8, fromUtf16 +// /// +// //////////////////////////////////////////////////////////// +// template <typename T> +// static String FromUtf32(T begin, T end); +// +// //////////////////////////////////////////////////////////// +// /// \brief Implicit conversion operator to std::string (ANSI string) +// /// +// /// The current global locale is used for conversion. If you +// /// want to explicitly specify a locale, see toAnsiString. +// /// Characters that do not fit in the target encoding are +// /// discarded from the returned string. +// /// This operator is defined for convenience, and is equivalent +// /// to calling toAnsiString(). +// /// +// /// \return Converted ANSI string +// /// +// /// \see toAnsiString, operator std::wstring +// /// +// //////////////////////////////////////////////////////////// +// operator std::string() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Implicit conversion operator to std::wstring (wide string) +// /// +// /// Characters that do not fit in the target encoding are +// /// discarded from the returned string. +// /// This operator is defined for convenience, and is equivalent +// /// to calling toWideString(). +// /// +// /// \return Converted wide string +// /// +// /// \see toWideString, operator std::string +// /// +// //////////////////////////////////////////////////////////// +// operator std::wstring() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Convert the Unicode string to an ANSI string +// /// +// /// The UTF-32 string is converted to an ANSI string in +// /// the encoding defined by \a locale. +// /// Characters that do not fit in the target encoding are +// /// discarded from the returned string. +// /// +// /// \param locale Locale to use for conversion +// /// +// /// \return Converted ANSI string +// /// +// /// \see toWideString, operator std::string +// /// +// //////////////////////////////////////////////////////////// +// std::string ToAnsiString(const std::locale& locale = std::locale()) const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Convert the Unicode string to a wide string +// /// +// /// Characters that do not fit in the target encoding are +// /// discarded from the returned string. +// /// +// /// \return Converted wide string +// /// +// /// \see toAnsiString, operator std::wstring +// /// +// //////////////////////////////////////////////////////////// +// std::wstring ToWideString() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Convert the Unicode string to a UTF-8 string +// /// +// /// \return Converted UTF-8 string +// /// +// /// \see toUtf16, toUtf32 +// /// +// //////////////////////////////////////////////////////////// +// std::basic_string<uint8> ToUtf8() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Convert the Unicode string to a UTF-16 string +// /// +// /// \return Converted UTF-16 string +// /// +// /// \see toUtf8, toUtf32 +// /// +// //////////////////////////////////////////////////////////// +// std::basic_string<uint16> ToUtf16() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Convert the Unicode string to a UTF-32 string +// /// +// /// This function doesn't perform any conversion, since the +// /// string is already stored as UTF-32 internally. +// /// +// /// \return Converted UTF-32 string +// /// +// /// \see toUtf8, toUtf16 +// /// +// //////////////////////////////////////////////////////////// +// std::basic_string<uint> ToUtf32() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Overload of assignment operator +// /// +// /// \param right Instance to assign +// /// +// /// \return Reference to self +// /// +// //////////////////////////////////////////////////////////// +// String& operator =(const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \brief Overload of += operator to append an UTF-32 string +// /// +// /// \param right String to append +// /// +// /// \return Reference to self +// /// +// //////////////////////////////////////////////////////////// +// String& operator +=(const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \brief Overload of [] operator to access a character by its position +// /// +// /// This function provides read-only access to characters. +// /// Note: the behavior is undefined if \a index is out of range. +// /// +// /// \param index Index of the character to get +// /// +// /// \return Character at position \a index +// /// +// //////////////////////////////////////////////////////////// +// uint operator [](std::size_t index) const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Overload of [] operator to access a character by its position +// /// +// /// This function provides read and write access to characters. +// /// Note: the behavior is undefined if \a index is out of range. +// /// +// /// \param index Index of the character to get +// /// +// /// \return Reference to the character at position \a index +// /// +// //////////////////////////////////////////////////////////// +// uint& operator [](std::size_t index); +// +// //////////////////////////////////////////////////////////// +// /// \brief Clear the string +// /// +// /// This function removes all the characters from the string. +// /// +// /// \see isEmpty, erase +// /// +// //////////////////////////////////////////////////////////// +// void Clear(); +// +// //////////////////////////////////////////////////////////// +// /// \brief Get the size of the string +// /// +// /// \return Number of characters in the string +// /// +// /// \see isEmpty +// /// +// //////////////////////////////////////////////////////////// +// std::size_t GetSize() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Check whether the string is empty or not +// /// +// /// \return True if the string is empty (i.e. contains no character) +// /// +// /// \see clear, getSize +// /// +// //////////////////////////////////////////////////////////// +// bool IsEmpty() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Erase one or more characters from the string +// /// +// /// This function removes a sequence of \a count characters +// /// starting from \a position. +// /// +// /// \param position Position of the first character to erase +// /// \param count Number of characters to erase +// /// +// //////////////////////////////////////////////////////////// +// void Erase(std::size_t position, std::size_t count = 1); +// +// //////////////////////////////////////////////////////////// +// /// \brief Insert one or more characters into the string +// /// +// /// This function inserts the characters of \a str +// /// into the string, starting from \a position. +// /// +// /// \param position Position of insertion +// /// \param str Characters to insert +// /// +// //////////////////////////////////////////////////////////// +// void Insert(std::size_t position, const String& str); +// +// //////////////////////////////////////////////////////////// +// /// \brief Find a sequence of one or more characters in the string +// /// +// /// This function searches for the characters of \a str +// /// in the string, starting from \a start. +// /// +// /// \param str Characters to find +// /// \param start Where to begin searching +// /// +// /// \return Position of \a str in the string, or String::InvalidPos if not found +// /// +// //////////////////////////////////////////////////////////// +// std::size_t Find(const String& str, std::size_t start = 0) const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Replace a substring with another string +// /// +// /// This function replaces the substring that starts at index \a position +// /// and spans \a length characters with the string \a replaceWith. +// /// +// /// \param position Index of the first character to be replaced +// /// \param length Number of characters to replace. You can pass InvalidPos to +// /// replace all characters until the end of the string. +// /// \param replaceWith String that replaces the given substring. +// /// +// //////////////////////////////////////////////////////////// +// void Replace(std::size_t position, std::size_t length, const String& replaceWith); +// +// //////////////////////////////////////////////////////////// +// /// \brief Replace all occurrences of a substring with a replacement string +// /// +// /// This function replaces all occurrences of \a searchFor in this string +// /// with the string \a replaceWith. +// /// +// /// \param searchFor The value being searched for +// /// \param replaceWith The value that replaces found \a searchFor values +// /// +// //////////////////////////////////////////////////////////// +// void Replace(const String& searchFor, const String& replaceWith); +// +// //////////////////////////////////////////////////////////// +// /// \brief Return a part of the string +// /// +// /// This function returns the substring that starts at index \a position +// /// and spans \a length characters. +// /// +// /// \param position Index of the first character +// /// \param length Number of characters to include in the substring (if +// /// the string is shorter, as many characters as possible +// /// are included). \ref InvalidPos can be used to include all +// /// characters until the end of the string. +// /// +// /// \return String object containing a substring of this object +// /// +// //////////////////////////////////////////////////////////// +// String Substring(std::size_t position, std::size_t length = InvalidPos) const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Get a pointer to the C-style array of characters +// /// +// /// This functions provides a read-only access to a +// /// null-terminated C-style representation of the string. +// /// The returned pointer is temporary and is meant only for +// /// immediate use, thus it is not recommended to store it. +// /// +// /// \return Read-only pointer to the array of characters +// /// +// //////////////////////////////////////////////////////////// +// const uint* GetData() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Return an iterator to the beginning of the string +// /// +// /// \return Read-write iterator to the beginning of the string characters +// /// +// /// \see end +// /// +// //////////////////////////////////////////////////////////// +// Iterator Begin(); +// +// //////////////////////////////////////////////////////////// +// /// \brief Return an iterator to the beginning of the string +// /// +// /// \return Read-only iterator to the beginning of the string characters +// /// +// /// \see end +// /// +// //////////////////////////////////////////////////////////// +// ConstIterator Begin() const; +// +// //////////////////////////////////////////////////////////// +// /// \brief Return an iterator to the end of the string +// /// +// /// The end iterator refers to 1 position past the last character; +// /// thus it represents an invalid character and should never be +// /// accessed. +// /// +// /// \return Read-write iterator to the end of the string characters +// /// +// /// \see begin +// /// +// //////////////////////////////////////////////////////////// +// Iterator End(); +// +// //////////////////////////////////////////////////////////// +// /// \brief Return an iterator to the end of the string +// /// +// /// The end iterator refers to 1 position past the last character; +// /// thus it represents an invalid character and should never be +// /// accessed. +// /// +// /// \return Read-only iterator to the end of the string characters +// /// +// /// \see begin +// /// +// //////////////////////////////////////////////////////////// +// ConstIterator End() const; +// +// private: +// +// friend bool operator ==(const String& left, const String& right); +// friend bool operator <(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// // Member data +// //////////////////////////////////////////////////////////// +// std::basic_string<uint> mString; ///< Internal string of UTF-32 characters +// }; +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of == operator to compare two UTF-32 strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return True if both strings are equal +// /// +// //////////////////////////////////////////////////////////// +// bool operator ==(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of != operator to compare two UTF-32 strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return True if both strings are different +// /// +// //////////////////////////////////////////////////////////// +// bool operator !=(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of < operator to compare two UTF-32 strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return True if \a left is lexicographically before \a right +// /// +// //////////////////////////////////////////////////////////// +// bool operator <(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of > operator to compare two UTF-32 strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return True if \a left is lexicographically after \a right +// /// +// //////////////////////////////////////////////////////////// +// bool operator >(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of <= operator to compare two UTF-32 strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return True if \a left is lexicographically before or equivalent to \a right +// /// +// //////////////////////////////////////////////////////////// +// bool operator <=(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of >= operator to compare two UTF-32 strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return True if \a left is lexicographically after or equivalent to \a right +// /// +// //////////////////////////////////////////////////////////// +// bool operator >=(const String& left, const String& right); +// +// //////////////////////////////////////////////////////////// +// /// \relates String +// /// \brief Overload of binary + operator to concatenate two strings +// /// +// /// \param left Left operand (a string) +// /// \param right Right operand (a string) +// /// +// /// \return Concatenated string +// /// +// //////////////////////////////////////////////////////////// +// String operator +(const String& left, const String& right); +// +// #include "String.inl" +// +// } +//} +// +//#endif
\ No newline at end of file |