std::time_put_byname
De cppreference.com.
|
|
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. |
| Défini dans l'entête <locale>
|
||
| template< class CharT, class OutputIterator = std::ostreambuf_iterator<CharT> > class time_put_byname : public std::time_put<CharT, OutputIterator>; |
||
std::time_put_byname est une facette std::time_put qui encapsule les règles de formatage de date et heure de la locale spécifiée lors de sa construction .
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.
You can help to correct and verify the translation. Click here for instructions.
Deux spécialisations sont fournis par la bibliothèque 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.
You can help to correct and verify the translation. Click here for instructions.
| Defined in header
<locale> | |
| std::time_put_byname<char, OutputIterator> | étroite / multi-octets formatage temps
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 | large formatage temps chaîne
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. |
Sommaire |
[modifier] Types de membres
| Type de membre
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
|
[modifier] Les fonctions membres
| construit un nouveau 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. (fonction membre publique) | |
| Détruit une facette time_put_byname 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. (fonction membre protégée) | |
Inherited from std::time_put
Member objects
| Nom du membre
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 (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. |
std::locale::id |
Member functions
| Invoque 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. (fonction membre publique de std::time_put)
| |
Protected member functions
| [ 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. |
formats de date / heure et écrit dans le flux de sortie 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. (fonction membre virtuelle protégée de std::time_get)
|
[modifier] Exemple
Cet exemple imprime heure actuelle en utilisant la localisation "C" avec la facette time_put remplacé par des facettes différentes time_put_byname
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.
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'; }
Résultat possible :
木曜日 2012年08月09日 21時41分02秒 Четверг Чт. 09 авг. 2012 21:41:02 torsdag tor 9 aug 2012 21:41:02
[modifier] Voir aussi
| formats contenu de struct std::tm pour la sortie en tant que séquence de caractères 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. (classe générique) | |