Diferenças entre edições de "cpp/io/basic streambuf/pubsetbuf"
Da cppreference.com
< cpp | io | basic streambuf
m (r2.7.3) (Robô: A adicionar: de, en, es, fr, it, ja, ru, zh) |
m (Use {{lc}}. Update links. Various fixes.) |
||
Linha 2: | Linha 2: | ||
{{cpp/io/basic_streambuf/title | pubsetbuf | setbuf}} | {{cpp/io/basic_streambuf/title | pubsetbuf | setbuf}} | ||
{{cpp/io/basic_streambuf/navbar}} | {{cpp/io/basic_streambuf/navbar}} | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| num=1 |1= |
basic_streambuf<CharT,Traits>* pubsetbuf( char_type* s, std::streamsize n ) | basic_streambuf<CharT,Traits>* pubsetbuf( char_type* s, std::streamsize n ) | ||
}} | }} | ||
− | {{ | + | {{| num=2 |1= |
protected: | protected: | ||
virtual basic_streambuf<CharT,Traits>* setbuf( char_type* s, std::streamsize n ) | virtual basic_streambuf<CharT,Traits>* setbuf( char_type* s, std::streamsize n ) | ||
}} | }} | ||
− | {{ | + | {{end}} |
1) {{tr|Chama {{tt|setbuf(s, n)}} da classe mais derivada|Calls {{tt|setbuf(s, n)}} of the most derived class}} | 1) {{tr|Chama {{tt|setbuf(s, n)}} da classe mais derivada|Calls {{tt|setbuf(s, n)}} of the most derived class}} | ||
Linha 17: | Linha 17: | ||
===Parâmetros=== | ===Parâmetros=== | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| s |{{tr| ponteiro para o primeiro byte no buffer fornecidos pelo utilizador| pointer to the first byte in the user-provided buffer}}}} |
− | {{ | + | {{| n |{{tr| o número de bytes no buffer do usuário fornecida| the number of bytes in the user-provided buffer}}}} |
− | {{ | + | {{end}} |
===Valor de retorno=== | ===Valor de retorno=== | ||
Linha 51: | Linha 51: | ||
===Veja também=== | ===Veja também=== | ||
− | {{ | + | {{begin}} |
− | {{ | + | {{| cpp/io/basic_filebuf/setbuf | mem=std::basic_filebuf}} |
− | {{ | + | {{end}} |
[[de:cpp/io/basic streambuf/pubsetbuf]] | [[de:cpp/io/basic streambuf/pubsetbuf]] |
Edição actual desde as 09h17min de 2 de julho de 2013
![]() |
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. |
basic_streambuf<CharT,Traits>* pubsetbuf( char_type* s, std::streamsize n ) |
(1) | |
protected: virtual basic_streambuf<CharT,Traits>* setbuf( char_type* s, std::streamsize n ) |
(2) | |
Chama
2) setbuf(s, n)
da classe mais derivadaOriginal:
Calls
setbuf(s, n)
of the most derived classThe 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 versão classe base desta função não tem efeito. As classes derivadas podem substituir essa função para permitir a remoção ou substituição da seqüência de caracteres controlada (buffer) com uma matriz fornecida pelo usuário, ou para qualquer propósito específico de implementação outros.
Original:
The base class version of this function has no effect. The derived classes may override this function to allow removal or replacement of the controlled character sequence (the buffer) with a user-provided array, or for any other implementation-specific purpose.
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.
Índice |
[editar] Parâmetros
s | - | ponteiro para o primeiro byte no buffer fornecidos pelo utilizador
Original: pointer to the first byte in the user-provided buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
n | - | o número de bytes no buffer do usuário fornecida
Original: the number of bytes in the user-provided buffer The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[editar] Valor de retorno
*this
[editar] Exemplo
fornecer um amortecedor para a leitura de 10k. No Linux, o utilitário strace podem ser usados para observar o número real de bytes lidos
Original:
provide a 10k buffer for reading. On linux, the strace utility may be used to observe the actual number of bytes read
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 <fstream> #include <iostream> #include <string> int main() { int cnt=0; std::ifstream file; char buf[10241]; file.rdbuf()->pubsetbuf(buf, sizeof buf); file.open("/usr/share/dict/words"); for (std::string line; getline(file, line); ) { cnt++; } std::cout << cnt << '\n'; }
[editar] Veja também
[virtual] |
fornece fornecido pelo usuário tampão ou transforma este filebuf unbuffered Original: provides user-supplied buffer or turns this filebuf unbuffered The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (virtual protegido of std::basic_filebuf função de membro)
|