◐ Shell
clean mode source ↗

std::basic_streambuf::pbump - cppreference.com

Da cppreference.com.

Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.

La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui.

Click here for the English version of this page

<metanoindex/>

<tbody> </tbody>

Riposiziona il puntatore mettere (pptr()) da personaggi count, dove count può essere positivo o negativo. Nessun controllo viene fatto per spostare il puntatore fuori dall'area di messa [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.

Se il puntatore è avanzato e quindi overflow() è chiamato a lavare la zona messa alla sequenza di caratteri associata, l'effetto è che i caratteri count supplementari con valori non definiti vengono emessi.

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.

Parametri

count -

numero da aggiungere al puntatore mettere

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.

Valore di ritorno

(Nessuno)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Esempio

#include <iostream>
#include <string>
#include <fstream>

struct showput_streambuf : std::filebuf
{
    using std::filebuf::pbump; // expose protected
    std::string showput() const {
        return std::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';
}

Output:

The put area contains: 1234
after pbump(10), it contains 1234 is a test

Vedi anche

fa avanzare il puntatore successivo nella sequenza di input

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.


(protetto funzione membro) [modifica]