OpenSiv3D  v0.6.5
C++20 framework for creative coding
s3d::String Class Reference

文字列 More...

#include <String.hpp>

Public Types

using string_type = std::u32string
 
using traits_type = typename string_type::traits_type
 
using allocator_type = typename string_type::allocator_type
 
using value_type = typename string_type::value_type
 
using size_type = typename string_type::size_type
 
using difference_type = typename string_type::difference_type
 
using pointer = typename string_type::pointer
 
using const_pointer = typename string_type::const_pointer
 
using reference = typename string_type::reference
 
using const_reference = typename string_type::const_reference
 
using iterator = typename string_type::iterator
 
using const_iterator = typename string_type::const_iterator
 
using reverse_iterator = typename string_type::reverse_iterator
 
using const_reverse_iterator = typename string_type::const_reverse_iterator
 
template<class StringViewIsh >
using IsStringViewIsh = std::enable_if_t< std::conjunction_v< std::is_convertible< const StringViewIsh &, StringView >, std::negation< std::is_convertible< const StringViewIsh &, const char32 * > >> >
 

Public Member Functions

SIV3D_NODISCARD_CXX20 String ()
 デフォルトコンストラクタ | default constructor More...
 
SIV3D_NODISCARD_CXX20 String (const String &other)
 文字列をコピーして新しい文字列を作成します。 More...
 
SIV3D_NODISCARD_CXX20 String (const string_type &s)
 文字列をコピーして新しい文字列を作成します。 More...
 
SIV3D_NODISCARD_CXX20 String (const String &other, size_type pos)
 
SIV3D_NODISCARD_CXX20 String (const String &other, size_type pos, size_type count)
 
SIV3D_NODISCARD_CXX20 String (const value_type *s)
 
SIV3D_NODISCARD_CXX20 String (const value_type *s, size_type count)
 
SIV3D_NODISCARD_CXX20 String (std::initializer_list< value_type > ilist)
 
SIV3D_NODISCARD_CXX20 String (size_t count, value_type ch)
 
template<class Iterator >
SIV3D_NODISCARD_CXX20 String (Iterator first, Iterator last)
 
SIV3D_NODISCARD_CXX20 String (String &&other) noexcept
 
SIV3D_NODISCARD_CXX20 String (string_type &&s) noexcept
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
SIV3D_NODISCARD_CXX20 String (const StringViewIsh &s)
 
 operator StringView () const noexcept
 
Stringoperator= (const String &other)
 
Stringoperator= (const string_type &s)
 
Stringoperator= (String &&other) noexcept
 
Stringoperator= (string_type &&s) noexcept
 
Stringoperator= (const value_type *s)
 
Stringoperator= (std::initializer_list< value_type > ilist)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringoperator= (const StringViewIsh &s)
 
Stringassign (const String &s)
 
Stringassign (const string_type &s)
 
Stringassign (const value_type *s)
 
Stringassign (size_t count, value_type ch)
 
Stringassign (String &&s) noexcept
 
Stringassign (string_type &&s) noexcept
 
Stringassign (std::initializer_list< value_type > ilist)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringassign (const StringViewIsh &s)
 
template<class Iterator >
Stringassign (Iterator first, Iterator last)
 
allocator_type get_allocator () const noexcept
 
Stringoperator<< (value_type ch)
 
Stringoperator+= (const String &s)
 
Stringoperator+= (const string_type &s)
 
Stringoperator+= (value_type ch)
 
Stringoperator+= (const value_type *s)
 
Stringoperator+= (std::initializer_list< value_type > ilist)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringoperator+= (const StringViewIsh &s)
 
Stringappend (const String &s)
 
Stringappend (const string_type &s)
 
Stringappend (value_type ch)
 
Stringappend (const value_type *s)
 
Stringappend (const value_type *s, size_t count)
 
Stringappend (std::initializer_list< value_type > ilist)
 
Stringappend (size_t count, value_type ch)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringappend (const StringViewIsh &s)
 
template<class Iterator >
Stringappend (Iterator first, Iterator last)
 
Stringinsert (size_t offset, const String &s)
 
Stringinsert (size_t offset, std::initializer_list< value_type > ilist)
 
Stringinsert (size_t offset, const value_type *s)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringinsert (size_t offset, const StringViewIsh &s)
 
Stringinsert (size_t offset, size_t count, value_type ch)
 
iterator insert (const_iterator where, value_type ch)
 
iterator insert (const_iterator where, size_t count, value_type ch)
 
template<class Iterator >
iterator insert (const_iterator where, Iterator first, Iterator last)
 
template<class Iterator >
Stringinsert (const_iterator first1, const_iterator last1, Iterator first2, Iterator last2)
 
Stringerase (size_t offset=0, size_t count=npos)
 
iterator erase (const_iterator where) noexcept
 
iterator erase (const_iterator first, const_iterator last) noexcept
 
void clear () noexcept
 格納している文字列を消去し、空の文字列にします。 More...
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
reverse_iterator rbegin () noexcept
 
reverse_iterator rend () noexcept
 
const_reverse_iterator rbegin () const noexcept
 
const_reverse_iterator rend () const noexcept
 
const_reverse_iterator crbegin () const noexcept
 
const_reverse_iterator crend () const noexcept
 
void shrink_to_fit ()
 
void release ()
 
value_typeat (size_t offset) &
 
const value_typeat (size_t offset) const &
 
value_type at (size_t offset) &&
 
value_typeoperator[] (size_t offset) &noexcept
 
const value_typeoperator[] (size_t offset) const &noexcept
 
value_type operator[] (size_t offset) &&noexcept
 
void push_front (value_type ch)
 先頭に文字を追加します。 More...
 
void push_back (value_type ch)
 末尾に文字を追加します。 More...
 
void pop_front ()
 先頭の文字を削除します。 More...
 
void pop_front_N (size_t n)
 先頭の n 文字を削除します。 More...
 
void pop_back () noexcept
 末尾の文字を削除します。 More...
 
void pop_back_N (size_t n) noexcept
 末尾の n 文字を削除します。 More...
 
value_typefront () noexcept
 先頭の文字への参照を返します。 More...
 
const value_typefront () const noexcept
 先頭の文字への参照を返します。 More...
 
value_typeback () noexcept
 末尾の文字への参照を返します。 More...
 
const value_typeback () const noexcept
 末尾の文字への参照を返します。 More...
 
const value_typec_str () const noexcept
 
const value_typedata () const noexcept
 
value_typedata () noexcept
 
string_typestr () noexcept
 
const string_typestr () const noexcept
 
size_t length () const noexcept
 文字列の長さ(要素数)を返します。 More...
 
size_t size () const noexcept
 文字列の長さ(要素数)を返します。 More...
 
size_t size_bytes () const noexcept
 文字列のデータサイズ(バイト)を返します。 More...
 
bool empty () const noexcept
 文字列が空であるかを返します。 More...
 
bool isEmpty () const noexcept
 文字列が空であるかを返します。 More...
 
 operator bool () const noexcept
 文字列が空でないかを返します。 More...
 
size_t max_size () const noexcept
 
size_t capacity () const noexcept
 
void resize (size_t newSize)
 
void resize (size_t newSize, value_type ch)
 
void reserve (size_t newCapacity)
 
void swap (String &other) noexcept
 
bool starts_with (value_type ch) const noexcept
 文字列が指定した文字から始まるかを返します。 More...
 
bool starts_with (StringView s) const
 文字列が指定した文字列から始まるかを返します。 More...
 
bool ends_with (value_type ch) const noexcept
 文字列が指定した文字で終わるかを返します。 More...
 
bool ends_with (StringView s) const
 文字列が指定した文字列で終わるかを返します。 More...
 
String substr (size_t offset=0, size_t count=npos) const
 部分文字列を取得します。 More...
 
StringView substrView (size_t offset=0, size_t count=npos) const &
 部分文字列へのビューを取得します。 More...
 
StringView substrView (size_t offset=0, size_t count=npos) &&=delete
 
std::string narrow () const
 文字列を std::string に変換します。 More...
 
std::wstring toWstr () const
 文字列を std::wstring に変換します。 More...
 
std::string toUTF8 () const
 文字列を UTF-8 文字列に変換します。 More...
 
std::u16string toUTF16 () const
 文字列を UTF-16 文字列に変換します。 More...
 
const std::u32string & toUTF32 () const noexcept
 文字列を UTF-32 文字列に変換します。 More...
 
uint64 hash () const noexcept
 文字列のハッシュを返します。 More...
 
size_t indexOf (StringView s, size_t offset=0) const noexcept
 文字列を指定した位置から検索し、最初に現れた位置を返します。 More...
 
size_t indexOf (value_type ch, size_t offset=0) const noexcept
 文字を指定した位置から検索し、最初に現れた位置を返します。 More...
 
size_t indexOfNot (value_type ch, size_t offset=0) const noexcept
 文字を指定した位置から検索し、最初にそれとは異なる文字が現れた位置を返します。 More...
 
size_t lastIndexOf (StringView s, size_t offset=npos) const noexcept
 文字列を後方から逆順に検索し、最初に現れた位置を返します。 More...
 
