Namensräume
Varianten
Aktionen

std::time_put_byname

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 CharT, class OutputIterator = std::ostreambuf_iterator<CharT> >
class time_put_byname : public std::time_put<CharT, OutputIterator>;
std::time_put_byname ist ein std::time_put Facette, die Uhrzeit und das Datum Formatierungsregeln des Gebietsschemas an die Konstruktion festgelegt kapselt .
Original:
std::time_put_byname is a std::time_put facet which encapsulates time and date formatting rules of the locale specified at its construction.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Zwei Spezialisierungen werden durch die Standard-Bibliothek zur Verfügung gestellt
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::time_put_byname<char, OutputIterator>
schmal / Multibyte Zeit mit Formatieren
Original:
narrow/multibyte time formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
std::time_put_byname<wchar_t>, OutputIterator
Widestringfelder Zeit mit Formatieren
Original:
wide string time formatting
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

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 CharT
iter_type OutputIterator

[Bearbeiten] Member-Funktionen

baut eine neue time_put_byname Facette
Original:
constructs a new time_put_byname 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)
zerstört sich eine time_put_byname Facette
Original:
destructs a time_put_byname 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)

Inherited from std::time_put

Member objects

Member name
Original:
Member name
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Type
id (statisch) std::locale::id

Member functions

Beruft do_put
Original:
invokes do_put
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::time_put) [edit]

Protected member functions

[virtuell]
Formate Datum / Uhrzeit und schreibt Ausgabestream
Original:
formats date/time and writes to output stream
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::time_get) [edit]

[Bearbeiten] Beispiel

Dieses Beispiel druckt aktuelle Uhrzeit mit der "C"-Locale mit dem time_put Facette von verschiedenen time_put_byname Facetten ersetzt
Original:
This example prints current time using the "C" locale with the time_put facet replaced by various time_put_byname facets
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 <ctime>
#include <iomanip>
#include <codecvt>
 
int main()
{
    std::time_t t = std::time(NULL);
    std::wbuffer_convert<std::codecvt_utf8<wchar_t>> conv(std::cout.rdbuf());
    std::wostream out(&conv);
 
    out.imbue(std::locale(out.getloc(),
                          new std::time_put_byname<wchar_t>("ja_JP")));
    out << std::put_time(std::localtime(&t), L"%A %c") << '\n';
 
    out.imbue(std::locale(out.getloc(),
                         new std::time_put_byname<wchar_t>("ru_RU.utf8")));
    out << std::put_time(std::localtime(&t), L"%A %c") << '\n'; 
 
    out.imbue(std::locale(out.getloc(),
                         new std::time_put_byname<wchar_t>("sv_SE.utf8")));
    out << std::put_time(std::localtime(&t), L"%A %c") << '\n'; 
}

Possible output:

木曜日 2012年08月09日 21時41分02秒
Четверг Чт. 09 авг. 2012 21:41:02
torsdag tor  9 aug 2012 21:41:02

[Bearbeiten] Siehe auch

Formate Inhalt struct std::tm für die Ausgabe als Zeichenfolge
Original:
formats contents of struct std::tm for output as character sequence
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Klassen-Template) [edit]