std::basic_streambuf::pbump
Da cppreference.com
< cpp | io | basic streambuf
![]() | 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. |
void pbump(int count ); | ||
Reposiciona o ponteiro colocar (
pptr()
) por caracteres de count
, onde count
pode ser positivo ou negativo. Nenhuma verificação é feita para mover o ponteiro fora da área colocou [pbase(), epptr())
.Original:
Repositions the put pointer (
pptr()
) by count
characters, where count
may be positive or negative. No checks are done for moving the pointer outside the put area [pbase(), epptr())
.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.
Se o ponteiro é avançado e depois
overflow()
é chamado para limpar a área para colocar a seqüência de caracteres associados, o efeito é que os personagens count
extras com valores indefinidos são saída.Original:
If the pointer is advanced and then
overflow()
is called to flush the put area to the associated character sequence, the effect is that extra count
characters with undefined values are output.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
count | - | número de adicionar ao colocar o ponteiro Original: number to add to the put pointer 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
(Nenhum)
Original:
(none)
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]Exemplo
#include <iostream>#include <string>#include <fstream> struct showput_streambuf :std::filebuf{using std::filebuf::pbump;// expose protectedstd::string showput()const{returnstd::string(pbase(), pptr());}}; int main(){ showput_streambuf mybuf; mybuf.open("test.txt", std::ios_base::out);std::ostream str(&mybuf); str <<"This is a test"<<std::flush<<"1234";std::cout<<"The put area contains: "<< mybuf.showput()<<'\n'; mybuf.pbump(10);std::cout<<"after pbump(10), it contains "<< mybuf.showput()<<'\n';}
Saída:
The put area contains: 1234 after pbump(10), it contains 1234 is a test
[editar]Veja também
avança o ponteiro próximo na seqüência de entrada Original: advances the next pointer in the input sequence The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (protegido função de membro) |