size_t lastIndexOf (value_type ch, size_t offset=npos) const noexcept
 文字を後方から逆順に検索し、最初に現れた位置を返します。 More...
 
size_t lastIndexNotOf (value_type ch, size_t offset=npos) const noexcept
 文字を後方から逆順に検索し、最初にそれとは異なる文字が現れた位置を返します。 More...
 
size_t indexOfAny (StringView anyof, size_t offset=0) const noexcept
 検索する文字のいずれかが最初に現れた位置を返します。 More...
 
size_t lastIndexOfAny (StringView anyof, size_t offset=npos) const noexcept
 文字を後方から逆順に検索し、検索する文字のいずれかが最初に現れた位置を返します。 More...
 
size_t indexNotOfAny (StringView anyof, size_t offset=0) const
 検索する文字に含まれない文字が最初に現れた位置を返します。 More...
 
size_t lastIndexNotOfAny (StringView anyof, size_t offset=npos) const
 文字を後方から逆順に検索し、検索する文字に含まれない文字が最初に現れた位置を返します。 More...
 
int32 compare (const String &s) const noexcept
 文字列の大小を比較します。 More...
 
int32 compare (StringView s) const noexcept
 文字列の大小を比較します。 More...
 
int32 compare (const value_type *s) const noexcept
 文字列の大小を比較します。 More...
 
int32 case_insensitive_compare (StringView s) const noexcept
 英字の大小を無視して文字列の大小を比較します。 More...
 
bool case_insensitive_equals (StringView s) const noexcept
 英字の大小を無視して文字列を比較します。 More...
 
template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool all (Fty f=Identity) const
 全ての要素が条件を満たすかを返します。 More...
 
template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool any (Fty f=Identity) const
 条件を満たす要素があるかを返します。 More...
 
Stringcapitalize () noexcept
 最初に登場する英字を大文字にします。 More...
 
String capitalized () const &
 最初に登場する英字を大文字にした文字列を返します。 More...
 
String capitalized () &&
 最初に登場する英字を大文字にした文字列を返します。 More...
 
size_t count (value_type ch) const noexcept
 指定した値と等しい要素の個数を返します。 More...
 
size_t count (StringView s) const
 指定した文字列の個数を数えます。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
size_t count_if (Fty f) const
 条件を満たす要素の個数を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 & >> * = nullptr>
Stringeach (Fty f)
 全ての要素を順番に引数にして関数を呼び出します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 >> * = nullptr>
const Stringeach (Fty f) const
 全ての要素を順番に引数にして関数を呼び出します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, char32 & >> * = nullptr>
Stringeach_index (Fty f)
 全ての要素とそのインデックスを順番に引数にして関数を呼び出します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, char32 >> * = nullptr>
const Stringeach_index (Fty f) const
 全ての要素とそのインデックスを順番に引数にして関数を呼び出します。 More...
 
String expandTabs (size_t tabSize=4) const
 タブ文字を半角空白に置換した文字列を返します。 More...
 
value_type fetch (size_t index, value_type defaultValue) const noexcept
 指定したインデックスにある要素を返します。インデックスが範囲外の場合デフォルト値を返します。 More...
 
Stringfill (value_type value)
 指定した値を全ての要素に代入します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String filter (Fty f) const
 指定した条件を満たす要素だけを集めた新しい文字列を返します。 More...
 
bool includes (value_type ch) const
 指定した値と等しい要素があるかを返します。 More...
 
bool includes (StringView s) const
 指定した文字列を含むかを返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool includes_if (Fty f) const
 指定した条件を満たす要素があるかを返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
Stringkeep_if (Fty f)
 指定した条件を満たす要素のみを残して、それ以外を文字列から削除します。 More...
 
String layout (size_t width) const
 指定した 1 行の文字数で改行するようにした新しい文字列を返します。 More...
 
size_t levenshteinDistanceFrom (StringView other) const noexcept
 別の文字列とのレーベンシュタイン距離を計算して返します。 More...
 
Stringlowercase () noexcept
 英字をすべて小文字にします。 More...
 
String lowercased () const &
 英字をすべて小文字にした新しい文字列を返します。 More...
 
String lowercased () &&
 英字をすべて小文字にした新しい文字列を返します。 More...
 
Stringlpad (size_t length, value_type fillChar=U' ')
 文字列の左を埋め文字で埋めます。 More...
 
String lpadded (size_t length, value_type fillChar=U' ') const &
 文字列の左を埋め文字で埋めた新しい文字列を返します。 More...
 
String lpadded (size_t length, value_type fillChar=U' ') &&
 文字列の左を埋め文字で埋めた新しい文字列を返します。 More...
 
Stringltrim ()
 文字列の先頭にある空白文字を削除します。 More...
 
String ltrimmed () const &
 文字列の先頭にある空白文字を削除した新しい文字列を返します。 More...
 
String ltrimmed () &&
 文字列の先頭にある空白文字を削除した新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 >> * = nullptr>
auto map (Fty f) const
 文字列の各要素に関数を適用した戻り値からなる配列を返します。 More...
 
template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool none (Fty f=Identity) const
 条件を満たす要素が存在しないかを返します。 More...
 
Stringremove (value_type ch)
 指定した文字を文字列から削除します。 More...
 
Stringremove (StringView s)
 指定した文字列をもとの文字列から削除します。 More...
 
String removed (value_type ch) const &
 指定した文字を除去した新しい文字列を返します。 More...
 
String removed (value_type ch) &&
 指定した文字を除去した新しい文字列を返します。 More...
 
String removed (StringView s) const
 指定した文字列を除去した新しい文字列を返します。 More...
 
Stringremove_at (size_t index)
 指定したインデックスにある要素を文字列から削除します。 More...
 
String removed_at (size_t index) const &
 定したインデックスにある要素を削除した新しい文字列を返します。 More...
 
String removed_at (size_t index) &&
 定したインデックスにある要素を削除した新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
Stringremove_if (Fty f)
 指定した条件を満たす文字を削除します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String removed_if (Fty f) const &
 指定した条件を満たす文字を削除した新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String removed_if (Fty f) &&
 指定した条件を満たす文字を削除した新しい文字列を返します。 More...
 
Stringreplace (value_type oldChar, value_type newChar)
 指定した文字を置換します。 More...
 
Stringreplace (const StringView oldStr, const StringView newStr)
 指定した文字列を置換します。 More...
 
Stringreplace (size_type pos, size_type count, const String &s)
 
Stringreplace (size_type pos, size_type count, const value_type *s)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringreplace (size_type pos, size_type count, const StringViewIsh &s)
 
Stringreplace (const_iterator first, const_iterator last, const String &s)
 
Stringreplace (const_iterator first, const_iterator last, const value_type *s)
 
template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
Stringreplace (const_iterator first, const_iterator last, const StringViewIsh &s)
 
template<class Iterator >
Stringreplace (const_iterator first, const_iterator last, Iterator first2, Iterator last2)
 
String replaced (value_type oldChar, value_type newChar) const &
 指定した文字を置換した新しい文字列を返します。 More...
 
String replaced (value_type oldChar, value_type newChar) &&
 指定した文字を置換した新しい文字列を返します。 More...
 
String replaced (StringView oldStr, StringView newStr) const
 指定した文字列を置換した新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
Stringreplace_if (Fty f, const value_type newChar)
 指定した条件を満たす文字を別の文字に置き換えます。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String replaced_if (Fty f, const value_type newChar) const &
 指定した条件を満たす文字を別の文字に置き換えた新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String replaced_if (Fty f, const value_type newChar) &&
 指定した条件を満たす文字を別の文字に置き換えた新しい文字列を返します。 More...
 
Stringreverse ()
 文字列を反転します。 More...
 
String reversed () const &
 反転した文字列を返します。 More...
 
String reversed () &&
 反転した文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 & >> * = nullptr>
Stringreverse_each (Fty f)
 文字列の各文字への参照を引数に、末尾の文字から順に関数を呼び出します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 >> * = nullptr>
const Stringreverse_each (Fty f) const
 文字列の各文字への参照を引数に、末尾の文字から順に関数を呼び出します。 More...
 
Stringrotate (std::ptrdiff_t count=1)
 文字列の各文字の位置をシフトさせ、はみ出た文字は反対側に挿入します。 More...
 
String rotated (std::ptrdiff_t count=1) const &
 文字列の各文字の位置をシフトさせ、はみ出た文字を反対側に挿入した新しい文字列を返します。 More...
 
String rotated (std::ptrdiff_t count=1) &&
 文字列の各文字の位置をシフトさせ、はみ出た文字を反対側に挿入した新しい文字列を返します。 More...
 
Stringrpad (size_t length, value_type fillChar=U' ')
 文字列の右を埋め文字で埋めます。 More...
 
String rpadded (size_t length, value_type fillChar=U' ') const &
 文字列を指定された文字で右詰めした新しい文字列を返します。 More...
 
String rpadded (size_t length, value_type fillChar=U' ') &&
 文字列を指定された文字で右詰めした新しい文字列を返します。 More...
 
Stringrtrim ()
 文字列の末尾にある空白文字を削除します。 More...
 
