protected member function
<streambuf> <iostream>
void setg (char* gbeg, char* gnext, char* gend);
Set input sequence pointers
Sets the value for the pointers that define the boundaries of the buffered portion of the controlled input sequence (eback and egptr) as well as the get pointer itself (gptr).
This is a protected member that other member functions can call to change the array that describes the buffered portion of the controlled input sequence.
Parameters
- new_eback
- New value for the pointer to the beginning of the accessible part of the controlled input sequence (eback).
- new_gptr
- New value for the get pointer (gptr), which points to the character in the controlled input sequence to be accessed by the next input operation.
This shall point to a character between new_eback and new_egptr.
- new_egptr
- New value for the end pointer, just past the end of the accessible part of the controlled input sequence (egptr).
This shall point to a character in the same array as new_eback.
Data races
Modifies the stream buffer object.
Concurrent access to the same stream buffer object may introduce data races.
Exception safety
Basic guarantee: if an exception is thrown, the stream buffer is in a valid state.
Invalid arguments cause undefined behavior.
See also
- streambuf::gbump
- Increase get pointer (protected member function)
- streambuf::eback
- Pointer to beginning of input sequence (protected member function)
- streambuf::egptr
- Pointer to end of input sequence (protected member function)
- streambuf::gptr
- Pointer to current position of input sequence (protected member function)
- streambuf::setp
- Set output sequence pointers (protected member function)