GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::basic_streambuf::pbump(3) C++ Standard Libary std::basic_streambuf::pbump(3)

std::basic_streambuf::pbump - std::basic_streambuf::pbump


protected:
void pbump( int count );


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()).


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.


count - number to add to the put pointer


(none)


Because this function takes an int, it cannot manipulate buffers larger than
std::numeric_limits<int>::max() characters (LWG 255)

// Run this code


#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';
}


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


gbump advances the next pointer in the input sequence
(protected member function)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.