Namespace
Varianti

std::ctype

Da cppreference.com.
< cpp‎ | locale

 
 
Localizzazioni libreria
Impostazioni internazionali e sfaccettature
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
Carattere classificazione
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.
Conversioni
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 categoria classi di 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.
Facet categorie
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 specifici aspetti
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.
Codice di conversione sfaccettature
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.
 
std::ctype
Membri funzioni
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;
Classe ctype incapsula funzionalità di classificazione dei caratteri. Tutte le operazioni effettuate tramite flusso di input std::basic_istream<charT> utilizzare il std::ctype<charT> del locale intriso nel flusso per identificare i caratteri di spaziatura per tokenizzazione ingresso. Operazioni di output stream applicano std::ctype<charT>::widen() alle strette caratteri argomenti prima uscita.
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
Informazioni sull'immagine

Inheritance diagram

Due specializzazioni sono forniti dalla libreria standard
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>
fornisce gli equivalenti della classificazione locale "C". Questa specializzazione utilizza tabella di ricerca per la classificazione dei caratteri
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>
fornisce equivalenti caratteri estesi della classificazione locale "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.

Indice

[modifica] Membri tipi

Membro tipo
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

[modifica] Membri funzioni

costruisce un nuovo aspetto 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.

(membro pubblico funzione)
distrugge un aspetto 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.

(protetto funzione membro)
Invoca 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.

(membro pubblico funzione) [edit]
Invoca 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.

(membro pubblico funzione) [edit]
Invoca 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.

(membro pubblico funzione) [edit]
Invoca 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.

(membro pubblico funzione) [edit]
Invoca 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.

(membro pubblico funzione) [edit]
Invoca 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.

(membro pubblico funzione) [edit]
Invoca 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.

(membro pubblico funzione) [edit]

[modifica] Protetto funzioni membro

[virtuale]
classifica un carattere o una sequenza di caratteri
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.

(virtuale protetto funzione membro) [edit]
[virtuale]
individua il primo carattere in una sequenza che è conforme alla classificazione fornita
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.

(virtuale protetto funzione membro) [edit]
[virtuale]
individua il primo carattere in una sequenza che non riesce classificazione 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.

(virtuale protetto funzione membro) [edit]
[virtuale]
converte uno o più caratteri in maiuscolo
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.

(virtuale protetto funzione membro) [edit]
[virtuale]
converte uno o più caratteri in minuscolo
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.

(virtuale protetto funzione membro) [edit]
[virtuale]
converte uno o più caratteri da char a 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.

(virtuale protetto funzione membro) [edit]
[virtuale]
converte uno o più caratteri da charT a 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.

(virtuale protetto funzione membro) [edit]

[modifica] Membri oggetti

static std::locale::id id
' Id del locale
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.

(membro oggetto pubblico)

Inherited from std::ctype_base

Member types

Tipo
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
maschera di bit di tipo non specificato (enumerazione, tipo intero, o 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
[statico]
il valore di mask carattere classificazione Identificare gli spazi
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.

(pubblico membro statico costante)
print
[statico]
il valore di mask identificare classificazione stampabile carattere
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.

(pubblico membro statico costante)
cntrl
[statico]
il valore di classificazione di controllo mask identificazione carattere
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.

(pubblico membro statico costante)
upper
[statico]
il valore di mask identificare classificazione carattere maiuscolo
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.

(pubblico membro statico costante)
lower
[statico]
il valore di mask identificare classificazione carattere minuscolo
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.

(pubblico membro statico costante)
alpha
[statico]
il valore di mask identificare classificazione carattere alfabetico
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.

(pubblico membro statico costante)
digit
[statico]
il valore di mask identificare classificazione cifra
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.

(pubblico membro statico costante)
punct
[statico]
il valore di classificazione punteggiatura mask identificazione carattere
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.

(pubblico membro statico costante)
xdigit
[statico]
il valore di mask identificazione esadecimale classificazione cifra
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.

(pubblico membro statico costante)
blank
[statico] (C++11)
il valore di mask identificare classificazione bianco carattere
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.

(pubblico membro statico costante)
alnum
[statico]
alpha | digit
(pubblico membro statico costante)
graph
[statico]
alnum | punct
(pubblico membro statico costante)

[modifica] Esempio

L'esempio seguente mostra la modifica di un ctype diverso <char> CType per tokenize di un file CSV
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

[modifica] Vedi anche

specializzazione di std::ctype per char tipo
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.

(classe modello di specializzazione)
definisce le categorie di classificazione dei caratteri
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 template)
crea un aspetto ctype per le impostazioni internazionali di nome
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 template)