tools
読み取り中…
検索中…
一致する文字列を見つけられません
st 名前空間

文字列ユーティリティ用名前空間 [詳解]

型定義

typedef std::unordered_map< std::string, std::vector< std::string > > splits
 split() の複数デリミタ対応版の戻り値型: デリミタ → 部分文字列リスト
typedef std::unordered_map< std::string, std::vector< int > > splitsi
 spliti() の複数デリミタ対応版の戻り値型: デリミタ → 整数リスト

関数

void replace_r (std::string &str, const std::string from, const std::string to)
 文字列中のすべての from を to に置換する(参照渡し、インプレース版)
std::string replace (std::string str, const std::string from, const std::string to)
 文字列中のすべての from を to に置換した新しい文字列を返す(値返し版)
std::vector< std::string > find (const std::string &input, std::string start, std::string end)
 文字列中から start〜end に囲まれた部分文字列をすべて取り出す
int toi (const std::string &str)
 文字列中の数字のみを抽出して整数に変換する
std::vector< int > toi (const std::vector< std::string > &input)
 文字列ベクタの各要素を toi で整数に変換する
std::vector< std::string > split (const std::string &str, const std::string &delimiter)
 文字列を単一のデリミタで分割する(文字列ベクタを返す)
std::vector< int > spliti (const std::string &str, const std::string &delimiter)
 文字列を単一のデリミタで分割し、各要素を整数に変換する
splits split (const std::string &input, const std::vector< std::string > &targets)
 文字列を複数のデリミタで分割し、どのデリミタで区切られたかを記録する
splitsi spliti (const std::string &input, const std::vector< std::string > &targets)
 複数デリミタ版 split の結果を整数に変換する
std::vector< std::string > charV (const int i_argc, const char *const i_argv[])
 char 配列 (argc/argv 形式) を文字列ベクタに変換する
std::vector< int > charVi (const int i_argc, const char *i_argv[])
 char 配列 (argc/argv 形式) を整数ベクタに変換する
size_t size (const std::string &input)
 UTF-8 文字列のマルチバイト文字数(文字単位の長さ)を返す

詳解

文字列ユーティリティ用名前空間

型定義詳解

◆ splits

typedef std::unordered_map<std::string,std::vector<std::string> > st::splits

split() の複数デリミタ対応版の戻り値型: デリミタ → 部分文字列リスト

string.h163 行目に定義があります。

◆ splitsi

typedef std::unordered_map<std::string,std::vector<int> > st::splitsi

spliti() の複数デリミタ対応版の戻り値型: デリミタ → 整数リスト

string.h165 行目に定義があります。

関数詳解

◆ charV()

std::vector< std::string > st::charV ( const int i_argc,
const char *const i_argv[] )
inline

char 配列 (argc/argv 形式) を文字列ベクタに変換する

引数
i_argc引数の数
i_argv引数文字列の配列
戻り値
文字列ベクタ

string.h230 行目に定義があります。

被呼び出し関係図:

◆ charVi()

std::vector< int > st::charVi ( const int i_argc,
const char * i_argv[] )
inline

char 配列 (argc/argv 形式) を整数ベクタに変換する

引数
i_argc引数の数
i_argv引数文字列の配列
戻り値
数字を抽出した整数ベクタ

string.h244 行目に定義があります。

呼び出し関係図:

◆ find()

std::vector< std::string > st::find ( const std::string & input,
std::string start,
std::string end )
inline

文字列中から start〜end に囲まれた部分文字列をすべて取り出す

引数
input検索対象の文字列
start開始デリミタ
end終了デリミタ
戻り値
開始デリミタと終了デリミタの間の部分文字列のベクタ

string.h88 行目に定義があります。

◆ replace()

std::string st::replace ( std::string str,
const std::string from,
const std::string to )
inline

文字列中のすべての from を to に置換した新しい文字列を返す(値返し版)

引数
str置換元の文字列(変更されない)
from置換前の文字列
to置換後の文字列
戻り値
置換後の文字列

string.h76 行目に定義があります。

呼び出し関係図:
被呼び出し関係図:

◆ replace_r()

void st::replace_r ( std::string & str,
const std::string from,
const std::string to )
inline

文字列中のすべての from を to に置換する(参照渡し、インプレース版)

引数
str置換対象の文字列(この文字列が変更される)
from置換前の文字列
to置換後の文字列
覚え書き
from が空文字列の場合は何もしません

string.h60 行目に定義があります。

被呼び出し関係図:

◆ size()

size_t st::size ( const std::string & input)
inline

UTF-8 文字列のマルチバイト文字数(文字単位の長さ)を返す

引数
inputUTF-8 エンコードされた文字列
戻り値
文字列の文字数(バイト数ではなく文字数)
覚え書き
ASCII (1バイト), 2バイト文字, 3バイト文字(日本語など), 4バイト文字に対応

string.h254 行目に定義があります。

◆ split() [1/2]

splits st::split ( const std::string & input,
const std::vector< std::string > & targets )
inline

文字列を複数のデリミタで分割し、どのデリミタで区切られたかを記録する

引数
input分割する文字列
targets検索するデリミタ文字列のベクタ
戻り値
デリミタをキー、そのデリミタで終わる部分文字列リストを値とするマップ

string.h173 行目に定義があります。

◆ split() [2/2]

std::vector< std::string > st::split ( const std::string & str,
const std::string & delimiter )
inline

文字列を単一のデリミタで分割する(文字列ベクタを返す)

引数
str分割する文字列
delimiterデリミタ文字列
戻り値
分割結果の文字列ベクタ

string.h135 行目に定義があります。

被呼び出し関係図:

◆ spliti() [1/2]

splitsi st::spliti ( const std::string & input,
const std::vector< std::string > & targets )
inline

複数デリミタ版 split の結果を整数に変換する

引数
input分割する文字列
targets検索するデリミタ文字列のベクタ
戻り値
デリミタをキー、整数リストを値とするマップ

string.h213 行目に定義があります。

呼び出し関係図:

◆ spliti() [2/2]

std::vector< int > st::spliti ( const std::string & str,
const std::string & delimiter )
inline

文字列を単一のデリミタで分割し、各要素を整数に変換する

引数
str分割する文字列
delimiterデリミタ文字列
戻り値
分割・変換後の整数ベクタ

string.h153 行目に定義があります。

呼び出し関係図:

◆ toi() [1/2]

int st::toi ( const std::string & str)
inline

文字列中の数字のみを抽出して整数に変換する

引数
str変換元の文字列
戻り値
数字部分のみを連結して変換した整数値。数字がない場合は 0

string.h108 行目に定義があります。

被呼び出し関係図:

◆ toi() [2/2]

std::vector< int > st::toi ( const std::vector< std::string > & input)
inline

文字列ベクタの各要素を toi で整数に変換する

引数
input変換元の文字列ベクタ
戻り値
変換後の整数ベクタ

string.h121 行目に定義があります。

呼び出し関係図: