◐ Shell
clean mode source ↗

std::basic_streambuf::pbump – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

Positioniert die Schreibzeigers (pptr()) durch count Zeichen, wobei count positiv oder negativ sein kann. Keine Schecks werden zum Bewegen der Zeiger außerhalb der Put-Bereich [pbase(), epptr()) getan .

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.

Wenn der Zeiger fortgeschrittenen und dann overflow() aufgerufen wird, um die Put-Bereich zugehörigen Zeichenfolge spülen, ist der Effekt, dass zusätzliche count Zeichen mit undefinierten Werten ausgegeben werden .

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.

Parameter

count -

Zahl der Put-Zeiger hinzuzufügen

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.

Rückgabewert

(None)

Original:

(none)

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

Beispiel

#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

Siehe auch

Fortschritte der nächste Zeiger in der Eingabesequenz

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.


(geschützt Member-Funktion) [edit]