#ifndef _STRING_ #define _STRING_ // For size_t #include typedef unsigned __INT16_TYPE__ char16; typedef unsigned __INT32_TYPE__ char32; namespace std { template class allocator {}; template class char_traits {}; template > struct basic_string_view; template , typename A = allocator> struct basic_string { typedef size_t size_type; typedef basic_string _Type; basic_string(); basic_string(const C *p, const A &a = A()); basic_string(const C *p, size_type count); ~basic_string(); const C *c_str() const; const C *data() const; bool empty() const; size_type size() const; size_type length() const; _Type& append(const C *s); _Type& append(const C *s, size_type n); _Type& assign(const C *s); _Type& assign(const C *s, size_type n); int compare(const _Type&) const; int compare(const C* s) const; int compare(size_type pos, size_type len, const _Type&) const; int compare(size_type pos, size_type len, const C* s) const; size_type find(const _Type& str, size_type pos = 0) const; size_type find(const C* s, size_type pos = 0) const; size_type find(const C* s, size_type pos, size_type n) const; size_type rfind(const _Type& str, size_type pos = npos) const; size_type rfind(const C* s, size_type pos, size_type count) const; size_type rfind(const C* s, size_type pos = npos) const; size_type rfind(C ch, size_type pos = npos) const; _Type& insert(size_type pos, const _Type& str); _Type& insert(size_type pos, const C* s); _Type& insert(size_type pos, const C* s, size_type n); constexpr bool starts_with(std::basic_string_view sv) const noexcept; constexpr bool starts_with(C ch) const noexcept; constexpr bool starts_with(const C* s) const; _Type& operator[](size_type); const _Type& operator[](size_type) const; _Type& operator+=(const _Type& str); _Type& operator+=(const C* s); _Type& operator=(const _Type& str); _Type& operator=(const C* s); static constexpr size_t npos = -1; }; typedef basic_string string; typedef basic_string wstring; typedef basic_string u16string; typedef basic_string u32string; template struct basic_string_view { typedef size_t size_type; typedef basic_string_view _Type; const C *str; constexpr basic_string_view(const C* s) : str(s) {} size_type find(_Type v, size_type pos = 0) const; size_type find(C ch, size_type pos = 0) const; size_type find(const C* s, size_type pos, size_type count) const; size_type find(const C* s, size_type pos = 0) const; size_type rfind(_Type v, size_type pos = npos) const; size_type rfind(C ch, size_type pos = npos) const; size_type rfind(const C* s, size_type pos, size_type count) const; size_type rfind(const C* s, size_type pos = npos) const; constexpr bool starts_with(basic_string_view sv) const noexcept; constexpr bool starts_with(C ch) const noexcept; constexpr bool starts_with(const C* s) const; static constexpr size_t npos = -1; }; typedef basic_string_view string_view; typedef basic_string_view wstring_view; typedef basic_string_view u16string_view; typedef basic_string_view u32string_view; std::string operator+(const std::string&, const std::string&); std::string operator+(const std::string&, const char*); std::string operator+(const char*, const std::string&); bool operator==(const std::string&, const std::string&); bool operator==(const std::string&, const char*); bool operator==(const char*, const std::string&); bool operator!=(const std::string&, const std::string&); bool operator!=(const std::string&, const char*); bool operator!=(const char*, const std::string&); bool operator==(const std::wstring&, const std::wstring&); bool operator==(const std::wstring&, const wchar_t*); bool operator==(const wchar_t*, const std::wstring&); } #endif // _STRING_