Input/output library
Da cppreference.com
< cpp
![]() |
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. |
C + + inclui duas entradas / saídas bibliotecas: uma moderna, baseada em fluxo de biblioteca de E / S e do conjunto padrão de estilo C / S funções.
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.
You can help to correct and verify the translation. Click here for instructions.
[editar] Baseada em fluxo de I / O
O fluxo baseado em biblioteca de entrada / saída é organizado em torno de entrada resumo / dispositivos de saída. Estes dispositivos abstratos permitir que o mesmo código para manipular a entrada / saída de arquivos, fluxos de memória ou dispositivos adaptador personalizado que executam operações arbitrárias (de compressão, por exemplo) na mosca.
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.
You can help to correct and verify the translation. Click here for instructions.
A maior parte das classes são templated, para que possam ser adaptadas a qualquer tipo de carácter básico. Typedefs separados são fornecidos para os tipos mais comuns de caráter básico (char e wchar_t). As aulas são organizadas em a seguinte hierarquia:
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.
You can help to correct and verify the translation. Click here for instructions.
Original: Abstraction The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
gerencia bandeiras de formatação e de entrada / saída exceções Original: manages formatting flags and input/output exceptions The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) | |
gerencia um buffer de fluxo arbitrária Original: manages an arbitrary stream buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
abstrai um dispositivo bruto Original: abstracts a raw device The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
envolve um determinado dispositivo abstrato (std::basic_streambuf) e oferece alto nível de interface de entrada Original: wraps a given abstract device (std::basic_streambuf) and provides high-level input interface The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
envolve um determinado dispositivo abstrato (std::basic_streambuf) e oferece alto nível de interface de saída Original: wraps a given abstract device (std::basic_streambuf) and provides high-level output interface The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
envolve um determinado dispositivo abstrato (std::basic_streambuf) e oferece alto nível de entrada / interface de saída Original: wraps a given abstract device (std::basic_streambuf) and provides high-level input/output interface The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
Original: File I/0 implementation The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
implementa dispositivo de arquivo RAW Original: implements raw file device The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
implementa alto nível de arquivo operações de entrada de fluxo Original: implements high-level file stream input operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
implementa alto nível de arquivo operações de saída de fluxo Original: implements high-level file stream output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
implementa alto nível de ficheiros de fluxo de entrada / saída operações Original: implements high-level file stream input/output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
Original: String I/0 implementation The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
implementa dispositivo de corda crua Original: implements raw string device The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
implementa alto nível cordas operações de entrada de fluxo Original: implements high-level string stream input operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
implementa alto nível cordas operações de saída de fluxo Original: implements high-level string stream output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
implementa alto nível de cadeia de fluxo de entrada / saída operações Original: implements high-level string stream input/output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) | |
Original: Array I/O implementations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(obsoleta) |
implementa dispositivo de matriz de caracteres brutos Original: implements raw character array device The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(obsoleta) |
implementa operações de introdução de caracteres da matriz Original: implements character array input operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(obsoleta) |
implementa operações de caracteres de saída da matriz Original: implements character array output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
(obsoleta) |
implementa caracteres de matriz de entrada / saída operações Original: implements character array input/output operations The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe) |
[editar] Typedefs
Os typedefs seguintes para tipos de caracteres comuns são fornecidos:
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.
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 <wchar_t> wios;|typedef basic_ios<wchar_t> wios;}} {{tr|streambuf <char> typedef basic_streambuf;|typedef basic_streambuf<char> streambuf;}} {{tr|wstreambuf <wchar_t> typedef basic_streambuf;|typedef basic_streambuf<wchar_t> wstreambuf;}} {{tr|typedef basic_filebuf <char> filebuf;|typedef basic_filebuf<char> filebuf;}} {{tr|typedef basic_filebuf <wchar_t> wfilebuf;|typedef basic_filebuf<wchar_t> wfilebuf;}} {{tr|typedef basic_stringbuf <char> stringbuf;|typedef basic_stringbuf<char> stringbuf;}} {{tr|typedef basic_stringbuf <wchar_t> wstringbuf;|typedef basic_stringbuf<wchar_t> wstringbuf;}} {{tr|istream <char> typedef 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 basic_ifstream <char> ifstream;|typedef basic_ifstream<char> ifstream;}} {{tr|typedef basic_ifstream <wchar_t> wifstream;|typedef basic_ifstream<wchar_t> wifstream;}} {{tr|typedef basic_ofstream <char> ofstream,|typedef basic_ofstream<char> ofstream;}} {{tr|typedef basic_ofstream <wchar_t> wofstream;|typedef basic_ofstream<wchar_t> wofstream;}} {{tr|typedef basic_fstream <char> fstream;|typedef basic_fstream<char> fstream;}} {{tr|typedef basic_fstream <wchar_t> wfstream;|typedef basic_fstream<wchar_t> wfstream;}} {{tr|typedef basic_istringstream <char> istringstream;|typedef basic_istringstream<char> istringstream;}} {{tr|typedef basic_istringstream <wchar_t> wistringstream;|typedef basic_istringstream<wchar_t> wistringstream;}} {{tr|typedef basic_ostringstream <char> ostringstream;|typedef basic_ostringstream<char> ostringstream;}} {{tr|typedef basic_ostringstream <wchar_t> wostringstream;|typedef basic_ostringstream<wchar_t> wostringstream;}} {{tr|typedef basic_stringstream <char> 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.
You can help to correct and verify the translation. Click here for instructions.
Padrão predefinidas objetos de fluxo:
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.
You can help to correct and verify the translation. Click here for instructions.
|<source lang="cpp">}} {{tr|extern istream cin; entrada / / padrão (stdin)|extern istream cin; //standard input (stdin)}} {{tr|extern wistream wcin,|extern wistream wcin;}} {{tr|extern ostream cout; saída / / padrão (stdout)|extern ostream cout; //standard output (stdout)}} {{tr|extern wostream wcout,|extern wostream wcout;}} {{tr|extern ostream cerr, erro / / padrão (stderr)|extern ostream cerr; //standard error (stderr)}} {{tr|extern wostream wcerr,|extern wostream wcerr;}} {{tr|tamanco extern ostream; / log / padrão (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.
You can help to correct and verify the translation. Click here for instructions.
[editar] I / O Manipuladores
O fluxo baseado biblioteca de I / O utiliza I / O manipuladores (eg std::boolalpha, std::hex, etc) para controlar a forma como se comportam correntes.
Original:
The stream-based I/O library uses I / O manipuladores (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.
You can help to correct and verify the translation. Click here for instructions.
[editar] Tipos
Os seguintes tipos auxiliares são definidos:
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.
You can help to correct and verify the translation. Click here for instructions.
Defined in header
<ios> | |
representa a posição arquivo / stream relativa (deslocamento de fpos), suficientes para representar qualquer tamanho de arquivo Original: represents relative file/stream position (offset from fpos), sufficient to represent any file size The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (typedef) | |
representa o número de caracteres transferidos de uma operação I / O, ou o tamanho de um tampão de I / O 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. You can help to correct and verify the translation. Click here for instructions. (typedef) | |
representa a posição absoluta em um córrego ou um arquivo Original: represents absolute position in a stream or a file The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (modelo de classe) |
Quatro especializações de std::fpos são fornecidos:
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.
You can help to correct and verify the translation. Click here for instructions.
Defined in header
<ios> | |
Tipo
Original: Type The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
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> |
[editar] Interface de categoria de erro
Defined in header
<ios> | |
(C++11) |
O erro de IO códigos de fluxo Original: the IO stream error codes The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (enum) |
(C++11) |
identifica a categoria de erro iostream Original: identifies the iostream error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (função) |
[editar] C-estilo IO
C + + também inclui o entrada / saída de funções definidas por C, como std::fopen, std::getc, etc
Original:
C++ also includes the entrada / saída de funções definidas por C, such as std::fopen, std::getc, etc.
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.