Namensräume
Varianten
Aktionen

std::regex_traits::isctype

Aus cppreference.com
< cpp‎ | regex‎ | regex traits

 
 
Reguläre Ausdrücke Bibliothek
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_regex(C++11)
sub_match(C++11)
match_results(C++11)
Algorithmen
Original:
Algorithms
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_match(C++11)
regex_search(C++11)
regex_replace(C++11)
Iteratoren
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_iterator(C++11)
regex_token_iterator(C++11)
Ausnahmen
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_error(C++11)
Traits
Original:
Traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_traits(C++11)
Konstanten
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
syntax_option_type(C++11)
match_flag_type(C++11)
error_type(C++11)
 
 
bool isctype( CharT c, char_class_type f ) const;
Bestimmt, ob der Charakter der c Zeichenklasse durch f, welches wiederum ein durch lookup_classname() zurückgegeben identifiziert gehört .
Original:
Determines whether the character c belongs to the character class identified by f, which, in turn, is a value returned by lookup_classname().
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Die Version dieser Funktion in den Standard-Bibliothek Spezialisierungen std::regex_traits vorgesehen, wandelt zunächst f bis zu einem gewissen temporären Wert m vom Typ std::ctype_base::mask in der Implementierung definiert, dann versucht, die Zeichen in der durchdrungen locale klassifizieren indem std::use_facet<std::ctype<CharT>>(getloc()).is(m, c). Wenn das zurückgegebene true wird true durch isctype() zurückgegeben. Andernfalls wird geprüft, ob c gleich '_' und die Bitmaske f entspricht der Zeichenklasse [:w:], in welchem ​​Fall true zurückgegeben. Andernfalls wird false zurückgegeben .
Original:
The version of this function provided in the standard library specializations of std::regex_traits, first converts f to some temporary value m of type std::ctype_base::mask in implementation-defined manner, then attempts to classify the character in the imbued locale by calling std::use_facet<std::ctype<CharT>>(getloc()).is(m, c). If that returned true, true is returned by isctype(). Otherwise, checks whether c equals '_' and the bitmask f corresponds to the character class [:w:], in which case true is returned. Otherwise, false is returned.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Hinweis: Die veröffentlichten Standard ist falsch, formuliert erfordern diese Funktion, um zurückzukehren zum '_' in allen Fällen wahr. Dies ist LWG issue 2018 .
Original:
Note: the published standard is phrased incorrectly, requiring this function to return true for '_' in all cases. This is LWG issue 2018.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Inhaltsverzeichnis

[Bearbeiten] Parameter

c -
der Charakter zu klassifizieren
Original:
the character to classify
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
f -
Die Bitmaske aus lookup_classname () erhalten
Original:
the bitmask obtained from lookup_classname()
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Rückgabewert

true wenn c wird durch f eingestuft, false sonst .
Original:
true if c is classified by f, false otherwise.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Beispiel

#include <iostream>
#include <string>
#include <regex>
 
int main()
{
    std::regex_traits<char> t;
    std::string str_alnum = "alnum";
    auto a = t.lookup_classname(str_alnum.begin(), str_alnum.end());
    std::string str_w = "w"; // [:w:] is [:alnum:] plus '_'
    auto w = t.lookup_classname(str_w.begin(), str_w.end());
    std::cout << std::boolalpha
              << t.isctype('A', w) << ' ' << t.isctype('A', a) << '\n'
              << t.isctype('_', w) << ' ' << t.isctype('_', a) << '\n'
              << t.isctype(' ', w) << ' ' << t.isctype(' ', a) << '\n';
}

Output:

true true
true false
false false

[Bearbeiten] Siehe auch

bekommt einen Charakter-Klasse mit Namen
Original:
gets a character class by name
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(öffentliche Elementfunktion)
[virtuell]
stuft ein Zeichen oder eine Zeichenfolge
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.

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