25 #ifndef SFML_STRING_HPP
26 #define SFML_STRING_HPP
31 #include <SFML/System/Export.hpp>
32 #include <SFML/System/Utf.hpp>
52 typedef std::basic_string<Uint32>::iterator
Iterator;
78 String(
char ansiChar,
const std::locale& locale = std::locale());
106 String(
const char* ansiString,
const std::locale& locale = std::locale());
118 String(
const std::string& ansiString,
const std::locale& locale = std::locale());
126 String(
const wchar_t* wideString);
134 String(
const std::wstring& wideString);
142 String(
const Uint32* utf32String);
150 String(
const std::basic_string<Uint32>& utf32String);
171 template <
typename T>
172 static String fromUtf8(T begin, T end);
185 template <
typename T>
186 static String fromUtf16(T begin, T end);
203 template <
typename T>
204 static String fromUtf32(T begin, T end);
221 operator std::string()
const;
236 operator std::wstring()
const;
253 std::string toAnsiString(
const std::locale& locale = std::locale())
const;
266 std::wstring toWideString()
const;
276 std::basic_string<Uint8> toUtf8()
const;
286 std::basic_string<Uint16> toUtf16()
const;
299 std::basic_string<Uint32> toUtf32()
const;
332 Uint32 operator [](std::size_t index)
const;
345 Uint32& operator [](std::size_t index);
365 std::size_t getSize()
const;
375 bool isEmpty()
const;
387 void erase(std::size_t position, std::size_t count = 1);
399 void insert(std::size_t position,
const String& str);
413 std::size_t find(
const String& str, std::size_t start = 0)
const;
427 void replace(std::size_t position, std::size_t length,
const String& replaceWith);
439 void replace(
const String& searchFor,
const String& replaceWith);
456 String substring(std::size_t position, std::size_t length = InvalidPos)
const;
469 const Uint32* getData()
const;
489 ConstIterator begin()
const;
517 ConstIterator end()
const;
521 friend SFML_SYSTEM_API
bool operator ==(
const String& left,
const String& right);
522 friend SFML_SYSTEM_API
bool operator <(
const String& left,
const String& right);
527 std::basic_string<Uint32> m_string;
540 SFML_SYSTEM_API
bool operator ==(
const String& left,
const String& right);
552 SFML_SYSTEM_API
bool operator !=(
const String& left,
const String& right);
564 SFML_SYSTEM_API
bool operator <(
const String& left,
const String& right);
576 SFML_SYSTEM_API
bool operator >(
const String& left,
const String& right);
588 SFML_SYSTEM_API
bool operator <=(
const String& left,
const String& right);
600 SFML_SYSTEM_API
bool operator >=(
const String& left,
const String& right);
614 #include <SFML/System/String.inl>
619 #endif // SFML_STRING_HPP