std::num_get::get, std::num_get::do_get
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
definiert in Header <locale>
|
||
public: iter_type get( iter_type in, iter_type end, std::ios_base& str, |
(1) | |
protected: iter_type do_get( iter_type in, iter_type end, std::ios_base& str, |
(2) | |
do_get
der am meisten abgeleiteten Klasse .do_get
of the most derived class.You can help to correct and verify the translation. Click here for instructions.
in
und erzeugt den Wert von der Art der v
unter Berücksichtigung IO-Stream Formatierung Flaggen aus str.flags()
, Charakter Klassifizierung Regeln std::use_facet<std::ctype<charT>>(str.getloc()) und numerische Satzzeichen aus std::use_facet<std::numpunct<charT>>(str.getloc()). Diese Funktion wird von allen formatierte Eingabe-Stream Operatoren wie std::cin >> n; genannt .in
and generates the value of the type of v
, taking into account IO stream formatting flags from str.flags()
, character classification rules from std::use_facet<std::ctype<charT>>(str.getloc()), and numeric punctuation characters from std::use_facet<std::numpunct<charT>>(str.getloc()). This function is called by all formatted input stream operators such as std::cin >> n;.You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Inhaltsverzeichnis |
[Bearbeiten] Stufe 1: Konvertierungsspezifizierer Auswahl
- I / O-Format Flags erhalten werden, wie durchOriginal:I/O format flags are obtained, as if byThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- fmtflags basefield = (str.flags() & std::ios_base::basefield);
- fmtflags boolalpha = (str.flags() & std::ios_base::boolalpha);
- Wenn die Art der
v
ist ein Integer-Typ, wird die die erste anwendbare Wahl der folgenden fünf ausgewähltOriginal:If the type ofv
is an integer type, the the first applicable choice of the following five is selected:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- Wenn basefield == oct, verwenden Konvertierungsspezifizierer %oOriginal:If basefield == oct, will use conversion specifier %oThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn basefield == hex, verwenden Konvertierungsspezifizierer %XOriginal:If basefield == hex, will use conversion specifier %XThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn basefield == 0, verwenden Konvertierungsspezifizierer %iOriginal:If basefield == 0, will use conversion specifier %iThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
unterzeichnet wird, verwenden Konvertierungsspezifizierer %dOriginal:If the type ofv
is signed, will use conversion specifier %dThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
unsigned ist, wird verwendet Konvertierungsspezifizierer %uOriginal:If the type ofv
is unsigned, will use conversion specifier %uThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
- Für Integer-Typen wird die Länge Modifier für die Umwandlung Spezifikation, falls erforderlich: h für short und unsigned short, l für long und unsigned long, ll für long long und unsigned long longOriginal:For integer types, length modifier is added to the conversion specification if necessary: h for short and unsigned short, l for long and unsigned long, ll for long long and unsigned long longThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
ist float, verwenden Konvertierungsspezifizierer %gOriginal:If the type ofv
is float, will use conversion specifier %gThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
ist double, verwenden Konvertierungsspezifizierer %lgOriginal:If the type ofv
is double, will use conversion specifier %lgThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
ist long double, verwenden Konvertierungsspezifizierer %LgOriginal:If the type ofv
is long double, will use conversion specifier %LgThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
ist void*, verwenden Konvertierungsspezifizierer %pOriginal:If the type ofv
is void*, will use conversion specifier %pThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn der Typ der
v
ist bool und boolalpha==0, verläuft, als ob der Typ desv
ist long, außer dem Wert, der inv
in Stufe 3 gespeichert werden .Original:If the type ofv
is bool and boolalpha==0, proceeds as if the type ofv
is long, except for the value to be stored inv
in stage 3.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Art der
v
ist bool und boolalpha!=0 der folgende Text ersetzt die Stufen 2 und 3:Original:If the type ofv
is bool and boolalpha!=0, the following replaces stages 2 and 3:The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Nachfolgende Zeichen aus dem Eingabe-Iterator
in
erhalten werden gegen die Zeichenfolgen aus std::use_facet<std::numpunct<charT>>(str.getloc()).falsename() und std::use_facet<std::numpunct<charT> >(str.getloc()).truename() nur nach Bedarf erhalten, um die eindeutige Übereinstimmung zu identifizieren abgestimmt. Die Eingabe Iteratorin
wirdend
nur bei Bedarf, um ein Zeichen zu erhalten verglichen .Original:* Successive characters obtained from the input iteratorin
are matched against the character sequences obtained from std::use_facet<std::numpunct<charT>>(str.getloc()).falsename() and std::use_facet<std::numpunct<charT> >(str.getloc()).truename() only as necessary as to identify the unique match. The input iteratorin
is compared toend
only when necessary to obtain a character.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Wenn die Zielsequenz eindeutig abgestimmt wird, wird auf die entsprechende
v
bool Wert eingestellt. Andernfalls wird in falsev
gespeichert und std::ios_base::failbit wirderr
zugeordnet. Wenn eindeutige Übereinstimmung nicht gefunden werden konnte, bevor die Eingabe beendet (in==end), wird err|=std::ios_base::eofbit ausgeführt .Original:* If the target sequence is uniquely matched,v
is set to the corresponding bool value. Otherwise false is stored inv
and std::ios_base::failbit is assigned toerr
. If unique match could not be found before the input ended (in==end), err|=std::ios_base::eofbit is executed.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Stufe 2: Charakter-Extraktion
- Wenn in==end, Stufe 2 sofort beendet wird, werden keine weiteren Zeichen extrahiertOriginal:If in==end, Stage 2 is terminated immediately, no further characters are extractedThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Das nächste Zeichen wird von in extrahiert, wie wenn sie von char_type ct = *in;Original:The next character is extracted from in as if by char_type ct = *in;The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Wenn die Zeichen entspricht einem "0123456789abcdefxABCDEFX+-", erweitert, um der Ländereinstellung char_type wie von std::use_facet<std::ctype<charT>>(str.getloc()).widen(), wird es an die entsprechende char umgewandelt .Original:* If the character matches one of "0123456789abcdefxABCDEFX+-", widened to the locale's char_type as if by std::use_facet<std::ctype<charT>>(str.getloc()).widen(), it is converted to the corresponding char.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Wenn der Charakter entspricht dem Dezimaltrennzeichen (std::use_facet<std::numpunct<charT>>(str.getloc()).decimal_point())), wird es durch '.' ersetzt .Original:* If the character matches the decimal point separator (std::use_facet<std::numpunct<charT>>(str.getloc()).decimal_point())), it is replaced by '.'.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Wenn die Zeichen entspricht das Tausendertrennzeichen (std::use_facet<std::numpunct<charT>>(str.getloc()).thousands_sep()) und die Tausende Trennung in Gebrauch ist überhaupt std::use_facet<std::numpunct<charT>>(str.getloc()).grouping().length() != 0, dann, wenn der Dezimalpunkt '.' wurde noch nicht angesammelt, wird die Position des Zeichens rememebered, aber der Charakter ansonsten ignoriert. Wenn der Dezimalpunkt bereits angesammelt, wird das Zeichen verworfen und Stage 2 endet .Original:* If the character matches the thousands separator (std::use_facet<std::numpunct<charT>>(str.getloc()).thousands_sep()) and the thousands separation is in use at all std::use_facet<std::numpunct<charT>>(str.getloc()).grouping().length() != 0, then if the decimal point '.' has not yet been accumulated, the position of the character is rememebered, but the character is otherwise ignored. If the decimal point has already been accumulated, the character is discarded and Stage 2 terminates.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Auf jeden Fall wird die Prüfung durchgeführt, ob die char aus den vorherigen Schritten erhalten wird in dem Eingabefeld die durch die gegebene std::scanf Konvertierungsspezifizierer in Stufe 1 ausgewählt geparst werden würde, erlaubt. Wenn es erlaubt ist, wird es in einem temporären Puffer und Stufe 2 Wiederholungen akkumuliert. Wenn es nicht erlaubt ist, endet Stage 2 .Original:* In any case, the check is made whether the char obtained from the previous steps is allowed in the input field that would be parsed by std::scanf given the conversion specifier selected in Stage 1. If it is allowed, it is accumulated in a temporary buffer and Stage 2 repeats. If it is not allowed, Stage 2 terminates.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Stufe 3: Umwandlung und Speicherung
- Die Sequenz des in Stufe 2 chars akkumuliert wird, um einen numerischen Wert umgewandeltOriginal:The sequence of chars accumulated in Stage 2 is converted to a numeric valueThe text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Die Eingabe erfolgt wie von std::scanf mit der Umwandlung Spezifizierer in Stage 1 (bis C + +11) gewählt analysiertOriginal:* The input is parsed as if by std::scanf with the conversion specifier selected in Stage 1 (bis C + +11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Die Eingabe erfolgt wie von std::strtoll für Ganzzahl analysiert
v
, std::strtoull für unsigned integerv
oder std::strtold für Fließkomma-v
(seit C++11)Original:* The input is parsed as if by std::strtoll for signed integerv
, std::strtoull for unsigned integerv
, or std::strtold for floating-pointv
(seit C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Umwandlung Funktion ausfällt, um das gesamte Feld zu überführen, wird der Wert in 0
v
(seit C++11) gespeichertOriginal:If the conversion function fails to convert the entire field, the value 0 is stored inv
(seit C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Umwandlung Funktion führt einen positiven Wert zu groß, um in der Art der
v
passt, wird die positive darstellbare Wert inv
(seit C++11) gespeichertOriginal:If the conversion function results in a positive value too large to fit in the type ofv
, the most positive representable value is stored inv
(seit C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn die Umwandlung Funktion führt einen negativen Wert zu groß, um in der Art der
v
passen, wird die meisten negativen darstellbare Wert inv
(seit C++11) gespeichertOriginal:If the conversion function results in a negative value too large to fit in the type ofv
, the most negative representable value is stored inv
(seit C++11)The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - In jedem Fall, wenn die Umsetzungsfunktion ausfällt std::ios_base::failbit wird
err
zugeordnetOriginal:In any case, if the conversion function fails std::ios_base::failbit is assigned toerr
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Andernfalls wird das numerische Ergebnis der Umwandlung in
v
gespeichertOriginal:Otherwise, the numeric result of the conversion is stored inv
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - * Wenn der Typ
v
ist bool und boolalpha nicht gesetzt ist, dann, wenn der Wert gespeichert werden soll 0 wird false gespeichert, wenn der Wert gespeichert werden soll 1, true gespeichert ist, für jeden anderen Wert std::ios_base::failbit zugeordnet isterr
.Original:* If the type ofv
is bool and boolalpha is not set, then if the value to be stored is 0, false is stored, if the value to be stored is 1, true is stored, for any other value std::ios_base::failbit is assigned toerr
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Danach wird Zifferngruppierung überprüft. wenn die Position eines der Tausender-Trennzeichen in Stage 2 verworfen nicht mit der Gruppierung nach std::use_facet<std::numpunct<charT>>(str.getloc()).grouping() vorgesehen ist, std::ios_base::failbit um
err
zugeordnet .Original:After this, digit grouping is checked. if the position of any of the thousands separators discarded in Stage 2 does not match the grouping provided by std::use_facet<std::numpunct<charT>>(str.getloc()).grouping(), std::ios_base::failbit is assigned toerr
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions. - Wenn Stufe 2 durch den Test beendet wurde in==end wird err|=std::ios_base::eofbit ausgeführt, um die eof-Bit gesetzt .Original:If Stage 2 was terminated by the test in==end, err|=std::ios_base::eofbit is executed to set the eof bit.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
in
[Bearbeiten] Notes
v
bleibt unverändert. In C + 11, wird auf einen Wert eingestellt, wie oben beschrieben .v
is left unchanged. In C++11, it is set to a value as described above.You can help to correct and verify the translation. Click here for instructions.
[Bearbeiten] Beispiel
This section is incomplete Reason: no example |
[Bearbeiten] Siehe auch
Extrakte formatierte Daten Original: extracts formatted data 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::basic_istream )
|