英語版
このページの英語版を見る
rt.aApply
このコードは、foreachループのUTF文字列のデコードを処理する。
License:
Authors:
Walter Bright
ソース rt/aApply.d
- alias
dg_t= int delegate(void* c); - 変換されたループ本体に対応するデリゲート型パラメータは、現在のchar 、wchar またはdcharReturns:break 。
- int
_aApplycd1(scope const(char)[]aa, dg_tdg);
int_aApplywd1(scope const(wchar)[]aa, dg_tdg);
int_aApplycw1(scope const(char)[]aa, dg_tdg);
int_aApplywc1(scope const(wchar)[]aa, dg_tdg);
int_aApplydc1(scope const(dchar)[]aa, dg_tdg);
int_aApplydw1(scope const(dchar)[]aa, dg_tdg); - UTFエンコーディングを変更しながら文字列をループするchar 、wchar 、dchar の間に6つの変換の組み合わせがある、 そして、それぞれ2つずつある。 命名規則は以下の通りである: aApply{c,d,w}{c,d,w}{1,2} 最初の文字は入力文字列エンコーディングに対応し、2番目の文字はターゲット文字型に対応する。
- c =char
- w =wchar
- d =dchar
Examples:void main() { string str; wtring wstr; dstring dstr; foreach (dchar c; str) {} // _aApplycd1 foreach (wchar c; dstr) {} // _aApplydw1 foreach (i, wchar c; str) {} // _aApplycw2 foreach (wchar w; wstr) {} // 無変換 }
Parameters:const(char)[] aa入力文字列 dg_t dgforeach本体は、以下のようなデリゲートに変換される。opApply Returns:ループがbreak - alias
dg2_t= int delegate(void* i, void* c); - 変換されたループ本体に対応するDelegate型を通してループを抜けたとき、0でない。パラメータは、size_t ループインデックスへのポインタと、現在のchar 、wchar またはdchar 。Returns:break 、ゼロでない。
- int
_aApplycd2(scope const(char)[]aa, dg2_tdg);
int_aApplywd2(scope const(wchar)[]aa, dg2_tdg);
int_aApplycw2(scope const(char)[]aa, dg2_tdg);
int_aApplywc2(scope const(wchar)[]aa, dg2_tdg);
int_aApplydc2(scope const(dchar)[]aa, dg2_tdg);
int_aApplydw2(scope const(dchar)[]aa, dg2_tdg); - ループ・インデックスを含むaApplyXXXのバリエーション。
Copyright © 1999-2025 by the D Language Foundation
DEEPL APIにより翻訳、ところどころ修正。
このページの最新版(英語)
このページの原文(英語)
翻訳時のdmdのバージョン: 2.108.0
サイト全体のドキュメントのdmdのバージョン: 2.109.1
最新のdmdのバージョン: 2.111.0 ダウンロード
翻訳日付:
HTML生成日時:
編集者: dokutoku