summaryrefslogtreecommitdiff
path: root/source/modules/asura-core/Font/String.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/modules/asura-core/Font/String.cpp')
-rw-r--r--source/modules/asura-core/Font/String.cpp376
1 files changed, 376 insertions, 0 deletions
diff --git a/source/modules/asura-core/Font/String.cpp b/source/modules/asura-core/Font/String.cpp
new file mode 100644
index 0000000..1731338
--- /dev/null
+++ b/source/modules/asura-core/Font/String.cpp
@@ -0,0 +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)
+// {
+// m_String += Utf32::DecodeAnsi(ansiChar, locale);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(wchar_t wideChar)
+// {
+// m_String += Utf32::DecodeWide(wideChar);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(uint32 utf32Char)
+// {
+// m_String += utf32Char;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const char* ansiString, const std::locale& locale)
+// {
+// if (ansiString)
+// {
+// std::size_t length = strlen(ansiString);
+// if (length > 0)
+// {
+// m_String.reserve(length + 1);
+// Utf32::FromAnsi(ansiString, ansiString + length, std::back_inserter(m_String), locale);
+// }
+// }
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const std::string& ansiString, const std::locale& locale)
+// {
+// m_String.reserve(ansiString.length() + 1);
+// Utf32::FromAnsi(ansiString.begin(), ansiString.end(), std::back_inserter(m_String), locale);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const wchar_t* wideString)
+// {
+// if (wideString)
+// {
+// std::size_t length = std::wcslen(wideString);
+// if (length > 0)
+// {
+// m_String.reserve(length + 1);
+// Utf32::FromWide(wideString, wideString + length, std::back_inserter(m_String));
+// }
+// }
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const std::wstring& wideString)
+// {
+// m_String.reserve(wideString.length() + 1);
+// Utf32::FromWide(wideString.begin(), wideString.end(), std::back_inserter(m_String));
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const uint32* utf32String)
+// {
+// if (utf32String)
+// m_String = utf32String;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const std::basic_string<uint32>& utf32String) :
+// m_String(utf32String)
+// {
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::String(const String& copy) :
+// m_String(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(m_String.length() + 1);
+//
+// // Convert
+// Utf32::ToAnsi(m_String.begin(), m_String.end(), std::back_inserter(output), 0, locale);
+//
+// return output;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// std::wstring String::ToWideString() const
+// {
+// // Prepare the output string
+// std::wstring output;
+// output.reserve(m_String.length() + 1);
+//
+// // Convert
+// Utf32::ToWide(m_String.begin(), m_String.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(m_String.length());
+//
+// // Convert
+// Utf32::ToUtf8(m_String.begin(), m_String.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(m_String.length());
+//
+// // Convert
+// Utf32::ToUtf16(m_String.begin(), m_String.end(), std::back_inserter(output));
+//
+// return output;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// std::basic_string<uint32> String::ToUtf32() const
+// {
+// return m_String;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String& String::operator =(const String& right)
+// {
+// m_String = right.mString;
+// return *this;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String& String::operator +=(const String& right)
+// {
+// m_String += right.mString;
+// return *this;
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// uint32 String::operator [](std::size_t index) const
+// {
+// return m_String[index];
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// uint32& String::operator [](std::size_t index)
+// {
+// return m_String[index];
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// void String::Clear()
+// {
+// m_String.clear();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// std::size_t String::GetSize() const
+// {
+// return m_String.size();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// bool String::IsEmpty() const
+// {
+// return m_String.empty();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// void String::Erase(std::size_t position, std::size_t count)
+// {
+// m_String.erase(position, count);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// void String::Insert(std::size_t position, const String& str)
+// {
+// m_String.insert(position, str.mString);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// std::size_t String::Find(const String& str, std::size_t start) const
+// {
+// return m_String.find(str.mString, start);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// void String::Replace(std::size_t position, std::size_t length, const String& replaceWith)
+// {
+// m_String.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 m_String.substr(position, length);
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// const uint32* String::GetData() const
+// {
+// return m_String.c_str();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::Iterator String::Begin()
+// {
+// return m_String.begin();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::ConstIterator String::Begin() const
+// {
+// return m_String.begin();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::Iterator String::End()
+// {
+// return m_String.end();
+// }
+//
+//
+// ////////////////////////////////////////////////////////////
+// String::ConstIterator String::End() const
+// {
+// return m_String.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;
+// }
+//
+//
+// }
+//}