String rtrimmed () const &
 文字列の末尾にある空白文字を削除した新しい文字列を返します。 More...
 
String rtrimmed () &&
 文字列の末尾にある空白文字を削除した新しい文字列を返します。 More...
 
Stringshuffle ()
 文字列をランダムに並び替えます。 More...
 
SIV3D_CONCEPT_URBG Stringshuffle (URBG &&rbg)
 指定された乱数生成器を使って文字列をランダムに並び替えます。 More...
 
String shuffled () const &
 ランダムに並び替えた新しい文字列を返します。 More...
 
String shuffled () &&
 ランダムに並び替えた新しい文字列を返します。 More...
 
SIV3D_CONCEPT_URBG String shuffled (URBG &&rbg) const &
 指定された乱数生成器を使ってランダムに並び替えた新しい文字列を返します。 More...
 
SIV3D_CONCEPT_URBG String shuffled (URBG &&rbg) &&
 指定された乱数生成器を使ってランダムに並び替えた新しい文字列を返します。 More...
 
Array< String, std::allocator< String > > split (value_type ch) const
 指定した区切り文字で文字列を分割します。 More...
 
std::pair< String, Stringsplit_at (size_t pos) const
 
Array< String, std::allocator< String > > split_lines () const
 
Stringswapcase () noexcept
 英字の大文字と小文字を入れ替えます。 More...
 
String swapcased () const &
 英字の大文字と小文字を入れ替えた文字列を返します。 More...
 
String swapcased () &&
 英字の大文字と小文字を入れ替えた文字列を返します。 More...
 
Stringtrim ()
 文字列の先頭と末尾にある空白文字を削除します。 More...
 
String trimmed () const &
 文字列の先頭と末尾にある空白文字を削除した新しい文字列を返します。 More...
 
String trimmed () &&
 文字列の先頭と末尾にある空白文字を削除した新しい文字列を返します。 More...
 
Stringuppercase () noexcept
 英字をすべて大文字にします。 More...
 
String uppercased () const &
 英字をすべて大文字にした文字列を返します。 More...
 
String uppercased () &&
 英字をすべて大文字にした文字列を返します。 More...
 
Stringrsort () noexcept
 
String rsorted () const &
 
String rsorted () &&
 
Stringsort () noexcept
 文字列をソートします。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32, char32 >> * = nullptr>
Stringsort_by (Fty f)
 文字列を指定された比較関数でソートします。 More...
 
String sorted () const &
 文字列をソートした新しい文字列を返します。 More...
 
String sorted () &&
 文字列をソートした新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32, char32 >> * = nullptr>
String sorted_by (Fty f) const &
 文字列を指定された比較関数でソートした新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32, char32 >> * = nullptr>
String sorted_by (Fty f) &&
 文字列を指定された比較関数でソートした新しい文字列を返します。 More...
 
String take (size_t n) const
 文字列の先頭から指定された文字数分取り出した新しい文字列を返します。 More...
 
template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String take_while (Fty f) const
 文字列の先頭から、指定された条件を満たす連続した文字を取り出した新しい文字列を返します。 More...
 
Stringstable_unique ()
 文字列をソートせずに、重複する文字を削除します。 More...
 
String stable_uniqued () const
 文字列をソートせずに、重複する文字を削除した新しい文字列を返します。 More...
 
Stringsort_and_unique ()
 文字列をソートし、重複する文字を削除します。 More...
 
String sorted_and_uniqued () const &
 文字列をソートし、重複する文字を削除した新しい文字列を返します。 More...
 
String sorted_and_uniqued () &&
 文字列をソートし、重複する文字を削除した新しい文字列を返します。 More...
 
Stringunique_consecutive ()
 同じ文字が連続する場合、その先頭以外を除去します。 More...
 
String uniqued_consecutive () const &
 同じ文字が連続する場合、その先頭以外を除去した新しい文字列を返します。 More...
 
String uniqued_consecutive () &&
 同じ文字が連続する場合、その先頭以外を除去した新しい文字列を返します。 More...
 
String values_at (std::initializer_list< size_t > indices) const
 複数のインデックスを取り、それらの文字からなる新しい文字列を返します。 More...
 
Stringxml_escape ()
 文字列に XML エスケープを行います。 More...
 
String xml_escaped () const
 XML エスケープした文字列を返します。 More...
 

Static Public Attributes

static constexpr size_type npos { static_cast<size_type>(-1) }
 

Friends

bool operator== (const String &lhs, const value_type *rhs)
 
bool operator== (const String &lhs, const String &rhs) noexcept
 
bool operator== (const value_type *lhs, const String &rhs)
 
bool operator!= (const String &lhs, const String &rhs) noexcept
 
bool operator!= (const value_type *lhs, const String &rhs)
 
bool operator!= (const String &lhs, const value_type *rhs)
 
bool operator< (const String &lhs, const String &rhs) noexcept
 
bool operator< (const value_type *lhs, const String &rhs)
 
bool operator< (const String &lhs, const value_type *rhs)
 
bool operator> (const String &lhs, const String &rhs) noexcept
 
bool operator> (const value_type *lhs, const String &rhs)
 
bool operator> (const String &lhs, const value_type *rhs)
 
bool operator<= (const String &lhs, const String &rhs) noexcept
 
bool operator<= (const value_type *lhs, const String &rhs)
 
bool operator<= (const String &lhs, const value_type *rhs)
 
bool operator>= (const String &lhs, const String &rhs) noexcept
 
bool operator>= (const value_type *lhs, const String &rhs)
 
bool operator>= (const String &lhs, const value_type *rhs)
 
String operator+ (const value_type lhs, const String &rhs)
 
String operator+ (const value_type lhs, String &&rhs)
 
String operator+ (const value_type *lhs, const String &rhs)
 
String operator+ (const value_type *lhs, String &&rhs)
 
String operator+ (StringView lhs, const String &rhs)
 
String operator+ (StringView lhs, String &&rhs)
 
String operator+ (const String &lhs, const value_type rhs)
 
String operator+ (const String &lhs, const value_type *rhs)
 
String operator+ (const String &lhs, StringView rhs)
 
String operator+ (const String &lhs, const String &rhs)
 
String operator+ (const String &lhs, String &&rhs)
 
String operator+ (String &&lhs, const value_type rhs)
 
String operator+ (String &&lhs, const value_type *rhs)
 
String operator+ (String &&lhs, StringView rhs)
 
String operator+ (String &&lhs, const String &rhs)
 
String operator+ (String &&lhs, String &&rhs)
 
std::ostream & operator<< (std::ostream &output, const String &value)
 
std::wostream & operator<< (std::wostream &output, const String &value)
 
std::basic_ostream< char32 > & operator<< (std::basic_ostream< char32 > &output, const String &value)
 
std::istream & operator>> (std::istream &input, String &value)
 
std::wistream & operator>> (std::wistream &input, String &value)
 
void Formatter (FormatData &formatData, const String &s)
 

Detailed Description

文字列

Member Typedef Documentation

◆ allocator_type

using s3d::String::allocator_type = typename string_type::allocator_type

◆ const_iterator

using s3d::String::const_iterator = typename string_type::const_iterator

◆ const_pointer

using s3d::String::const_pointer = typename string_type::const_pointer

◆ const_reference

using s3d::String::const_reference = typename string_type::const_reference

◆ const_reverse_iterator

using s3d::String::const_reverse_iterator = typename string_type::const_reverse_iterator

◆ difference_type

using s3d::String::difference_type = typename string_type::difference_type

◆ IsStringViewIsh

template<class StringViewIsh >
using s3d::String::IsStringViewIsh = std::enable_if_t< std::conjunction_v<std::is_convertible<const StringViewIsh&, StringView>, std::negation<std::is_convertible<const StringViewIsh&, const char32*> >> >

◆ iterator

using s3d::String::iterator = typename string_type::iterator

◆ pointer

using s3d::String::pointer = typename string_type::pointer

◆ reference

using s3d::String::reference = typename string_type::reference

◆ reverse_iterator

using s3d::String::reverse_iterator = typename string_type::reverse_iterator

◆ size_type

using s3d::String::size_type = typename string_type::size_type

◆ string_type

using s3d::String::string_type = std::u32string

◆ traits_type

using s3d::String::traits_type = typename string_type::traits_type

◆ value_type

using s3d::String::value_type = typename string_type::value_type

Constructor & Destructor Documentation

