A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4659/stringbuf.virtuals below:

[stringbuf.virtuals]

30 Input/output library [input.output] 30.8 String-based streams [string.streams] 30.8.2 Class template basic_­stringbuf [stringbuf] 30.8.2.4 Overridden virtual functions [stringbuf.virtuals]

int_type underflow() override;

Returns: If the input sequence has a read position available, returns traits​::​to_­int_­type(*gptr()). Otherwise, returns traits​::​eof(). Any character in the underlying buffer which has been initialized is considered to be part of the input sequence.

int_type pbackfail(int_type c = traits::eof()) override;

Effects: Puts back the character designated by c to the input sequence, if possible, in one of three ways:

Returns: traits​::​eof() to indicate failure.

Remarks: If the function can succeed in more than one of these ways, it is unspecified which way is chosen.

int_type overflow(int_type c = traits::eof()) override;

Effects: Appends the character designated by c to the output sequence, if possible, in one of two ways:

Remarks: The function can alter the number of write positions available as a result of any call.

Returns: traits​::​eof() to indicate failure.

The function can make a write position available only if (mode & ios_­base​::​out) != 0. To make a write position available, the function reallocates (or initially allocates) an array object with a sufficient number of elements to hold the current array object (if any), plus at least one additional write position. If (mode & ios_­base​::​in) != 0, the function alters the read end pointer egptr() to point just past the new write position.

pos_type seekoff(off_type off, ios_base::seekdir way, ios_base::openmode which = ios_base::in | ios_base::out) override;

Effects: Alters the stream position within one of the controlled sequences, if possible, as indicated in Table 115.

Table

115

seekoff

positioning


Conditions Result (which & ios_­base​::​in) == ios_­base​::​in positions the input sequence (which & ios_­base​::​out) == ios_­base​::​out positions the output sequence (which & (ios_­base​::​in |
ios_­base​::​out)) ==
(ios_­base​::​in) |
ios_­base​::​out))
and way == either
ios_­base​::​beg or
ios_­base​::​end positions both the input and the output sequences Otherwise the positioning operation fails.

For a sequence to be positioned, if its next pointer (either gptr() or pptr()) is a null pointer and the new offset newoff is nonzero, the positioning operation fails. Otherwise, the function determines newoff as indicated in Table 116.

Table

116

newoff

values


Condition newoff Value way == ios_­base​::​beg 0 way == ios_­base​::​cur the next pointer minus the beginning pointer (xnext - xbeg). way == ios_­base​::​end the high mark pointer minus the beginning pointer (high_­mark - xbeg).

If (newoff + off) < 0, or if newoff + off refers to an uninitialized character ([stringbuf.members]), the positioning operation fails. Otherwise, the function assigns xbeg + newoff + off to the next pointer xnext.

Returns: pos_­type(newoff), constructed from the resultant offset newoff (of type off_­type), that stores the resultant stream position, if possible. If the positioning operation fails, or if the constructed object cannot represent the resultant stream position, the return value is pos_­type(off_­type(-1)).

pos_type seekpos(pos_type sp, ios_base::openmode which = ios_base::in | ios_base::out) override;

Effects: Equivalent to seekoff(off_­type(sp), ios_­base​::​beg, which).

Returns: sp to indicate success, or pos_­type(off_­type(-1)) to indicate failure.

basic_streambuf<charT, traits>* setbuf(charT* s, streamsize n);

Effects: implementation-defined, except that setbuf(0, 0) has no effect.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4