Lumino
ln::String Class Reference

Unicode 文字列を表します。 More...

#include <String.hpp>

Public Member Functions

bool isEmpty () const noexcept
 文字列が空であるかを確認します。
 
const Char * c_str () const noexcept
 C 言語としての文字列表現を取得します。
 
int length () const noexcept
 文字列の長さを取得します。
 
int capacity () const noexcept
 メモリを再確保せずに格納できる最大の要素数を取得します。
 
void clear ()
 文字列をクリアします。
 
void resize (int newLength)
 文字列の長さを変更します。
 
void resize (int newLength, Char ch)
 文字列の長さを変更します。増大した領域を ch で置き換えます。
 
void reserve (int size)
 サイズ変更の予定を指示します。
 
void assign (const Char *str)
 文字列の再代入します。
 
void assign (const Char *str, int length)
 
void assign (int count, Char ch)
 
void assign (const StringRef &str)
 
void append (const Char *str, int length)
 指定された文字列を追加します。
 
void append (const String &str)
 
bool contains (const StringRef &str, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 指定した文字列がこの文字列内に存在するかを判断します。 More...
 
bool contains (Char ch, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 
int indexOf (const StringRef &str, int startIndex=0, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 文字列を検索し、見つかった最初の文字のインデックスを返します。 More...
 
int lastIndexOf (const StringRef &str, int startIndex=-1, int count=-1, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 文字列を検索し、最後に見つかったインデックスを返します。 More...
 
int lastIndexOf (Char ch, int startIndex=-1, int count=-1, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 
bool startsWith (const StringRef &str, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 この文字列の先頭が、指定した文字列と一致するかを判断します。 More...
 
bool startsWith (Char ch, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 
bool endsWith (const StringRef &str, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 この文字列の末尾が、指定した文字列と一致するかを判断します。 More...
 
bool endsWith (Char ch, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 
StringRef substr (int start, int count=-1) const
 文字列の部分文字列を抽出します。 More...
 
StringRef left (int count) const
 文字列の左側(先頭)から指定した文字数を抽出します。 More...
 
StringRef right (int count) const
 文字列の右側(末尾)から指定した文字数を抽出します。 More...
 
String trim () const
 文字列の先頭と末尾の空白を全て削除した文字列を返します。
 
String toUpper () const
 小文字を大文字に変換した文字列を返します。(ロケールの影響を受けません)
 
String toLower () const
 大文字を小文字に変換した文字列を返します。(ロケールの影響を受けません)
 
String toTitleCase () const
 先頭の文字を大文字、以降を小文字に変換した文字列を返します。(ロケールの影響を受けません)
 
String remove (const StringRef &str, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 この文字列から指定した文字をすべて取り除いた新しい文字列を返します。 More...
 
String remove (Char ch, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 
String replace (const StringRef &from, const StringRef &to, CaseSensitivity cs=CaseSensitivity::CaseSensitive) const
 文字列の置換を行います。 More...
 
String insert (int startIndex, const StringRef &value) const
 指定したインデックス位置に文字列を挿入します。 More...
 
List< Stringsplit (const StringRef &delim, StringSplitOptions option=StringSplitOptions::None) const
 文字列をデリミタで分割します。 More...
 
int toInt (int base=0) const
 この文字列を整数値に変換します。 More...
 
int16_t toInt16 (int base=0) const
 この文字列を整数値に変換します。 More...
 
int32_t toInt32 (int base=0) const
 この文字列を整数値に変換します。 More...
 
int64_t toInt64 (int base=0) const
 この文字列を整数値に変換します。 More...
 
uint8_t toUInt8 (int base=0) const
 この文字列を整数値に変換します。 More...
 
uint16_t toUInt16 (int base=0) const
 この文字列を整数値に変換します。 More...
 
uint32_t toUInt32 (int base=0) const
 この文字列を整数値に変換します。 More...
 
uint64_t toUInt64 (int base=0) const
 この文字列を整数値に変換します。 More...
 
bool tryToInt (int *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToInt16 (int16_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToInt32 (int32_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToInt64 (int64_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToUInt8 (uint8_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToUInt16 (uint16_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToUInt32 (uint32_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
bool tryToUInt64 (uint64_t *outValue, int base=0) const
 この文字列を整数値に変換し、成否を返します。 More...
 
std::string toStdString (TextEncoding *encoding=nullptr) const
 ローカルの std::string 型文字列へ変換します。
 
std::wstring toStdWString () const
 ローカルの std::wstring 型文字列へ変換します。
 
CharRef operator[] (int index)
 任意の位置の要素へアクセスします。
 
const Char & operator[] (int index) const noexcept
 任意の位置の要素へアクセスします。
 

Static Public Member Functions

static String concat (const StringRef &str1, const StringRef &str2)
 指定した文字列を連結します。
 
static String concat (const StringRef &str1, const StringRef &str2, const StringRef &str3)
 
static String concat (const StringRef &str1, const StringRef &str2, const StringRef &str3, const StringRef &str4)
 
static String join (const List< String > &list, const StringRef &delim)
 指定した文字列リストを結合した 1 つの文字列を生成します。各要素の間には、指定した区切り記号が挿入されます。
 
template<typename... TArgs>
static String format (const StringRef &format, TArgs &&... args)
 複合書式文字列と可変長引数リストから文字列を生成します。
 
template<typename... TArgs>
static String format (const Locale &locale, const StringRef &format, TArgs &&... args)
 
static int compare (const String &str1, const String &str2, CaseSensitivity cs=CaseSensitivity::CaseSensitive)
 指定した2つの文字列を比較します。 More...
 
static int compare (const StringRef &str1, int index1, const StringRef &str2, int index2, int length=-1, CaseSensitivity cs=CaseSensitivity::CaseSensitive)
 
static String fromCString (const char *str, int length=-1, TextEncoding *encoding=nullptr)
 ローカルの char 文字列を String へ変換します。
 
static String fromCString (const wchar_t *str, int length=-1)
 ローカルの wchar_t 文字列を String へ変換します。
 
static String fromStdString (const std::string &str, TextEncoding *encoding=nullptr)
 ローカルの std::string 型文字列を String へ変換します。
 
static String fromStdString (const std::wstring &str)
 ローカルの std::wstring 型文字列を String へ変換します。
 
static String fromNumber (int32_t value, Char format='D')
 数値を文字列に変換します。 More...
 
static String fromNumber (int64_t value, Char format='D')
 
static String fromNumber (uint32_t value, Char format='D')
 
static String fromNumber (uint64_t value, Char format='D')
 
static String fromNumber (float value, Char format='F', int precision=6)
 
static String fromNumber (double value, Char format='F', int precision=6)
 
static const StringnewLine ()
 現在の環境で定義されている改行文字列を取得します。
 

Detailed Description

Unicode 文字列を表します。

String クラスは環境に依らず、UTF-16 コードで表現される文字の配列です。 文字は Char 型で表される 2Byte 値です。65535を 超えるコード値の文字は、サロゲートペア、つまり2つの連続した文字で格納されます。

文字列はメモリ上に連続的に確保され Null 終端文字を格納します。

Member Function Documentation

◆ append()

void ln::String::append ( const String str)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ assign() [1/3]

void ln::String::assign ( const Char *  str,
int  length 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ assign() [2/3]

void ln::String::assign ( int  count,
Char  ch 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ assign() [3/3]

void ln::String::assign ( const StringRef str)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ compare() [1/2]

static int ln::String::compare ( const String str1,
const String str2,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
)
static

指定した2つの文字列を比較します。

Parameters
[in]str1: 比較文字列
[in]index1: str1 内の部分文字列の開始位置
[in]str2: 比較文字列
[in]index2: str2 内の部分文字列の開始位置
[in]length: 比較する文字数 (-1 の場合、GetLength() の値を使用します)
[in]cs: 大文字と小文字の区別設定
Returns
  • str1 が str2 より小さい → 0 より小さい値
  • str1 と str2 が等しい → 0
  • str1 が str2 より大きい → 0 より大きい値

◆ compare() [2/2]

static int ln::String::compare ( const StringRef str1,
int  index1,
const StringRef str2,
int  index2,
int  length = -1,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ concat() [1/2]

static String ln::String::concat ( const StringRef str1,
const StringRef str2,
const StringRef str3 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ concat() [2/2]

static String ln::String::concat ( const StringRef str1,
const StringRef str2,
const StringRef str3,
const StringRef str4 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ contains() [1/2]

bool ln::String::contains ( const StringRef str,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

指定した文字列がこの文字列内に存在するかを判断します。

Parameters
[in]str: 検索文字列
[in]cs: 大文字と小文字の区別設定
Returns
文字列が存在すれば true。str が空文字列である場合は必ず true となります。

◆ contains() [2/2]

bool ln::String::contains ( Char  ch,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ endsWith() [1/2]

bool ln::String::endsWith ( const StringRef str,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

この文字列の末尾が、指定した文字列と一致するかを判断します。

Parameters
[in]str: 検索文字列

str が空文字の場合は必ず true が返ります。

str = "file.txt";
if (str.endsWith(".txt")) {
// 一致した
}

◆ endsWith() [2/2]

bool ln::String::endsWith ( Char  ch,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ format()

template<typename... TArgs>
String ln::String::format ( const Locale locale,
const StringRef format,
TArgs &&...  args 
)
inlinestatic

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fromNumber() [1/6]

static String ln::String::fromNumber ( int32_t  value,
Char  format = 'D' 
)
static

数値を文字列に変換します。

Parameters
[in]value: 数値
[in]format: 書式
[in]precision: 小数の精度 (小数部の桁数)
  • 'D' または 'd' : 10進数
  • 'X' または 'x' : 16進数
  • 'F' または 'f' : 小数
  • 'E' または 'e' : 小数 (指数表記)

◆ fromNumber() [2/6]

static String ln::String::fromNumber ( int64_t  value,
Char  format = 'D' 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fromNumber() [3/6]

static String ln::String::fromNumber ( uint32_t  value,
Char  format = 'D' 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fromNumber() [4/6]

static String ln::String::fromNumber ( uint64_t  value,
Char  format = 'D' 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fromNumber() [5/6]

static String ln::String::fromNumber ( float  value,
Char  format = 'F',
int  precision = 6 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ fromNumber() [6/6]

static String ln::String::fromNumber ( double  value,
Char  format = 'F',
int  precision = 6 
)
static

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ indexOf()

int ln::String::indexOf ( const StringRef str,
int  startIndex = 0,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

文字列を検索し、見つかった最初の文字のインデックスを返します。

Parameters
[in]str: 検索文字列
[in]startIndex: 検索を開始するインデックス (省略した場合は先頭から)
[in]cs: 大文字と小文字の区別設定
Returns
見つからなかった場合は -1。str が空文字列である場合は 0。

◆ insert()

String ln::String::insert ( int  startIndex,
const StringRef value 
) const

指定したインデックス位置に文字列を挿入します。

Parameters
[in]startIndex: インデックス位置
[in]value: 挿入する文字列
Returns
挿入結果の文字列

◆ lastIndexOf() [1/2]

int ln::String::lastIndexOf ( const StringRef str,
int  startIndex = -1,
int  count = -1,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

文字列を検索し、最後に見つかったインデックスを返します。

Parameters
[in]str: 検索文字列
[in]startIndex: 検索を開始するインデックス (-1 を指定すると、文字列の末尾から検索を開始する)
[in]count: 検索する文字数 (-1 を指定すると、文字列の先頭まで検索する)
[in]cs: 大文字と小文字の区別設定
Returns
見つかった文字列の開始インデックス。見つからなかった場合は -1。

startIndex の位置から文字列の先頭に向かう count 文字分の領域から str を検索します。

String str = "abcdef";
str.lastIndexOf("de"); // => 3
str.lastIndexOf("bc", 2); // => 1
str.lastIndexOf("cd", 2); // => -1 (検索範囲 "abc" の中に "cd" は存在しない)
str.lastIndexOf("cd", 4, 3); // => 2 (検索範囲 "cde" の中に "cd" は存在する)
str.lastIndexOf("bc", 4, 3); // => -1 (検索範囲 "cde" の中に "bc" は存在しない)

◆ lastIndexOf() [2/2]

int ln::String::lastIndexOf ( Char  ch,
int  startIndex = -1,
int  count = -1,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ left()

StringRef ln::String::left ( int  count) const

文字列の左側(先頭)から指定した文字数を抽出します。

Parameters
[in]count: 文字数
Returns
抽出された文字列
String s("abcdef");
s.left(2); // => "ab";

◆ remove() [1/2]

String ln::String::remove ( const StringRef str,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

この文字列から指定した文字をすべて取り除いた新しい文字列を返します。

Parameters
[in]str: 削除する文字列
[in]cs: 大文字と小文字の区別設定

◆ remove() [2/2]

String ln::String::remove ( Char  ch,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ replace()

String ln::String::replace ( const StringRef from,
const StringRef to,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

文字列の置換を行います。

Parameters
[in]from: 置換される文字列
[in]to: from を置換する文字列
Returns
置換結果の文字列

from に一致するすべての文字列を to に置換します。

◆ right()

StringRef ln::String::right ( int  count) const

文字列の右側(末尾)から指定した文字数を抽出します。

Parameters
[in]count: 文字数
Returns
抽出された文字列
String s("abcdef");
s.right(2); // => "ef";

◆ split()

List<String> ln::String::split ( const StringRef delim,
StringSplitOptions  option = StringSplitOptions::None 
) const

文字列をデリミタで分割します。

Parameters
[in]delim: デリミタ文字列
[in]option: 分割方法
Returns
分割結果の文字列配列

分割が発生しない場合は文字列全体を持つ要素数1の配列を返します。

auto tokens = String("a,b,c").split(","); // => ["a", "b", "c"]
auto tokens = String("a").split(","); // => ["a"]
auto tokens = String(",").split(","); // => ["", ""]
auto tokens = String("a::b").split("::"); // => ["a", "b"]

◆ startsWith() [1/2]

bool ln::String::startsWith ( const StringRef str,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

この文字列の先頭が、指定した文字列と一致するかを判断します。

Parameters
[in]str: 検索文字列

str が空文字の場合は必ず true が返ります。

◆ startsWith() [2/2]

bool ln::String::startsWith ( Char  ch,
CaseSensitivity  cs = CaseSensitivity::CaseSensitive 
) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ substr()

StringRef ln::String::substr ( int  start,
int  count = -1 
) const

文字列の部分文字列を抽出します。

Parameters
[in]start: 開始文字インデックス
[in]count: 文字数 (-1 の場合、末尾まで抽出する)
Returns
抽出された文字列
String s("abcdef");
s.substr(2, 3); // => "cde";

◆ toInt()

int ln::String::toInt ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toInt16()

int16_t ln::String::toInt16 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toInt32()

int32_t ln::String::toInt32 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toInt64()

int64_t ln::String::toInt64 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toUInt16()

uint16_t ln::String::toUInt16 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toUInt32()

uint32_t ln::String::toUInt32 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toUInt64()

uint64_t ln::String::toUInt64 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ toUInt8()

uint8_t ln::String::toUInt8 ( int  base = 0) const

この文字列を整数値に変換します。

Parameters
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
変換結果の数値

次の書式に従い、文字列を数値に変換します。

[whitespace] [{+ | – }] [0 [{ x | X }]] [digits | letters]

16 進数値のアルファベットは大文字と小文字を区別しません。

基数に 0 を指定すると、文字列の先頭文字から基数を自動判別します。 "0x" または "0X" であれば 16 進数、"0" であれば 8 進数、それ以外であれば 10 進数です。 基数に 8 または 16 が指定されている際、文字列の先頭は "0" または "0x" である必要はありません。

◆ tryToInt()

bool ln::String::tryToInt ( int *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToInt16()

bool ln::String::tryToInt16 ( int16_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToInt32()

bool ln::String::tryToInt32 ( int32_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToInt64()

bool ln::String::tryToInt64 ( int64_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToUInt16()

bool ln::String::tryToUInt16 ( uint16_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToUInt32()

bool ln::String::tryToUInt32 ( uint32_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToUInt64()

bool ln::String::tryToUInt64 ( uint64_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

◆ tryToUInt8()

bool ln::String::tryToUInt8 ( uint8_t *  outValue,
int  base = 0 
) const

この文字列を整数値に変換し、成否を返します。

Parameters
[in]outValue: 結果を格納する変数のポインタ (nullptr を指定すると成否のみを返す)
[in]base: 基数 (0、2、8、10、16 のいずれかであること)
Returns
正常に変換された場合は true。それ以外の場合は false。
See also
toInt

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