◆ String() [1/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( )

デフォルトコンストラクタ | default constructor

◆ String() [2/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( const String other)

文字列をコピーして新しい文字列を作成します。

Parameters
otherコピーする文字列

◆ String() [3/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( const string_type s)

文字列をコピーして新しい文字列を作成します。

Parameters
sコピーする文字列

◆ String() [4/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( const String other,
size_type  pos 
)

◆ String() [5/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( const String other,
size_type  pos,
size_type  count 
)

◆ String() [6/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( const value_type s)

◆ String() [7/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( const value_type s,
size_type  count 
)

◆ String() [8/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( std::initializer_list< value_type ilist)

◆ String() [9/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( size_t  count,
value_type  ch 
)

◆ String() [10/13]

template<class Iterator >
SIV3D_NODISCARD_CXX20 s3d::String::String ( Iterator  first,
Iterator  last 
)

◆ String() [11/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( String &&  other)
noexcept

◆ String() [12/13]

SIV3D_NODISCARD_CXX20 s3d::String::String ( string_type &&  s)
noexcept

◆ String() [13/13]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
SIV3D_NODISCARD_CXX20 s3d::String::String ( const StringViewIsh &  s)
explicit

Member Function Documentation

◆ all()

template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool s3d::String::all ( Fty  f = Identity) const

全ての要素が条件を満たすかを返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
全ての要素が条件を満たすか、配列が空の場合 true, それ以外の場合は false

◆ any()

template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool s3d::String::any ( Fty  f = Identity) const

条件を満たす要素があるかを返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
条件を満たす要素が 1 つでもあれば true, 俺以外の場合は false

◆ append() [1/9]

String& s3d::String::append ( const String s)

◆ append() [2/9]

String& s3d::String::append ( const string_type s)

◆ append() [3/9]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::append ( const StringViewIsh &  s)

◆ append() [4/9]

String& s3d::String::append ( const value_type s)

◆ append() [5/9]

String& s3d::String::append ( const value_type s,
size_t  count 
)

◆ append() [6/9]

template<class Iterator >
String& s3d::String::append ( Iterator  first,
Iterator  last 
)

◆ append() [7/9]

String& s3d::String::append ( size_t  count,
value_type  ch 
)

◆ append() [8/9]

String& s3d::String::append ( std::initializer_list< value_type ilist)

◆ append() [9/9]

String& s3d::String::append ( value_type  ch)

◆ assign() [1/9]

String& s3d::String::assign ( const String s)

◆ assign() [2/9]

String& s3d::String::assign ( const string_type s)

◆ assign() [3/9]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::assign ( const StringViewIsh &  s)

◆ assign() [4/9]

String& s3d::String::assign ( const value_type s)

◆ assign() [5/9]

template<class Iterator >
String& s3d::String::assign ( Iterator  first,
Iterator  last 
)

◆ assign() [6/9]

String& s3d::String::assign ( size_t  count,
value_type  ch 
)

◆ assign() [7/9]

String& s3d::String::assign ( std::initializer_list< value_type ilist)

◆ assign() [8/9]

String& s3d::String::assign ( String &&  s)
noexcept

◆ assign() [9/9]

String& s3d::String::assign ( string_type &&  s)
noexcept

◆ at() [1/3]

value_type& s3d::String::at ( size_t  offset) &

◆ at() [2/3]

value_type s3d::String::at ( size_t  offset) &&

◆ at() [3/3]

const value_type& s3d::String::at ( size_t  offset) const &

◆ back() [1/2]

const value_type& s3d::String::back ( ) const
noexcept

末尾の文字への参照を返します。

Remarks
空の文字列に対しては使えません。
Returns
末尾の文字への参照

◆ back() [2/2]

value_type& s3d::String::back ( )
noexcept

末尾の文字への参照を返します。

Remarks
空の文字列に対しては使えません。
Returns
末尾の文字への参照

◆ begin() [1/2]

const_iterator s3d::String::begin ( ) const
noexcept

◆ begin() [2/2]

iterator s3d::String::begin ( )
noexcept

◆ c_str()

const value_type* s3d::String::c_str ( ) const
noexcept

◆ capacity()

size_t s3d::String::capacity ( ) const
noexcept

◆ capitalize()

String& s3d::String::capitalize ( )
noexcept

最初に登場する英字を大文字にします。

Returns
*this

◆ capitalized() [1/2]

String s3d::String::capitalized ( ) &&

最初に登場する英字を大文字にした文字列を返します。

Returns
新しい文字列

◆ capitalized() [2/2]

String s3d::String::capitalized ( ) const &

最初に登場する英字を大文字にした文字列を返します。

Returns
新しい文字列

◆ case_insensitive_compare()

int32 s3d::String::case_insensitive_compare ( StringView  s) const
noexcept

英字の大小を無視して文字列の大小を比較します。

Parameters
s比較対象の文字列
Returns
比較結果。等しければ 0, 小さければ -1, 大きければ 1

◆ case_insensitive_equals()

bool s3d::String::case_insensitive_equals ( StringView  s) const
noexcept

英字の大小を無視して文字列を比較します。

Parameters
s比較対象の文字列
Returns
英字の大小を無視した時に文字列が等しい場合 true, それ以外の場合は false

◆ cbegin()

const_iterator s3d::String::cbegin ( ) const
noexcept

◆ cend()

const_iterator s3d::String::cend ( ) const
noexcept

◆ clear()

void s3d::String::clear ( )
noexcept

格納している文字列を消去し、空の文字列にします。

◆ compare() [1/3]

int32 s3d::String::compare ( const String s) const
noexcept

文字列の大小を比較します。

Parameters
s比較対象の文字列
Returns
比較結果。等しければ 0, 小さければ <0, 大きければ >0

◆ compare() [2/3]

int32 s3d::String::compare ( const value_type s) const
noexcept

文字列の大小を比較します。

Parameters
s比較対象の文字列
Remarks
s は NULL 終端されている必要があります。
Returns
比較結果。等しければ 0, 小さければ <0, 大きければ >0

◆ compare() [3/3]

int32 s3d::String::compare ( StringView  s) const
noexcept

文字列の大小を比較します。

Parameters
s比較対象の文字列
Returns
比較結果。等しければ 0, 小さければ <0, 大きければ >0

◆ count() [1/2]

size_t s3d::String::count ( StringView  s) const

指定した文字列の個数を数えます。

Parameters
s検索する文字列
Remarks
"aaa" から "aa" を検索する場合の結果は 2 です。
Returns
見つかった文字列の個数

◆ count() [2/2]

size_t s3d::String::count ( value_type  ch) const
noexcept

指定した値と等しい要素の個数を返します。

Parameters
ch検索する値
Returns
指定した値と等しい要素の個数

◆ count_if()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
size_t s3d::String::count_if ( Fty  f) const

条件を満たす要素の個数を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
条件を満たす要素の個数

◆ crbegin()

const_reverse_iterator s3d::String::crbegin ( ) const
noexcept

◆ crend()

const_reverse_iterator s3d::String::crend ( ) const
noexcept

◆ data() [1/2]

const value_type* s3d::String::data ( ) const
noexcept

◆ data() [2/2]

value_type* s3d::String::data ( )
noexcept

◆ each() [1/2]

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 & >> * = nullptr>
String& s3d::String::each ( Fty  f)

全ての要素を順番に引数にして関数を呼び出します。

Template Parameters
Fty呼び出す関数の型
Parameters
f呼び出す関数
Remarks
for (auto& ch : s) f(ch); と同じです。
Returns
*this

◆ each() [2/2]

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 >> * = nullptr>
const String& s3d::String::each ( Fty  f) const

全ての要素を順番に引数にして関数を呼び出します。

Template Parameters
Fty呼び出す関数の型
Parameters
f呼び出す関数
Remarks
for (const auto& ch : s) f(ch); と同じです。
Returns
*this

◆ each_index() [1/2]

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, char32 & >> * = nullptr>
String& s3d::String::each_index ( Fty  f)

全ての要素とそのインデックスを順番に引数にして関数を呼び出します。

Template Parameters
Fty呼び出す関数の型
Parameters
f呼び出す関数
Remarks
for (size_t i = 0; auto& ch : s) f(i++, ch); と同じです。
Returns
*this

◆ each_index() [2/2]

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, size_t, char32 >> * = nullptr>
const String& s3d::String::each_index ( Fty  f) const

全ての要素とそのインデックスを順番に引数にして関数を呼び出します。

Template Parameters
Fty呼び出す関数の型
Parameters
f呼び出す関数
Remarks
for (size_t i = 0; const auto& ch : s) f(i++, ch); と同じです。
Returns
*this

◆ empty()

bool s3d::String::empty ( ) const
noexcept

文字列が空であるかを返します。

Returns
文字列が空である場合 true, それ以外の場合は false

◆ end() [1/2]

const_iterator s3d::String::end ( ) const
noexcept

◆ end() [2/2]

iterator s3d::String::end ( )
noexcept

◆ ends_with() [1/2]

bool s3d::String::ends_with ( StringView  s) const

文字列が指定した文字列で終わるかを返します。

Parameters
s検索する文字列
Returns
指定した文字列で終わる場合 true, それ以外の場合は false

◆ ends_with() [2/2]

bool s3d::String::ends_with ( value_type  ch) const
noexcept

文字列が指定した文字で終わるかを返します。

Parameters
ch検索する文字
Returns
指定した文字で終わる場合 true, それ以外の場合は false

◆ erase() [1/3]

iterator s3d::String::erase ( const_iterator  first,
const_iterator  last 
)
noexcept

◆ erase() [2/3]

iterator s3d::String::erase ( const_iterator  where)
noexcept

◆ erase() [3/3]

String& s3d::String::erase ( size_t  offset = 0,
size_t  count = npos 
)

◆ expandTabs()

String s3d::String::expandTabs ( size_t  tabSize = 4) const

タブ文字を半角空白に置換した文字列を返します。

Parameters
tabSizeタブ置換後の半角空白の数
Returns
新しい文字列

◆ fetch()

value_type s3d::String::fetch ( size_t  index,
value_type  defaultValue 
) const
noexcept

指定したインデックスにある要素を返します。インデックスが範囲外の場合デフォルト値を返します。

Parameters
indexインデックス
defaultValueインデックスが範囲外の場合に返すデフォルト値
Returns
指定したインデックスにある要素、範囲外の場合 defaultValue

◆ fill()

String& s3d::String::fill ( value_type  value)

指定した値を全ての要素に代入します。

Parameters
value代入する値
Returns
*this

◆ filter()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String s3d::String::filter ( Fty  f) const

指定した条件を満たす要素だけを集めた新しい文字列を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Remarks
結果において、要素の前後関係は維持されます。
Returns
指定した条件を満たす要素を集めた新しい文字列

◆ front() [1/2]

const value_type& s3d::String::front ( ) const
noexcept

先頭の文字への参照を返します。

Remarks
空の文字列に対しては使えません。
Returns
先頭の文字への参照

◆ front() [2/2]

value_type& s3d::String::front ( )
noexcept

先頭の文字への参照を返します。

Remarks
空の文字列に対しては使えません。
Returns
先頭の文字への参照

◆ get_allocator()

allocator_type s3d::String::get_allocator ( ) const
noexcept

◆ hash()

uint64 s3d::String::hash ( ) const
noexcept

文字列のハッシュを返します。

Returns
文字列のハッシュ

◆ includes() [1/2]

bool s3d::String::includes ( StringView  s) const

指定した文字列を含むかを返します。

Parameters
ch検索する文字列
Returns
指定した文字列を含む場合 true, それ以外の場合は false

◆ includes() [2/2]

bool s3d::String::includes ( value_type  ch) const

指定した値と等しい要素があるかを返します。

Parameters
value検索する値
Returns
指定した値と等しい要素がある場合 true, それ以外の場合は false

◆ includes_if()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool s3d::String::includes_if ( Fty  f) const

指定した条件を満たす要素があるかを返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Remarks
.any(f) と同じです。
Returns
条件を満たす要素が 1 つでもあれば true, 俺以外の場合は false

◆ indexNotOfAny()

size_t s3d::String::indexNotOfAny ( StringView  anyof,
size_t  offset = 0 
) const

検索する文字に含まれない文字が最初に現れた位置を返します。

Parameters
anyof検索する文字の集合
offset検索を開始する位置
Returns
検索した文字とは異なる文字が最初に現れた位置。見つからなかった場合は npos

◆ indexOf() [1/2]

size_t s3d::String::indexOf ( StringView  s,
size_t  offset = 0 
) const
noexcept

文字列を指定した位置から検索し、最初に現れた位置を返します。

Parameters
s検索する文字列
offset検索を開始する位置
Returns
検索した文字列が最初に現れた位置。見つからなかった場合は npos

◆ indexOf() [2/2]

size_t s3d::String::indexOf ( value_type  ch,
size_t  offset = 0 
) const
noexcept

文字を指定した位置から検索し、最初に現れた位置を返します。

Parameters
ch検索する文字
offset検索を開始する位置
Returns
検索した文字が最初に現れた位置。見つからなかった場合は npos

◆ indexOfAny()

size_t s3d::String::indexOfAny ( StringView  anyof,
size_t  offset = 0 
) const
noexcept

検索する文字のいずれかが最初に現れた位置を返します。

Parameters
anyof検索する文字の集合
offset検索を開始する位置
Returns
検索した文字が最初に現れた位置。見つからなかった場合は npos

◆ indexOfNot()

size_t s3d::String::indexOfNot ( value_type  ch,
size_t  offset = 0 
) const
noexcept

文字を指定した位置から検索し、最初にそれとは異なる文字が現れた位置を返します。

Parameters
ch検索する文字
offset検索を開始する位置
Returns
検索した文字とは異なる文字が最初に現れた位置。見つからなかった場合は npos

◆ insert() [1/9]

template<class Iterator >
String& s3d::String::insert ( const_iterator  first1,
const_iterator  last1,
Iterator  first2,
Iterator  last2 
)

◆ insert() [2/9]

template<class Iterator >
iterator s3d::String::insert ( const_iterator  where,
Iterator  first,
Iterator  last 
)

◆ insert() [3/9]

iterator s3d::String::insert ( const_iterator  where,
size_t  count,
value_type  ch 
)

◆ insert() [4/9]

iterator s3d::String::insert ( const_iterator  where,
value_type  ch 
)

◆ insert() [5/9]

String& s3d::String::insert ( size_t  offset,
const String s 
)

◆ insert() [6/9]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::insert ( size_t  offset,
const StringViewIsh &  s 
)

◆ insert() [7/9]

String& s3d::String::insert ( size_t  offset,
const value_type s 
)

◆ insert() [8/9]

String& s3d::String::insert ( size_t  offset,
size_t  count,
value_type  ch 
)

◆ insert() [9/9]

String& s3d::String::insert ( size_t  offset,
std::initializer_list< value_type ilist 
)

◆ isEmpty()

bool s3d::String::isEmpty ( ) const
noexcept

文字列が空であるかを返します。

Remarks
empty() と同じです。
Returns
文字列が空である場合 true, それ以外の場合は false

◆ keep_if()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String& s3d::String::keep_if ( Fty  f)

指定した条件を満たす要素のみを残して、それ以外を文字列から削除します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
*this

◆ lastIndexNotOf()

size_t s3d::String::lastIndexNotOf ( value_type  ch,
size_t  offset = npos 
) const
noexcept

文字を後方から逆順に検索し、最初にそれとは異なる文字が現れた位置を返します。

Parameters
ch検索する文字
offset検索を開始する位置。npos の場合は終端から
Returns
検索した文字とは異なる文字が最初に現れた位置。見つからなかった場合は npos

◆ lastIndexNotOfAny()

size_t s3d::String::lastIndexNotOfAny ( StringView  anyof,
size_t  offset = npos 
) const

文字を後方から逆順に検索し、検索する文字に含まれない文字が最初に現れた位置を返します。

Parameters
anyof検索する文字の集合
offset検索を開始する位置。npos の場合は終端から
Returns
検索した文字とは異なる文字が最初に現れた位置。見つからなかった場合は npos

◆ lastIndexOf() [1/2]

size_t s3d::String::lastIndexOf ( StringView  s,
size_t  offset = npos 
) const
noexcept

文字列を後方から逆順に検索し、最初に現れた位置を返します。

Parameters
s検索する文字列
offset検索を開始する位置。npos の場合は終端から
Returns
検索した文字列が最初に現れた位置。見つからなかった場合は npos

◆ lastIndexOf() [2/2]

size_t s3d::String::lastIndexOf ( value_type  ch,
size_t  offset = npos 
) const
noexcept

文字を後方から逆順に検索し、最初に現れた位置を返します。

Parameters
ch検索する文字
offset検索を開始する位置。npos の場合は終端から
Returns
検索した文字が最初に現れた位置。見つからなかった場合は npos

◆ lastIndexOfAny()

size_t s3d::String::lastIndexOfAny ( StringView  anyof,
size_t  offset = npos 
) const
noexcept

文字を後方から逆順に検索し、検索する文字のいずれかが最初に現れた位置を返します。

Parameters
anyof検索する文字の集合
offset検索を開始する位置。npos の場合は終端から
Returns
検索した文字が最初に現れた位置。見つからなかった場合は npos

◆ layout()

String s3d::String::layout ( size_t  width) const

指定した 1 行の文字数で改行するようにした新しい文字列を返します。

Parameters
width1 行の文字数
Returns
新しい文字列

◆ length()

size_t s3d::String::length ( ) const
noexcept

文字列の長さ(要素数)を返します。

Returns
文字列の長さ(要素数)

◆ levenshteinDistanceFrom()

size_t s3d::String::levenshteinDistanceFrom ( StringView  other) const
noexcept

別の文字列とのレーベンシュタイン距離を計算して返します。

Parameters
other別の文字列
Returns
別の文字列とのレーベンシュタイン距離

◆ lowercase()

String& s3d::String::lowercase ( )
noexcept

英字をすべて小文字にします。

Returns
*this

◆ lowercased() [1/2]

String s3d::String::lowercased ( ) &&

英字をすべて小文字にした新しい文字列を返します。

Returns
新しい文字列

◆ lowercased() [2/2]

String s3d::String::lowercased ( ) const &

英字をすべて小文字にした新しい文字列を返します。

Returns
新しい文字列

◆ lpad()

String& s3d::String::lpad ( size_t  length,
value_type  fillChar = U' ' 
)

文字列の左を埋め文字で埋めます。

Parameters
length文字列の左を埋め文字で埋めた後の文字列の長さ
fillChar埋め文字
Remarks
元の文字列の長さが length より大きい場合、変更は行われません。
Returns
*this

◆ lpadded() [1/2]

String s3d::String::lpadded ( size_t  length,
value_type  fillChar = U' ' 
) &&

文字列の左を埋め文字で埋めた新しい文字列を返します。

Parameters
length文字列の左を埋め文字で埋めた後の文字列の長さ
fillChar埋め文字
Remarks
元の文字列の長さが length より大きい場合、元の文字列のコピーが返ります。
Returns
新しい文字列

◆ lpadded() [2/2]

String s3d::String::lpadded ( size_t  length,
value_type  fillChar = U' ' 
) const &

文字列の左を埋め文字で埋めた新しい文字列を返します。

Parameters
length文字列の左を埋め文字で埋めた後の文字列の長さ
fillChar埋め文字
Remarks
元の文字列の長さが length より大きい場合、元の文字列のコピーが返ります。
Returns
新しい文字列

◆ ltrim()

String& s3d::String::ltrim ( )

文字列の先頭にある空白文字を削除します。

Returns
*this

◆ ltrimmed() [1/2]

String s3d::String::ltrimmed ( ) &&

文字列の先頭にある空白文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ ltrimmed() [2/2]

String s3d::String::ltrimmed ( ) const &

文字列の先頭にある空白文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ map()

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 >> * = nullptr>
auto s3d::String::map ( Fty  f) const

文字列の各要素に関数を適用した戻り値からなる配列を返します。

Template Parameters
Fty各文字に適用する関数の型
Parameters
f各文字に適用する関数
Returns
文字列の各要素に関数を適用した戻り値からなる配列

◆ max_size()

size_t s3d::String::max_size ( ) const
noexcept

◆ narrow()

std::string s3d::String::narrow ( ) const

文字列を std::string に変換します。

Returns
変換された文字列

◆ none()

template<class Fty = decltype(Identity), std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
bool s3d::String::none ( Fty  f = Identity) const

条件を満たす要素が存在しないかを返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
条件を満たす要素数が 0 個の場合 true, それ以外の場合は false

◆ operator bool()

s3d::String::operator bool ( ) const
explicitnoexcept

文字列が空でないかを返します。

Returns
文字列が空でない場合 true, それ以外の場合は false

◆ operator StringView()

s3d::String::operator StringView ( ) const
noexcept

◆ operator+=() [1/6]

String& s3d::String::operator+= ( const String s)

◆ operator+=() [2/6]

String& s3d::String::operator+= ( const string_type s)

◆ operator+=() [3/6]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::operator+= ( const StringViewIsh &  s)

◆ operator+=() [4/6]

String& s3d::String::operator+= ( const value_type s)

◆ operator+=() [5/6]

String& s3d::String::operator+= ( std::initializer_list< value_type ilist)

◆ operator+=() [6/6]

String& s3d::String::operator+= ( value_type  ch)

◆ operator<<()

String& s3d::String::operator<< ( value_type  ch)

◆ operator=() [1/7]

String& s3d::String::operator= ( const String other)

◆ operator=() [2/7]

String& s3d::String::operator= ( const string_type s)

◆ operator=() [3/7]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::operator= ( const StringViewIsh &  s)

◆ operator=() [4/7]

String& s3d::String::operator= ( const value_type s)

◆ operator=() [5/7]

String& s3d::String::operator= ( std::initializer_list< value_type ilist)

◆ operator=() [6/7]

String& s3d::String::operator= ( String &&  other)
noexcept

◆ operator=() [7/7]

String& s3d::String::operator= ( string_type &&  s)
noexcept

◆ operator[]() [1/3]

value_type s3d::String::operator[] ( size_t  offset) &&
noexcept

◆ operator[]() [2/3]

value_type& s3d::String::operator[] ( size_t  offset) &
noexcept

◆ operator[]() [3/3]

const value_type& s3d::String::operator[] ( size_t  offset) const &
noexcept

◆ pop_back()

void s3d::String::pop_back ( )
noexcept

末尾の文字を削除します。

◆ pop_back_N()

void s3d::String::pop_back_N ( size_t  n)
noexcept

末尾の n 文字を削除します。

Remarks
n が現在の文字数より大きい場合は空の文字列にします。
Parameters
n削除する文字数

◆ pop_front()

void s3d::String::pop_front ( )

先頭の文字を削除します。

◆ pop_front_N()

void s3d::String::pop_front_N ( size_t  n)

先頭の n 文字を削除します。

Remarks
n が現在の文字数より大きい場合は空の文字列にします。
Parameters
n削除する文字数

◆ push_back()

void s3d::String::push_back ( value_type  ch)

末尾に文字を追加します。

Parameters
ch追加する文字

◆ push_front()

void s3d::String::push_front ( value_type  ch)

先頭に文字を追加します。

Parameters
ch追加する文字

◆ rbegin() [1/2]

const_reverse_iterator s3d::String::rbegin ( ) const
noexcept

◆ rbegin() [2/2]

reverse_iterator s3d::String::rbegin ( )
noexcept

◆ release()

void s3d::String::release ( )

◆ remove() [1/2]

String& s3d::String::remove ( StringView  s)

指定した文字列をもとの文字列から削除します。

Parameters
s削除する文字列
Returns
*this

◆ remove() [2/2]

String& s3d::String::remove ( value_type  ch)

指定した文字を文字列から削除します。

Parameters
ch削除する文字
Returns
*this

◆ remove_at()

String& s3d::String::remove_at ( size_t  index)

指定したインデックスにある要素を文字列から削除します。

Parameters
indexインデックス
Returns
*this

◆ remove_if()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String& s3d::String::remove_if ( Fty  f)

指定した条件を満たす文字を削除します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
*this

◆ removed() [1/3]

String s3d::String::removed ( StringView  s) const

指定した文字列を除去した新しい文字列を返します。

Parameters
s除去対象の文字列
Returns
新しい文字列

◆ removed() [2/3]

String s3d::String::removed ( value_type  ch) &&

指定した文字を除去した新しい文字列を返します。

Parameters
ch除去対象の文字
Returns
新しい文字列

◆ removed() [3/3]

String s3d::String::removed ( value_type  ch) const &

指定した文字を除去した新しい文字列を返します。

Parameters
ch除去対象の文字
Returns
新しい文字列

◆ removed_at() [1/2]

String s3d::String::removed_at ( size_t  index) &&

定したインデックスにある要素を削除した新しい文字列を返します。

Parameters
indexインデックス
Returns
新しい文字列

◆ removed_at() [2/2]

String s3d::String::removed_at ( size_t  index) const &

定したインデックスにある要素を削除した新しい文字列を返します。

Parameters
indexインデックス
Returns
新しい文字列

◆ removed_if() [1/2]

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String s3d::String::removed_if ( Fty  f) &&

指定した条件を満たす文字を削除した新しい文字列を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
新しい文字列

◆ removed_if() [2/2]

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String s3d::String::removed_if ( Fty  f) const &

指定した条件を満たす文字を削除した新しい文字列を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
新しい文字列

◆ rend() [1/2]

const_reverse_iterator s3d::String::rend ( ) const
noexcept

◆ rend() [2/2]

reverse_iterator s3d::String::rend ( )
noexcept

◆ replace() [1/9]

String& s3d::String::replace ( const StringView  oldStr,
const StringView  newStr 
)

指定した文字列を置換します。

Parameters
oldStr置換対象の文字列
newStr置換後の文字列
Returns
*this

◆ replace() [2/9]

String& s3d::String::replace ( const_iterator  first,
const_iterator  last,
const String s 
)

◆ replace() [3/9]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::replace ( const_iterator  first,
const_iterator  last,
const StringViewIsh &  s 
)

◆ replace() [4/9]

String& s3d::String::replace ( const_iterator  first,
const_iterator  last,
const value_type s 
)

◆ replace() [5/9]

template<class Iterator >
String& s3d::String::replace ( const_iterator  first,
const_iterator  last,
Iterator  first2,
Iterator  last2 
)

◆ replace() [6/9]

String& s3d::String::replace ( size_type  pos,
size_type  count,
const String s 
)

◆ replace() [7/9]

template<class StringViewIsh , class = IsStringViewIsh<StringViewIsh>>
String& s3d::String::replace ( size_type  pos,
size_type  count,
const StringViewIsh &  s 
)

◆ replace() [8/9]

String& s3d::String::replace ( size_type  pos,
size_type  count,
const value_type s 
)

◆ replace() [9/9]

String& s3d::String::replace ( value_type  oldChar,
value_type  newChar 
)

指定した文字を置換します。

Parameters
oldChar置換対象の文字
newChar置換後の文字
Returns
*this

◆ replace_if()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String& s3d::String::replace_if ( Fty  f,
const value_type  newChar 
)

指定した条件を満たす文字を別の文字に置き換えます。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
newChar置換後の文字
Returns
*this

◆ replaced() [1/3]

String s3d::String::replaced ( StringView  oldStr,
StringView  newStr 
) const

指定した文字列を置換した新しい文字列を返します。

Parameters
oldStr置換対象の文字列
newStr置換後の文字列
Returns
新しい文字列

◆ replaced() [2/3]

String s3d::String::replaced ( value_type  oldChar,
value_type  newChar 
) &&

指定した文字を置換した新しい文字列を返します。

Parameters
oldChar置換対象の文字
newChar置換後の文字
Returns
新しい文字列

◆ replaced() [3/3]

String s3d::String::replaced ( value_type  oldChar,
value_type  newChar 
) const &

指定した文字を置換した新しい文字列を返します。

Parameters
oldChar置換対象の文字
newChar置換後の文字
Returns
新しい文字列

◆ replaced_if() [1/2]

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String s3d::String::replaced_if ( Fty  f,
const value_type  newChar 
) &&

指定した条件を満たす文字を別の文字に置き換えた新しい文字列を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
newChar置換後の文字
Returns
新しい文字列

◆ replaced_if() [2/2]

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String s3d::String::replaced_if ( Fty  f,
const value_type  newChar 
) const &

指定した条件を満たす文字を別の文字に置き換えた新しい文字列を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
newChar置換後の文字
Returns
新しい文字列

◆ reserve()

void s3d::String::reserve ( size_t  newCapacity)

◆ resize() [1/2]

void s3d::String::resize ( size_t  newSize)

◆ resize() [2/2]

void s3d::String::resize ( size_t  newSize,
value_type  ch 
)

◆ reverse()

String& s3d::String::reverse ( )

文字列を反転します。

Returns
*this

◆ reverse_each() [1/2]

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 & >> * = nullptr>
String& s3d::String::reverse_each ( Fty  f)

文字列の各文字への参照を引数に、末尾の文字から順に関数を呼び出します。

Template Parameters
Fty呼び出す関数の型
Parameters
f呼び出す関数
Returns
*this

◆ reverse_each() [2/2]

template<class Fty , std::enable_if_t< std::is_invocable_v< Fty, char32 >> * = nullptr>
const String& s3d::String::reverse_each ( Fty  f) const

文字列の各文字への参照を引数に、末尾の文字から順に関数を呼び出します。

Template Parameters
Fty呼び出す関数の型
Parameters
f呼び出す関数
Returns
*this

◆ reversed() [1/2]

String s3d::String::reversed ( ) &&

反転した文字列を返します。

Returns
新しい文字列

◆ reversed() [2/2]

String s3d::String::reversed ( ) const &

反転した文字列を返します。

Returns
新しい文字列

◆ rotate()

String& s3d::String::rotate ( std::ptrdiff_t  count = 1)

文字列の各文字の位置をシフトさせ、はみ出た文字は反対側に挿入します。

Parameters
count文字をシフトする数
Returns
*this

◆ rotated() [1/2]

String s3d::String::rotated ( std::ptrdiff_t  count = 1) &&

文字列の各文字の位置をシフトさせ、はみ出た文字を反対側に挿入した新しい文字列を返します。

Parameters
count文字をシフトする数
Returns
新しい文字列

◆ rotated() [2/2]

String s3d::String::rotated ( std::ptrdiff_t  count = 1) const &

文字列の各文字の位置をシフトさせ、はみ出た文字を反対側に挿入した新しい文字列を返します。

Parameters
count文字をシフトする数
Returns
新しい文字列

◆ rpad()

String& s3d::String::rpad ( size_t  length,
value_type  fillChar = U' ' 
)

文字列の右を埋め文字で埋めます。

Parameters
length文字列の右を埋め文字で埋めた後の文字列の長さ
fillChar埋め文字
Remarks
元の文字列の長さが length より大きい場合、変更は行われません。
Returns
*this

◆ rpadded() [1/2]

String s3d::String::rpadded ( size_t  length,
value_type  fillChar = U' ' 
) &&

文字列を指定された文字で右詰めした新しい文字列を返します。

Parameters
length右詰めした後の文字列の長さ
fillChar埋め文字
Remarks
元の文字列の長さが length より大きい場合、元の文字列のコピーを返します。
Returns
新しい文字列

◆ rpadded() [2/2]

String s3d::String::rpadded ( size_t  length,
value_type  fillChar = U' ' 
) const &

文字列を指定された文字で右詰めした新しい文字列を返します。

Parameters
length右詰めした後の文字列の長さ
fillChar埋め文字
Remarks
元の文字列の長さが length より大きい場合、元の文字列のコピーを返します。
Returns
新しい文字列

◆ rsort()

String& s3d::String::rsort ( )
noexcept

◆ rsorted() [1/2]

String s3d::String::rsorted ( ) &&

◆ rsorted() [2/2]

String s3d::String::rsorted ( ) const &

◆ rtrim()

String& s3d::String::rtrim ( )

文字列の末尾にある空白文字を削除します。

Returns
*this

◆ rtrimmed() [1/2]

String s3d::String::rtrimmed ( ) &&

文字列の末尾にある空白文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ rtrimmed() [2/2]

String s3d::String::rtrimmed ( ) const &

文字列の末尾にある空白文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ shrink_to_fit()

void s3d::String::shrink_to_fit ( )

◆ shuffle() [1/2]

String& s3d::String::shuffle ( )

文字列をランダムに並び替えます。

Returns
*this

◆ shuffle() [2/2]

SIV3D_CONCEPT_URBG String& s3d::String::shuffle ( URBG &&  rbg)

指定された乱数生成器を使って文字列をランダムに並び替えます。

Parameters
rbg使用する乱数生成器
Returns
*this

◆ shuffled() [1/4]

String s3d::String::shuffled ( ) &&

ランダムに並び替えた新しい文字列を返します。

Returns
新しい文字列

◆ shuffled() [2/4]

String s3d::String::shuffled ( ) const &

ランダムに並び替えた新しい文字列を返します。

Returns
新しい文字列

◆ shuffled() [3/4]

SIV3D_CONCEPT_URBG String s3d::String::shuffled ( URBG &&  rbg) &&

指定された乱数生成器を使ってランダムに並び替えた新しい文字列を返します。

Parameters
rbg用する乱数生成器
Returns
新しい文字列

◆ shuffled() [4/4]

SIV3D_CONCEPT_URBG String s3d::String::shuffled ( URBG &&  rbg) const &

指定された乱数生成器を使ってランダムに並び替えた新しい文字列を返します。

Parameters
rbg用する乱数生成器
Returns
新しい文字列

◆ size()

size_t s3d::String::size ( ) const
noexcept

文字列の長さ(要素数)を返します。

Remarks
.length() と同じです。
Returns
文字列の長さ(要素数)

◆ size_bytes()

size_t s3d::String::size_bytes ( ) const
noexcept

文字列のデータサイズ(バイト)を返します。

Remarks
sizeof(value_type) * length() です。
Returns
文字列のデータサイズ(バイト)

◆ sort()

String& s3d::String::sort ( )
noexcept

文字列をソートします。

Returns
*this

◆ sort_and_unique()

String& s3d::String::sort_and_unique ( )

文字列をソートし、重複する文字を削除します。

Returns
*this

◆ sort_by()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32, char32 >> * = nullptr>
String& s3d::String::sort_by ( Fty  f)

文字列を指定された比較関数でソートします。

Template Parameters
Fty使用する比較関数の型
Parameters
f使用する比較関数
Returns
*this

◆ sorted() [1/2]

String s3d::String::sorted ( ) &&

文字列をソートした新しい文字列を返します。

Returns
新しい文字列

◆ sorted() [2/2]

String s3d::String::sorted ( ) const &

文字列をソートした新しい文字列を返します。

Returns
新しい文字列

◆ sorted_and_uniqued() [1/2]

String s3d::String::sorted_and_uniqued ( ) &&

文字列をソートし、重複する文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ sorted_and_uniqued() [2/2]

String s3d::String::sorted_and_uniqued ( ) const &

文字列をソートし、重複する文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ sorted_by() [1/2]

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32, char32 >> * = nullptr>
String s3d::String::sorted_by ( Fty  f) &&

文字列を指定された比較関数でソートした新しい文字列を返します。

Template Parameters
Fty使用する比較関数の型
Parameters
f使用する比較関数
Returns
新しい文字列

◆ sorted_by() [2/2]

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32, char32 >> * = nullptr>
String s3d::String::sorted_by ( Fty  f) const &

文字列を指定された比較関数でソートした新しい文字列を返します。

Template Parameters
Fty使用する比較関数の型
Parameters
f使用する比較関数
Returns
新しい文字列

◆ split()

Array<String, std::allocator<String> > s3d::String::split ( value_type  ch) const

指定した区切り文字で文字列を分割します。

Parameters
ch区切り文字
Returns
分割された文字列

◆ split_at()

std::pair<String, String> s3d::String::split_at ( size_t  pos) const

◆ split_lines()

Array<String, std::allocator<String> > s3d::String::split_lines ( ) const

◆ stable_unique()

String& s3d::String::stable_unique ( )

文字列をソートせずに、重複する文字を削除します。

Returns
*this

◆ stable_uniqued()

String s3d::String::stable_uniqued ( ) const

文字列をソートせずに、重複する文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ starts_with() [1/2]

bool s3d::String::starts_with ( StringView  s) const

文字列が指定した文字列から始まるかを返します。

Parameters
s検索する文字列
Returns
指定した文字列から始まる場合 true, それ以外の場合は false

◆ starts_with() [2/2]

bool s3d::String::starts_with ( value_type  ch) const
noexcept

文字列が指定した文字から始まるかを返します。

Parameters
ch検索する文字
Returns
指定した文字から始まる場合 true, それ以外の場合は false

◆ str() [1/2]

const string_type& s3d::String::str ( ) const
noexcept

◆ str() [2/2]

string_type& s3d::String::str ( )
noexcept

◆ substr()

String s3d::String::substr ( size_t  offset = 0,
size_t  count = npos 
) const

部分文字列を取得します。

Parameters
offset開始インデックス
count取得する文字数。末尾までの場合 npos
Returns
部分文字列

◆ substrView() [1/2]

StringView s3d::String::substrView ( size_t  offset = 0,
size_t  count = npos 
) &&
delete

◆ substrView() [2/2]

StringView s3d::String::substrView ( size_t  offset = 0,
size_t  count = npos 
) const &

部分文字列へのビューを取得します。

Parameters
offset開始インデックス
count取得する文字数。末尾までの場合 npos
Returns
部分文字列へのビュー

◆ swap()

void s3d::String::swap ( String other)
noexcept

◆ swapcase()

String& s3d::String::swapcase ( )
noexcept

英字の大文字と小文字を入れ替えます。

Returns
*this

◆ swapcased() [1/2]

String s3d::String::swapcased ( ) &&

英字の大文字と小文字を入れ替えた文字列を返します。

Returns
新しい文字列

◆ swapcased() [2/2]

String s3d::String::swapcased ( ) const &

英字の大文字と小文字を入れ替えた文字列を返します。

Returns
新しい文字列

◆ take()

String s3d::String::take ( size_t  n) const

文字列の先頭から指定された文字数分取り出した新しい文字列を返します。

Parameters
n取り出す文字数
Returns
新しい文字列

◆ take_while()

template<class Fty , std::enable_if_t< std::is_invocable_r_v< bool, Fty, char32 >> * = nullptr>
String s3d::String::take_while ( Fty  f) const

文字列の先頭から、指定された条件を満たす連続した文字を取り出した新しい文字列を返します。

Template Parameters
Fty条件を記述した関数の型
Parameters
f条件を記述した関数
Returns
新しい文字列

◆ toUTF16()

std::u16string s3d::String::toUTF16 ( ) const

文字列を UTF-16 文字列に変換します。

Returns
変換された文字列

◆ toUTF32()

const std::u32string& s3d::String::toUTF32 ( ) const
noexcept

文字列を UTF-32 文字列に変換します。

Returns
変換された文字列

◆ toUTF8()

std::string s3d::String::toUTF8 ( ) const

文字列を UTF-8 文字列に変換します。

Returns
変換された文字列

◆ toWstr()

std::wstring s3d::String::toWstr ( ) const

文字列を std::wstring に変換します。

Returns
変換された文字列

◆ trim()

String& s3d::String::trim ( )

文字列の先頭と末尾にある空白文字を削除します。

Returns
*this

◆ trimmed() [1/2]

String s3d::String::trimmed ( ) &&

文字列の先頭と末尾にある空白文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ trimmed() [2/2]

String s3d::String::trimmed ( ) const &

文字列の先頭と末尾にある空白文字を削除した新しい文字列を返します。

Returns
新しい文字列

◆ unique_consecutive()

String& s3d::String::unique_consecutive ( )

同じ文字が連続する場合、その先頭以外を除去します。

Returns
*this

◆ uniqued_consecutive() [1/2]

String s3d::String::uniqued_consecutive ( ) &&

同じ文字が連続する場合、その先頭以外を除去した新しい文字列を返します。

Returns
新しい文字列

◆ uniqued_consecutive() [2/2]

String s3d::String::uniqued_consecutive ( ) const &

同じ文字が連続する場合、その先頭以外を除去した新しい文字列を返します。

Returns
新しい文字列

◆ uppercase()

String& s3d::String::uppercase ( )
noexcept

英字をすべて大文字にします。

Returns
*this

◆ uppercased() [1/2]

String s3d::String::uppercased ( ) &&

英字をすべて大文字にした文字列を返します。

Returns
新しい文字列

◆ uppercased() [2/2]

String s3d::String::uppercased ( ) const &

英字をすべて大文字にした文字列を返します。

Returns
新しい文字列

◆ values_at()

String s3d::String::values_at ( std::initializer_list< size_t >  indices) const

複数のインデックスを取り、それらの文字からなる新しい文字列を返します。

Parameters
indicesインデックス
Remarks
String("abcde").values_at({0, 3, 4}); // "ade"
Returns
新しい文字列

◆ xml_escape()

String& s3d::String::xml_escape ( )

文字列に XML エスケープを行います。

Remarks
", \, &, >, < などのエスケープを行います
Returns
*this

◆ xml_escaped()

String s3d::String::xml_escaped ( ) const

XML エスケープした文字列を返します。

Remarks
", \, &, >, < などのエスケープを行います
Returns
新しい文字列

Friends And Related Function Documentation

◆ Formatter

void Formatter ( FormatData formatData,
const String s 
)
friend

◆ operator!= [1/3]

bool operator!= ( const String lhs,
const String rhs 
)
friend

◆ operator!= [2/3]

bool operator!= ( const String lhs,
const value_type rhs 
)
friend

◆ operator!= [3/3]

bool operator!= ( const value_type lhs,
const String rhs 
)
friend

◆ operator+ [1/16]

String operator+ ( const String lhs,
const String rhs 
)
friend

◆ operator+ [2/16]

String operator+ ( const String lhs,
const value_type rhs 
)
friend

◆ operator+ [3/16]

String operator+ ( const String lhs,
const value_type  rhs 
)
friend

◆ operator+ [4/16]

String operator+ ( const String lhs,
String &&  rhs 
)
friend

◆ operator+ [5/16]

String operator+ ( const String lhs,
StringView  rhs 
)
friend

◆ operator+ [6/16]

String operator+ ( const value_type lhs,
const String rhs 
)
friend

◆ operator+ [7/16]

String operator+ ( const value_type lhs,
String &&  rhs 
)
friend

◆ operator+ [8/16]

String operator+ ( const value_type  lhs,
const String rhs 
)
friend

◆ operator+ [9/16]

String operator+ ( const value_type  lhs,
String &&  rhs 
)
friend

◆ operator+ [10/16]

String operator+ ( String &&  lhs,
const String rhs 
)
friend

◆ operator+ [11/16]

String operator+ ( String &&  lhs,
const value_type rhs 
)
friend

◆ operator+ [12/16]

String operator+ ( String &&  lhs,
const value_type  rhs 
)
friend

◆ operator+ [13/16]

String operator+ ( String &&  lhs,
String &&  rhs 
)
friend

◆ operator+ [14/16]

String operator+ ( String &&  lhs,
StringView  rhs 
)
friend

◆ operator+ [15/16]

String operator+ ( StringView  lhs,
const String rhs 
)
friend

◆ operator+ [16/16]

String operator+ ( StringView  lhs,
String &&  rhs 
)
friend

◆ operator< [1/3]

bool operator< ( const String lhs,
const String rhs 
)
friend

◆ operator< [2/3]

bool operator< ( const String lhs,
const value_type rhs 
)
friend

◆ operator< [3/3]

bool operator< ( const value_type lhs,
const String rhs 
)
friend

◆ operator<< [1/3]

std::basic_ostream<char32>& operator<< ( std::basic_ostream< char32 > &  output,
const String value 
)
friend

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  output,
const String value 
)
friend

◆ operator<< [3/3]

std::wostream& operator<< ( std::wostream &  output,
const String value 
)
friend

◆ operator<= [1/3]

bool operator<= ( const String lhs,
const String rhs 
)
friend

◆ operator<= [2/3]

bool operator<= ( const String lhs,
const value_type rhs 
)
friend

◆ operator<= [3/3]

bool operator<= ( const value_type lhs,
const String rhs 
)
friend

◆ operator== [1/3]

bool operator== ( const String lhs,
const String rhs 
)
friend

◆ operator== [2/3]

bool operator== ( const String lhs,
const value_type rhs 
)
friend

◆ operator== [3/3]

bool operator== ( const value_type lhs,
const String rhs 
)
friend

◆ operator> [1/3]

bool operator> ( const String lhs,
const String rhs 
)
friend

◆ operator> [2/3]

bool operator> ( const String lhs,
const value_type rhs 
)
friend

◆ operator> [3/3]

bool operator> ( const value_type lhs,
const String rhs 
)
friend

◆ operator>= [1/3]

bool operator>= ( const String lhs,
const String rhs 
)
friend

◆ operator>= [2/3]

bool operator>= ( const String lhs,
const value_type rhs 
)
friend

◆ operator>= [3/3]

bool operator>= ( const value_type lhs,
const String rhs 
)
friend

◆ operator>> [1/2]

std::istream& operator>> ( std::istream &  input,
String value 
)
friend

◆ operator>> [2/2]

std::wistream& operator>> ( std::wistream &  input,
String value 
)
friend

Member Data Documentation

◆ npos

constexpr size_type s3d::String::npos { static_cast<size_type>(-1) }
staticconstexpr

The documentation for this class was generated from the following file: