Input/output library — cppreference.com
De cppreference.com
C + + comprend deux entrées / sorties bibliothèques: une société moderne, basée sur les flux d'E / S de la bibliothèque et de l'ensemble standard de style C I / O fonctions .
Original:
C++ includes two input/output libraries: a modern, stream-based I/O library and the standard set of C-style I/O functions.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Basée sur les flux I / O
Le flux de base d'entrée / sortie librairie est organisée autour d'entrée abstrait / périphériques de sortie. Ces dispositifs abstraits permettent le même code pour gérer les entrées / sorties de fichiers, flux mémoire ou des périphériques adaptateurs personnalisés qui effectuent des opérations arbitraires (par exemple la compression) à la volée .
Original:
The stream-based input/output library is organized around abstract input/output devices. These abstract devices allow the same code to handle input/output to files, memory streams, or custom adaptor devices that perform arbitrary operations (e.g. compression) on the fly.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La plupart des classes sont un modèle, de sorte qu'ils peuvent être adaptés à tout type de caractère de base. Typedefs distinctes sont prévues pour les types les plus communs de caractères de base (char et wchar_t). Les classes sont organisées dans la hiérarchie suivante:
Original:
Most of the classes are templated, so they can be adapted to any basic character type. Separate typedefs are provided for the most common basic character types (char and wchar_t). The classes are organized into the following hierarchy:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Inheritance diagram
Abstraction Original: Abstraction The text has been machine-translated via Google Translate. | |
gère codes de formatage et d'entrée / sortie exceptions Original: manages formatting flags and input/output exceptions The text has been machine-translated via Google Translate. (classe) | |
gère une mémoire tampon de flux arbitraire Original: manages an arbitrary stream buffer The text has been machine-translated via Google Translate. (classe générique) | |
abstraction d'un périphérique brut Original: abstracts a raw device The text has been machine-translated via Google Translate. (classe générique) | |
encapsule un périphérique donné abstrait (std::basic_streambuf) Original: wraps a given abstract device (std::basic_streambuf) The text has been machine-translated via Google Translate. (classe générique) | |
encapsule un périphérique donné abstrait (std::basic_streambuf) Original: wraps a given abstract device (std::basic_streambuf) The text has been machine-translated via Google Translate. (classe générique) | |
encapsule un périphérique donné abstrait (std::basic_streambuf) Original: wraps a given abstract device (std::basic_streambuf) The text has been machine-translated via Google Translate. (classe générique) | |
Fichier E / 0 mise en œuvre Original: File I/0 implementation The text has been machine-translated via Google Translate. | |
met en œuvre de fichier de périphérique brut Original: implements raw file device The text has been machine-translated via Google Translate. (classe générique) | |
met en œuvre des opérations de haut niveau de fichiers de flux d'entrée Original: implements high-level file stream input operations The text has been machine-translated via Google Translate. (classe générique) | |
met en œuvre des opérations de haut niveau de fichiers de flux de sortie Original: implements high-level file stream output operations The text has been machine-translated via Google Translate. (classe générique) | |
met en œuvre de haut niveau de fichiers de flux d'entrée / sortie des opérations Original: implements high-level file stream input/output operations The text has been machine-translated via Google Translate. (classe générique) | |
Chaîne I / 0 mise en œuvre Original: String I/0 implementation The text has been machine-translated via Google Translate. | |
met en œuvre dispositif chaîne brute Original: implements raw string device The text has been machine-translated via Google Translate. (classe générique) | |
met en œuvre des opérations de haut niveau à cordes de flux d'entrée Original: implements high-level string stream input operations The text has been machine-translated via Google Translate. (classe générique) | |
met en œuvre des opérations de haut niveau chaîne de flux de sortie Original: implements high-level string stream output operations The text has been machine-translated via Google Translate. (classe générique) | |
implémente haut niveau de chaîne de flux d'entrée / sortie Original: implements high-level string stream input/output operations The text has been machine-translated via Google Translate. (classe générique) | |
Tableau d'E / S mises en œuvre Original: Array I/O implementations The text has been machine-translated via Google Translate. | |
(obsolète) |
met en œuvre des premières appareil tableau de caractères Original: implements raw character array device The text has been machine-translated via Google Translate. (classe) |
(obsolète) |
met en œuvre des opérations de caractère tableau d'entrée Original: implements character array input operations The text has been machine-translated via Google Translate. (classe) |
(obsolète) |
met en œuvre des opérations de caractère tableau de sortie Original: implements character array output operations The text has been machine-translated via Google Translate. (classe) |
(obsolète) |
implémente caractères réseau d'entrée / sortie Original: implements character array input/output operations The text has been machine-translated via Google Translate. (classe) |
Typedefs
Les typedefs suivantes pour les types de caractères communs sont fournis:
Original:
The following typedefs for common character types are provided:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
|<source lang="cpp">}} {{tr|typedef basic_ios <char> ios;|typedef basic_ios<char> ios;}} {{tr|typedef basic_ios wios <wchar_t>;|typedef basic_ios<wchar_t> wios;}} {{tr|typedef streambuf <char> basic_streambuf;|typedef basic_streambuf<char> streambuf;}} {{tr|typedef wstreambuf <wchar_t> basic_streambuf;|typedef basic_streambuf<wchar_t> wstreambuf;}} {{tr|typedef <char> basic_filebuf filebuf;|typedef basic_filebuf<char> filebuf;}} {{tr|typedef basic_filebuf <wchar_t> wfilebuf;|typedef basic_filebuf<wchar_t> wfilebuf;}} {{tr|typedef <char> basic_stringbuf stringbuf;|typedef basic_stringbuf<char> stringbuf;}} {{tr|typedef basic_stringbuf <wchar_t> wstringbuf;|typedef basic_stringbuf<wchar_t> wstringbuf;}} {{tr|typedef istream <char> basic_istream;|typedef basic_istream<char> istream;}} {{tr|typedef basic_istream <wchar_t> wistream;|typedef basic_istream<wchar_t> wistream;}} {{tr|typedef basic_ostream <char> ostream;|typedef basic_ostream<char> ostream;}} {{tr|typedef basic_ostream <wchar_t> wostream;|typedef basic_ostream<wchar_t> wostream;}} {{tr|typedef basic_iostream <char> iostream;|typedef basic_iostream<char> iostream;}} {{tr|typedef basic_iostream <wchar_t> wiostream;|typedef basic_iostream<wchar_t> wiostream;}} {{tr|typedef <char> basic_ifstream ifstream;|typedef basic_ifstream<char> ifstream;}} {{tr|typedef basic_ifstream <wchar_t> wifstream;|typedef basic_ifstream<wchar_t> wifstream;}} {{tr|typedef <char> basic_ofstream ofstream;|typedef basic_ofstream<char> ofstream;}} {{tr|typedef basic_ofstream <wchar_t> wofstream;|typedef basic_ofstream<wchar_t> wofstream;}} {{tr|typedef <char> basic_fstream fstream;|typedef basic_fstream<char> fstream;}} {{tr|typedef basic_fstream <wchar_t> wfstream;|typedef basic_fstream<wchar_t> wfstream;}} {{tr|typedef <char> basic_istringstream istringstream;|typedef basic_istringstream<char> istringstream;}} {{tr|typedef basic_istringstream <wchar_t> wistringstream;|typedef basic_istringstream<wchar_t> wistringstream;}} {{tr|typedef <char> basic_ostringstream ostringstream;|typedef basic_ostringstream<char> ostringstream;}} {{tr|typedef basic_ostringstream <wchar_t> wostringstream;|typedef basic_ostringstream<wchar_t> wostringstream;}} {{tr|typedef <char> basic_stringstream stringstream;|typedef basic_stringstream<char> stringstream;}} {{tr|typedef basic_stringstream <wchar_t> wstringstream;|typedef basic_stringstream<wchar_t> wstringstream;}} {{tr|</ Source>|
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Prédéfinis objets de flux standards:
Original:
Predefined standard stream objects:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
|<source lang="cpp">}} {{tr|extern istream cin; d'entrée / / standard (stdin)|extern istream cin; //standard input (stdin)}} {{tr|extern wistream WCIN;|extern wistream wcin;}} {{tr|extern ostream cout, sortie / / standard (stdout)|extern ostream cout; //standard output (stdout)}} {{tr|extern wostream wcout;|extern wostream wcout;}} {{tr|extern ostream cerr; erreur / / standard (stderr)|extern ostream cerr; //standard error (stderr)}} {{tr|extern wostream wcerr;|extern wostream wcerr;}} {{tr|sabot ostream externe; log / / standard (stdlog)|extern ostream clog; //standard log (stdlog)}} {{tr|extern wostream wclog;|extern wostream wclog;}} {{tr|</ Source>|
Original:
{{{2}}}
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
I / O manipulateurs
Le flux des E / S I / O manipulateurs bibliothèque utilise (par exemple std::boolalpha, std::hex, etc) afin de contrôler la façon dont se comportent les flux .
Original:
The stream-based I/O library uses I / O manipulateurs (e.g. std::boolalpha, std::hex, etc.) to control how streams behave.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Types
Les types suivants auxiliaires sont définies:
Original:
The following auxiliary types are defined:
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 | |
représente par rapport fichier / flux de position (décalage par rapport FPO), suffisante pour représenter toute la taille du fichier Original: represents relative file/stream position (offset from fpos), sufficient to represent any file size The text has been machine-translated via Google Translate. (typedef) | |
représente le nombre de caractères transférés dans une opération d'E / S ou la taille d'une mémoire tampon d'entrée / sortie Original: represents the number of characters transferred in an I/O operation or the size of an I/O buffer The text has been machine-translated via Google Translate. (typedef) | |
représente la position absolue dans un flux ou un fichier Original: represents absolute position in a stream or a file The text has been machine-translated via Google Translate. (classe générique) | |
Quatre spécialisations de std::fpos sont fournis:
Original:
Four specializations of std::fpos are provided:
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 | |
Type d' Original: Type The text has been machine-translated via Google Translate. |
Definition |
streampos
|
std::fpos<std::char_traits<char>::state_type>
|
u16streampos
|
std::fpos<std::char_traits<char16_t>::state_type>
|
u32streampos
|
std::fpos<std::char_traits<char32_t>::state_type>
|
wstreampos
|
std::fpos<std::char_traits<wchar_t>::state_type>
|
Interface catégorie d'erreur
Defined in header | |
les codes d'erreur IO cours d'eau Original: the IO stream error codes The text has been machine-translated via Google Translate. (enum) [edit] | |
identifie la catégorie d'erreur iostream Original: identifies the iostream error category The text has been machine-translated via Google Translate. (fonction) [edit] | |
C-style IO
C + + inclut également la d'entrée / sortie des fonctions définies par C, comme std::fopen, std::getc, etc
Original:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.