Espaces de noms
Variantes
Affichages
Actions

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>

De cppreference.com
< cpp‎ | locale

 
 
Bibliothèque localisations
Locales et facettes
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
Classification des caractères
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.
Classes de facettes catégorie de base
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.
Catégories de facettes
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.
Spécifique aux paramètres régionaux facettes
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.
Facettes de conversion de code
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>;
Cette spécialisation des fonctions de classification std::ctype encapsule caractères pour char type. Contrairement à usage général std::ctype, table de consultation est utilisée pour classer les caractères. Le std::ctype<char> classe de base implémente la classification des caractères équivalente à la localisation "C". Les règles de classification peut être étendue ou modifiée s'il est construit comme std::ctype_byname<char> ou comme défini par l'utilisateur facette dérivée. Toutes les fonctions d'entrée std::istream formatés sont tenus d'utiliser std::ctype<char> pour classing caractère lors de l'analyse d'entrée .
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
À propos de cette image

Inheritance diagram

Sommaire

[modifier] Types de membres

Type du membre Définition
char_type char

[modifier] Fonctions membres

construit un nouveau 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.

(fonction membre publique) [edit]
Détruit une facette 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.

(fonction membre protégée) [edit]
obtient la table de classification des caractères
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.

(fonction membre publique) [edit]
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
obtient le "C" tableau de classification locale caractère
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.

(fonction membre publique statique) [edit]
classer un caractère ou une séquence de caractères, en utilisant la table de classification
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.

(fonction membre publique) [edit]
localise le premier caractère dans une séquence qui se conforme à la classification donnée, en utilisant le tableau de classification
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.

(fonction membre publique) [edit]
localise le premier caractère dans une séquence qui échoue classification donnée, en utilisant le tableau de classement
Original:
locates the first character in a sequence that fails 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.

(fonction membre publique) [edit]
Invoque 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.

(fonction membre publique de std::ctype) [edit]
Invoque 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.

(fonction membre publique de std::ctype) [edit]
Invoque 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.

(fonction membre publique de std::ctype) [edit]
Invoque 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.

(fonction membre publique de std::ctype) [edit]

[modifier] Protégé fonctions membres

[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
convertit un ou plusieurs caractères en majuscules
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.

(fonction membre virtuelle protégée de std::ctype) [edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
convertit un ou plusieurs caractères en minuscules
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.

(fonction membre virtuelle protégée de std::ctype) [edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
convertit un ou plusieurs caractères de 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.

(fonction membre virtuelle protégée de std::ctype) [edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
convertit un ou plusieurs caractères de 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.

(fonction membre virtuelle protégée de std::ctype) [edit]

[modifier] Objets membres

static std::locale::id id
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
Id de la localisation
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.

(constante membre statique publique)
static const std::size_t table_size
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
taille de la table de classification, 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.

(constante membre statique publique)

Inherited from std::ctype_base

Member types

Type d'
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
Type de masque non spécifié (énumération, de type entier, ou 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
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identifiant classification des caractères blancs
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.

(constante membre statique publique)
print
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identifier la classification des caractères imprimables
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.

(constante membre statique publique)
cntrl
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de la commande mask classification des caractères d'identification
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.

(constante membre statique publique)
upper
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identifier classification des caractères en majuscules
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.

(constante membre statique publique)
lower
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identifier la classification des caractères minuscules
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.

(constante membre statique publique)
alpha
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identifier la classification des caractères alphabétiques
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.

(constante membre statique publique)
digit
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identifier la classification des caractères chiffres
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.

(constante membre statique publique)
punct
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de la ponctuation mask classification des caractères d'identification
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.

(constante membre statique publique)
xdigit
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
la valeur de mask identification hexadécimale de classification chiffre
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.

(constante membre statique publique)
blank
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
(C++11)
la valeur de mask identifier la classification des caractères vide
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.

(constante membre statique publique)
alnum
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
alpha | digit
(constante membre statique publique)
graph
[
statique
Original:
static
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
alnum | punct
(constante membre statique publique)

[modifier] Exemple

L'exemple suivant illustre la modification de <char> ctype à tokenize d'un fichier CSV
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';
}

Résultat :

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

[modifier] Voir aussi

définit les tables de classification de caractères
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.

(classe générique)
définit les catégories de classification des caractères
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.

(classe générique)
crée une facette ctype pour l'environnement local nommé
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.

(classe générique)