名前空間
変種
操作

std::ctype

提供: cppreference.com
< cpp‎ | locale

 
 
ローカライゼーションライブラリ
ロケールおよびファセット
Original:
Locales and facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
locale
文字分類
Original:
Character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
変換
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリの基底クラスです
Original:
Facet category base classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ファセットカテゴリ
Original:
Facet categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ロケール固有のファセット
Original:
Locale-specific facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
コー​​ド変換ファセット
Original:
Code conversion facets
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
codecvt_utf8(C++11)
codecvt_utf16(C++11)
Cロケール
Original:
C locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
std::ctype
メンバ関数
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ctype::ctype
ctype::~ctype
ctype::is
ctype::do_is
ctype::scan_id
ctype::do_scan_id
ctype::scan_not
ctype::do_scan_not
ctype::toupper
ctype::do_toupper
ctype::tolower
ctype::do_tolower
ctype::widen
ctype::do_widen
ctype::narrow
ctype::do_narrow
 
Defined in header <locale>
template< class CharT >
class ctype;
クラスctype関数は、文字の分類機能をカプセル化します。 std::basic_istream<charT>を通じて実行されたすべてのストリーム入力操作では、入力トークン化のために空白文字を識別するために、ストリームで吹き込まれたロケールのstd::ctype<charT>を使用しています。ストリーム出力操作は、出力する前に、ナロー文字の引数に適用std::ctype<charT>::widen().
Original:
Class ctype encapsulates character classification features. All stream input operations performed through std::basic_istream<charT> use the std::ctype<charT> of the locale imbued in the stream to identify whitespace characters for input tokenization. Stream output operations apply std::ctype<charT>::widen() to narrow-character arguments prior to output.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cpp/locale/ctype basecpp/locale/locale/facetstd-ctype-inheritance.svg
画像の詳細

Inheritance diagram

2つの専門分野は、標準ライブラリで提供されています
Original:
Two specializations are provided by the standard library
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <locale>
std::ctype<char>
"C"ロケール分類の同等物を提供しています。この特殊文字分類についてのテーブルルックアップを使用しています
Original:
provides equivalents of the "C" locale classification. This specialization uses table lookup for character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::ctype<wchar_t>
"C"ロケール分類のワイド文字同等物を提供しています
Original:
provides wide character equivalents of the "C" locale classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集] メンバータイプ

メンバー·タイプ
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
char_type CharT

[編集] メンバ関数

新しいのctypeファセットを構築します
Original:
constructs a new ctype facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)
のctypeファセットを破棄します
Original:
destructs a ctype facet
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(protectedメンバー関数)
do_isを呼び出します
Original:
invokes do_is
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
do_scan_isを呼び出します
Original:
invokes do_scan_is
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
do_scan_notを呼び出します
Original:
invokes do_scan_not
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
do_toupperを呼び出します
Original:
invokes do_toupper
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
do_tolowerを呼び出します
Original:
invokes do_tolower
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
do_widenを呼び出します
Original:
invokes do_widen
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
do_narrowを呼び出します
Original:
invokes do_narrow
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]

[編集] メンバ関数を保護しました

[仮想]
文字または文字シーケンスを分類しています
Original:
classifies a character or a character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]
[仮想]
位置指定された分類に準拠して、シーケンス内の最初の文字
Original:
locates the first character in a sequence that conforms to given classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]
[仮想]
見つけgivne分類に失敗したシーケンスの最初の文字
Original:
locates the first character in a sequence that fails givne classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]
[仮想]
文字または文字列を大文字に変換します
Original:
converts a character or characters to uppercase
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]
[仮想]
小文字に文字または文字列に変換します
Original:
converts a character or characters to lowercase
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]
[仮想]
charからcharTへの文字または文字列に変換します
Original:
converts a character or characters from char to charT
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]
[仮想]
charTからcharへの文字または文字列に変換します
Original:
converts a character or characters from charT to char
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想protectedメンバ関数) [edit]

[編集] メンバーオブジェクト

static std::locale::id id
idはロケールの
Original:
id of the locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバオブジェクト)

Inherited from std::ctype_base

Member types

タイプ
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
mask
不特定のビットマスク型(列挙型、整数型、またはbitsetの)
Original:
unspecified bitmask type (enumeration, integer type, or bitset)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Member constants

space
[静的]
mask識別空白文字分類の値
Original:
the value of mask identifying whitespace character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
print
[静的]
mask印刷可能な文字の分類を識別するための値
Original:
the value of mask identifying printable character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
cntrl
[静的]
mask識別制御文字分類の値
Original:
the value of mask identifying control character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
upper
[静的]
maskの値は、大文字の文字の分類を識別する
Original:
the value of mask identifying uppercase character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
lower
[静的]
mask小文字文字の分類を識別するための値
Original:
the value of mask identifying lowercase character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
alpha
[静的]
maskアルファベット文字の分類を識別するための値
Original:
the value of mask identifying alphabetic character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
digit
[静的]
mask桁文字の分類を識別するための値
Original:
the value of mask identifying digit character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
punct
[静的]
mask識別句読点文字分類の値
Original:
the value of mask identifying punctuation character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
xdigit
[静的]
mask進数文字の分類を識別するための値
Original:
the value of mask identifying hexadecimal digit character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
blank
[静的] (C++11)
mask空白文字の分類を識別するための値
Original:
the value of mask identifying blank character classification
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリック静的メンバ定数)
alnum
[静的]
alpha | digit
(パブリック静的メンバ定数)
graph
[静的]
alnum | punct
(パブリック静的メンバ定数)

[編集]

次の例では、CSVファイルのトークン化するためのctype <char>を以外のctypeの変更を示しています
Original:
The following example demonstrates modification of a ctype other than ctype<char> to tokenize of a CSV file
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

#include <iostream>
#include <locale>
#include <sstream>
 
struct csv_whitespace : std::ctype<wchar_t> {
    bool do_is(mask m, char_type c) const
    {   
        if ((m & space) && c == L' ') {
            return false; // space will NOT be classified as whitespace
        }
        if ((m & space) && c == L',') {
            return true; // comma will be classified as whitespace
        }
        return ctype::do_is(m, c); // leave the rest to the parent class
    } 
};
 
int main()
{
    std::wstring in = L"Column 1,Column 2,Column 3\n123,456,789";
    std::wstring token;
 
    std::wcout << "default locale:\n";
    std::wistringstream s1(in);
    while (s1 >> token) {
        std::wcout << "  " << token << '\n';
    }
 
    std::wcout << "locale with modified ctype:\n";
    std::wistringstream s2(in);
    s2.imbue(std::locale(s2.getloc(), new csv_whitespace()));
    while (s2 >> token) {
        std::wcout << "  " << token<< '\n';
    }
}

Output:

default locale:
  Column
  1,Column
  2,Column
  3
  123,456,789
locale with modified ctype:
  Column 1
  Column 2
  Column 3
  123
  456
  789

[編集] も参照してください

タイプstd::ctypecharの専門化
Original:
specialization of std::ctype for type char
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレートの特殊化の2つの値を比較します)
文字分類カテゴリを定義します
Original:
defines character classification categories
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート)
名前のロケール用のctypeファセットを作成します
Original:
creates a ctype facet for the named locale
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート)