std::basic_streambuf<CharT,Traits>::pbump
De cppreference.com
< cpp | io | basic streambuf
![]() | Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate. La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
void pbump(int count ); | ||
Cambia de posición el puntero del poner (
pptr()
) por caracteres count
, donde count
pueden ser positivos o negativos. No se aceptan cheques se hacen para mover el puntero fuera del área puso [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.
Si el puntero está avanzada y luego
overflow()
se llama para limpiar el área sometida a la secuencia de caracteres asociados, el efecto es que los personajes extras count
si valores definidos se imprimen .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.
Contenido |
[editar]Parámetros
count | - | número para agregar a poner el puntero 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
(Ninguno)
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]Ejemplo
Ejecuta este código
#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';}
Salida:
The put area contains: 1234 after pbump(10), it contains 1234 is a test
[editar]Ver también
Avanza el puntero siguiente en la secuencia de entrada. (función miembro protegida) |