Namensräume
Varianten
Aktionen

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>

Aus cppreference.com
< cpp‎ | locale

 
 
Lokalisierungen Bibliothek
Locales und Facetten
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
Buchstaben-Klassifikation
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.
Conversions
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Facet Kategorie Basisklassen
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.
Facet Kategorien
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.
Locale-spezifische Facetten
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.
Code-Konvertierung Facetten
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 locale
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>;
Diese Spezialisierung std::ctype kapselt Charakter Klassifikationsmerkmale für Typ char. Anders als Allzweck-std::ctype wird Lookup-Tabelle verwendet, um Zeichen zu klassifizieren. Die Basisklasse std::ctype<char> implementiert Charakter Klassifizierung entspricht der "C"-Locale. Die Klassifizierungsregeln können erweitert oder modifiziert werden, wenn sie als std::ctype_byname<char> oder als benutzerdefinierte abgeleitete Facette gebaut. Alle std::istream formatierte Eingabe-Funktionen erforderlich sind, um std::ctype<char> für Zeichen Klassierung verwenden während der Eingabe Parsen .
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
Über dieses Bild

Inheritance diagram

Inhaltsverzeichnis

[Bearbeiten] Mitglied Typen

Mitglied Typ
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

[Bearbeiten] Member-Funktionen

baut eine neue std::ctype<char> Facette
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.

(öffentliche Elementfunktion) [edit]
zerstört sich eine std::ctype<char> Facette
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.

(geschützt Member-Funktion) [edit]
erhält den Charakter Klassifizierung Tisch
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.

(öffentliche Elementfunktion) [edit]
[statisch]
erhält die "C"-Locale Charakter Klassifizierung Tisch
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.

(public static Elementfunktion) [edit]
stuft ein Zeichen oder eine Zeichenfolge, mit der Klassifizierung Tisch
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.

(öffentliche Elementfunktion) [edit]
findet das erste Zeichen in einer Sequenz, die zu bestimmten Klassifizierung entspricht, unter Verwendung der Klassifikation Tisch
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.

(öffentliche Elementfunktion) [edit]
locates the first character in a sequence that fails given classification, using the classification table
(öffentliche Elementfunktion) [edit]
Beruft 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.

(öffentliche Elementfunktion of std::ctype) [edit]
Beruft 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.

(öffentliche Elementfunktion of std::ctype) [edit]
Beruft 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.

(öffentliche Elementfunktion of std::ctype) [edit]
Beruft 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.

(öffentliche Elementfunktion of std::ctype) [edit]

[Bearbeiten] Geschützt Member-Funktionen

[virtuell]
wandelt ein oder mehrere Zeichen in Großbuchstaben
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.

(virtuellen geschützten Member-Funktion of std::ctype) [edit]
[virtuell]
wandelt ein oder mehrere Zeichen in Kleinbuchstaben
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.

(virtuellen geschützten Member-Funktion of std::ctype) [edit]
[virtuell]
wandelt ein Zeichen oder Zeichen aus char um 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.

(virtuellen geschützten Member-Funktion of std::ctype) [edit]
[virtuell]
wandelt ein Zeichen oder Zeichen aus charT um 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.

(virtuellen geschützten Member-Funktion of std::ctype) [edit]

[Bearbeiten] Mitglied widerspricht

static std::locale::id id
[statisch]
ID des Gebietsschemas
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.

(public static Mitglied konstanten)
static const std::size_t table_size
[statisch]
Größe der Klassifizierung Tisch, an 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.

(public static Mitglied konstanten)

Inherited from std::ctype_base

Member types

Type
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
unbestimmte Bitmaske Typ (Aufzählung, Integer-Typ oder 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
[statisch]
der Wert mask Identifizieren Leerzeichen Klassifizierung
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.

(public static Mitglied konstanten)
print
[statisch]
der Wert mask identifizieren druckbare Zeichen Klassifizierung
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.

(public static Mitglied konstanten)
cntrl
[statisch]
der Wert mask identifizieren Steuerzeichen Klassifizierung
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.

(public static Mitglied konstanten)
upper
[statisch]
der Wert mask identifizieren Großbuchstaben Klassifizierung
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.

(public static Mitglied konstanten)
lower
[statisch]
der Wert mask identifizieren Kleinbuchstaben Klassifizierung
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.

(public static Mitglied konstanten)
alpha
[statisch]
der Wert mask identifizieren Buchstaben Klassifizierung
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.

(public static Mitglied konstanten)
digit
[statisch]
der Wert mask identifizieren Ziffernzeichen Klassifizierung
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.

(public static Mitglied konstanten)
punct
[statisch]
der Wert mask identifizieren Satzzeichen Klassifizierung
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.

(public static Mitglied konstanten)
xdigit
[statisch]
der Wert mask identifizieren Hexadezimalziffer Charakter Klassifizierung
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.

(public static Mitglied konstanten)
blank
[statisch] (C++11)
der Wert mask identifizieren Leerzeichen Klassifizierung
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.

(public static Mitglied konstanten)
alnum
[statisch]
alpha | digit
(public static Mitglied konstanten)
graph
[statisch]
alnum | punct
(public static Mitglied konstanten)

[Bearbeiten] Beispiel

Das folgende Beispiel demonstriert Änderung ctype <char> zu einer CSV-Datei tokenize
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

[Bearbeiten] Siehe auch

definiert Charakter Klassifizierung Tabellen
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.

(Klassen-Template)
definiert Charakter Klassifizierungskategorien
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.

(Klassen-Template)
schafft eine ctype Facette für die benannte locale
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.

(Klassen-Template)