名前空間
変種
操作

std::ctype<div class="t-tr-text"><char>を<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig"><char></div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>

提供: 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.
 
Defined in header <locale>
template<>
class ctype<char>;
std::ctypeのこの専門分野は、型charの文字分類機能をカプセル化します。汎用std::ctypeとは異なり、テーブル·ルックアップは文字を分類するために使用されます。基底クラスstd::ctype<char>は "C"ロケールに相当する文字の分類を実装しています。 std::ctype_byname<char>として、またはユーザー定義の派生ファセットとして構築した場合の分類ルールを拡張または変更することができます。すべてstd::istream形式の入力機能は入力の解析中に文字クラス処理std::ctype<char>を使用する必要があります.
Original:
This specialization of std::ctype encapsulates character classification features for type char. Unlike general-purpose std::ctype, table lookup is used to classify characters. The base class std::ctype<char> implements character classification equivalent to the "C" locale. The classification rules can be extended or modified if constructed as std::ctype_byname<char> or as a user-defined derived facet. All std::istream formatted input functions are required to use std::ctype<char> for character classing during input parsing.
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 char-inheritance.svg
画像の詳細

Inheritance diagram

目次

[編集] メンバータイプ

メンバー·タイプ
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 char

[編集] メンバ関数

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

(パブリックメンバ関数) [edit]
std::ctype<char>ファセットを破棄します
Original:
destructs a std::ctype<char> facet
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:
obtains the character classification table
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
"C"ロケールの文字分類テーブルを取得します
Original:
obtains the "C" locale character classification table
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, using the classification table
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
見つけ分類表を使って、指定された分類に準拠して、シーケンス内の最初の文字
Original:
locates the first character in a sequence that conforms to given classification, using the classification table
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数) [edit]
locates the first character in a sequence that fails given classification, using the classification table
(パブリックメンバ関数) [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.

(パブリックメンバ関数of std::ctype) [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.

(パブリックメンバ関数of std::ctype) [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.

(パブリックメンバ関数of std::ctype) [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.

(パブリックメンバ関数of std::ctype) [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メンバ関数of std::ctype) [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メンバ関数of std::ctype) [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メンバ関数of std::ctype) [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メンバ関数of std::ctype) [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.

(パブリック静的メンバ定数)
static const std::size_t table_size
[静的]
分類表のサイズ、leaestで256
Original:
size of the classification table, at leaest 256
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>での変更を示しています
Original:
The following example demonstrates modification of 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 <vector>
#include <locale>
#include <sstream>
 
// This ctype facet classifies commas and endlines as whitespace
struct csv_whitespace : std::ctype<char> {
    static const mask* make_table()
    {
        // make a copy of the "C" locale table
        static std::vector<mask> v(classic_table(), classic_table() + table_size);
        v[','] |=  space;  // comma will be classified as whitespace
        v[' '] &= ~space;      // space will not be classified as whitespace
        return &v[0];
    }
    csv_whitespace(std::size_t refs = 0) : ctype(make_table(), false, refs) {}
};
 
int main()
{
    std::string in = "Column 1,Column 2,Column 3\n123,456,789";
    std::string token;
 
    std::cout << "default locale:\n";
    std::istringstream s1(in);
    while(s1 >> token)
            std::cout << "  " << token << '\n';
 
    std::cout << "locale with modified ctype:\n";
    std::istringstream s2(in);
    s2.imbue(std::locale(s2.getloc(), new csv_whitespace()));
    while(s2 >> token)
            std::cout << "  " << 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

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

文字の分類表を定義します
Original:
defines character classification tables
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(クラステンプレート)
文字分類カテゴリを定義します
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.

(クラステンプレート)