std:: iswctype
From cppreference.net
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Null-terminated wide strings
| Functions | ||||||||||||||||||||||||||
| Character classification | ||||||||||||||||||||||||||
| Character manipulation | ||||||||||||||||||||||||||
| Conversions to numeric formats | ||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||
| String manipulation | ||||||||||||||||||||||||||
| String examination | ||||||||||||||||||||||||||
| Array manipulation | ||||||||||||||||||||||||||
|
ヘッダーで定義
<cwctype>
|
||
|
int
iswctype
(
std::
wint_t
wc,
std::
wctype_t
desc
)
;
|
||
ワイド文字 wc を、現在のCロケールの LC_CTYPE カテゴリ( desc で識別される)を使用して分類します。
wc の値が wchar_t として表現可能でなく、かつマクロ WEOF の値とも等しくない場合、動作は未定義です。
目次 |
パラメータ
| wc | - | 分類対象のワイド文字 |
| desc | - | LC_CTYPE カテゴリ。 std::wctype の呼び出しから取得 |
戻り値
文字 wc が現在のCロケールの LC_CTYPE ファセットにおいて desc で識別されるプロパティを持つ場合、非ゼロを返します。それ以外の場合、ゼロを返します。
例
このコードを実行
#include <clocale> #include <cwctype> #include <iostream> bool classify(wchar_t wc, const std::string& cat) { return std::iswctype(wc, std::wctype(cat.c_str())); } int main() { std::setlocale(LC_ALL, "ja_JP.UTF-8"); std::cout << "The character \u6c34 is...\n"; for (std::string s : {"digit", "alpha", "space", "cntrl", "jkanji"}) std::cout << s << "? " << std::boolalpha << classify(L'\u6c34', s) << '\n'; }
出力:
The character 水 is... digit? false alpha? true space? false cntrl? false jkanji? true
関連項目
|
現在のCロケールで文字分類カテゴリを検索する
(関数) |
|
|
Cドキュメント
for
iswctype
|
|