|
| typedef ctype< _CharT > | __ctype_type |
| |
| typedef ctype< _CharT > | __ctype_type |
| |
| typedef basic_ios< _CharT, _Traits > | __ios_type |
| |
| typedef basic_ios< _CharT, _Traits > | __ios_type |
| |
| typedef basic_iostream< char_type, traits_type > | __iostream_type |
| |
| typedef basic_istream< _CharT, _Traits > | __istream_type |
| |
| typedef num_get< _CharT, istreambuf_iterator< _CharT, _Traits > > | __num_get_type |
| |
| typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > | __num_put_type |
| |
| typedef num_put< _CharT, ostreambuf_iterator< _CharT, _Traits > > | __num_put_type |
| |
| typedef basic_ostream< _CharT, _Traits > | __ostream_type |
| |
| typedef basic_streambuf< _CharT, _Traits > | __streambuf_type |
| |
| typedef basic_streambuf< _CharT, _Traits > | __streambuf_type |
| |
| typedef basic_string< _CharT, _Traits, _Alloc > | __string_type |
| |
| typedef basic_stringbuf< _CharT, _Traits, _Alloc > | __stringbuf_type |
| |
| typedef _Alloc | allocator_type |
| |
| typedef _CharT | char_type |
| |
| enum | event { erase_event
, imbue_event
, copyfmt_event
} |
| |
| typedef void(* | event_callback) (event __e, ios_base &__b, int __i) |
| |
| typedef _Ios_Fmtflags | fmtflags |
| |
| typedef traits_type::int_type | int_type |
| |
| typedef int | io_state |
| |
| typedef _Ios_Iostate | iostate |
| |
| typedef traits_type::off_type | off_type |
| |
| typedef int | open_mode |
| |
| typedef _Ios_Openmode | openmode |
| |
| typedef traits_type::pos_type | pos_type |
| |
| typedef int | seek_dir |
| |
| typedef _Ios_Seekdir | seekdir |
| |
| typedef std::streamoff | streamoff |
| |
| typedef std::streampos | streampos |
| |
| typedef _Traits | traits_type |
| |
|
| | basic_stringstream () |
| |
| | basic_stringstream (basic_stringstream &&__rhs) |
| |
| | basic_stringstream (const __string_type &__str, ios_base::openmode __m=ios_base::out|ios_base::in) |
| |
|
| basic_stringstream (const basic_stringstream &)=delete |
| |
| | basic_stringstream (ios_base::openmode __m) |
| |
| | ~basic_stringstream () |
| |
| template<typename _ValueT > |
| basic_istream< _CharT, _Traits > & | _M_extract (_ValueT &__v) |
| |
| const locale & | _M_getloc () const |
| |
| template<typename _ValueT > |
| basic_ostream< _CharT, _Traits > & | _M_insert (_ValueT __v) |
| |
| void | _M_setstate (iostate __state) |
| |
| bool | bad () const |
| |
| void | clear (iostate __state=goodbit) |
| |
| basic_ios & | copyfmt (const basic_ios &__rhs) |
| |
| bool | eof () const |
| |
| iostate | exceptions () const |
| |
| void | exceptions (iostate __except) |
| |
| bool | fail () const |
| |
| char_type | fill () const |
| |
| char_type | fill (char_type __ch) |
| |
| fmtflags | flags () const |
| |
| fmtflags | flags (fmtflags __fmtfl) |
| |
| basic_istream< char > & | getline (char_type *__s, streamsize __n, char_type __delim) |
| |
|
basic_istream< wchar_t > & | getline (char_type *__s, streamsize __n, char_type __delim) |
| |
| locale | getloc () const |
| |
| bool | good () const |
| |
|
basic_istream< char > & | ignore (streamsize __n) |
| |
|
basic_istream< wchar_t > & | ignore (streamsize __n) |
| |
|
basic_istream< char > & | ignore (streamsize __n, int_type __delim) |
| |
|
basic_istream< wchar_t > & | ignore (streamsize __n, int_type __delim) |
| |
| locale | imbue (const locale &__loc) |
| |
| long & | iword (int __ix) |
| |
| char | narrow (char_type __c, char __dfault) const |
| |
| | operator bool () const |
| |
| bool | operator! () const |
| |
| __ostream_type & | operator<< (__ios_type &(*__pf)(__ios_type &)) |
| |
| __ostream_type & | operator<< (__ostream_type &(*__pf)(__ostream_type &)) |
| |
| __ostream_type & | operator<< (ios_base &(*__pf)(ios_base &)) |
| |
| basic_stringstream & | operator= (basic_stringstream &&__rhs) |
| |
|
basic_stringstream & | operator= (const basic_stringstream &)=delete |
| |
| __istream_type & | operator>> (__ios_type &(*__pf)(__ios_type &)) |
| |
| __istream_type & | operator>> (__istream_type &(*__pf)(__istream_type &)) |
| |
| __istream_type & | operator>> (ios_base &(*__pf)(ios_base &)) |
| |
| streamsize | precision () const |
| |
| streamsize | precision (streamsize __prec) |
| |
| void *& | pword (int __ix) |
| |
| __stringbuf_type * | rdbuf () const |
| |
| basic_streambuf< _CharT, _Traits > * | rdbuf (basic_streambuf< _CharT, _Traits > *__sb) |
| |
| iostate | rdstate () const |
| |
| void | register_callback (event_callback __fn, int __index) |
| |
| fmtflags | setf (fmtflags __fmtfl) |
| |
| fmtflags | setf (fmtflags __fmtfl, fmtflags __mask) |
| |
| void | setstate (iostate __state) |
| |
| __string_type | str () const |
| |
| void | str (const __string_type &__s) |
| |
| void | swap (basic_stringstream &__rhs) |
| |
| basic_ostream< _CharT, _Traits > * | tie () const |
| |
| basic_ostream< _CharT, _Traits > * | tie (basic_ostream< _CharT, _Traits > *__tiestr) |
| |
| void | unsetf (fmtflags __mask) |
| |
| char_type | widen (char __c) const |
| |
| streamsize | width () const |
| |
| streamsize | width (streamsize __wide) |
| |
|
All the operator>> functions (aka formatted input functions) have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to false. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
|
| __istream_type & | operator>> (bool &__n) |
| |
| __istream_type & | operator>> (short &__n) |
| |
| __istream_type & | operator>> (unsigned short &__n) |
| |
| __istream_type & | operator>> (int &__n) |
| |
| __istream_type & | operator>> (unsigned int &__n) |
| |
| __istream_type & | operator>> (long &__n) |
| |
| __istream_type & | operator>> (unsigned long &__n) |
| |
| __istream_type & | operator>> (long long &__n) |
| |
| __istream_type & | operator>> (unsigned long long &__n) |
| |
| __istream_type & | operator>> (float &__f) |
| |
| __istream_type & | operator>> (double &__f) |
| |
| __istream_type & | operator>> (long double &__f) |
| |
| __istream_type & | operator>> (void *&__p) |
| |
| __istream_type & | operator>> (__streambuf_type *__sb) |
| |
| streamsize | gcount () const |
| |
|
All the operator<< functions (aka formatted output functions) have some common behavior. Each starts by constructing a temporary object of type std::basic_ostream::sentry. This can have several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to generate whatever data is appropriate for the type of the argument.
If an exception is thrown during insertion, ios_base::badbit will be turned on in the stream's error state without causing an ios_base::failure to be thrown. The original exception will then be rethrown.
|
| __ostream_type & | operator<< (long __n) |
| |
| __ostream_type & | operator<< (unsigned long __n) |
| |
| __ostream_type & | operator<< (bool __n) |
| |
| __ostream_type & | operator<< (short __n) |
| |
| __ostream_type & | operator<< (unsigned short __n) |
| |
| __ostream_type & | operator<< (int __n) |
| |
| __ostream_type & | operator<< (unsigned int __n) |
| |
| __ostream_type & | operator<< (long long __n) |
| |
| __ostream_type & | operator<< (unsigned long long __n) |
| |
| __ostream_type & | operator<< (double __f) |
| |
| __ostream_type & | operator<< (float __f) |
| |
| __ostream_type & | operator<< (long double __f) |
| |
| __ostream_type & | operator<< (const void *__p) |
| |
| __ostream_type & | operator<< (__streambuf_type *__sb) |
| |
|
All the unformatted input functions have some common behavior. Each starts by constructing a temporary object of type std::basic_istream::sentry with the second argument (noskipws) set to true. This has several effects, concluding with the setting of a status flag; see the sentry documentation for more.
If the sentry status is good, the function tries to extract whatever data is appropriate for the type of the argument.
The number of characters extracted is stored for later retrieval by gcount().
If an exception is thrown during extraction, ios_base::badbit will be turned on in the stream's error state (without causing an ios_base::failure to be thrown) and the original exception will be rethrown if badbit is set in the exceptions mask.
|
| int_type | get () |
| |
| __istream_type & | get (char_type &__c) |
| |
| __istream_type & | get (char_type *__s, streamsize __n, char_type __delim) |
| |
| __istream_type & | get (char_type *__s, streamsize __n) |
| |
| __istream_type & | get (__streambuf_type &__sb, char_type __delim) |
| |
| __istream_type & | get (__streambuf_type &__sb) |
| |
| __istream_type & | getline (char_type *__s, streamsize __n, char_type __delim) |
| |
| __istream_type & | getline (char_type *__s, streamsize __n) |
| |
| __istream_type & | ignore (streamsize __n, int_type __delim) |
| |
| __istream_type & | ignore (streamsize __n) |
| |
| __istream_type & | ignore () |
| |
| int_type | peek () |
| |
| __istream_type & | read (char_type *__s, streamsize __n) |
| |
| streamsize | readsome (char_type *__s, streamsize __n) |
| |
| __istream_type & | putback (char_type __c) |
| |
| __istream_type & | unget () |
| |
| int | sync () |
| |
| pos_type | tellg () |
| |
| __istream_type & | seekg (pos_type) |
| |
| __istream_type & | seekg (off_type, ios_base::seekdir) |
| |
| void | swap (basic_istream &__rhs) |
| |
| template<typename _ValueT > |
| __istream_type & | _M_extract (_ValueT &__v) |
| |
template<typename _CharT, typename _Traits, typename _Alloc>
class std::basic_stringstream< _CharT, _Traits, _Alloc >
Controlling input and output for std::string.
- Template Parameters
-
| _CharT | Type of character stream. |
| _Traits | Traits for character type, defaults to char_traits<_CharT>. |
| _Alloc | Allocator type, defaults to allocator<_CharT>. |
This class supports reading from and writing to objects of type std::basic_string, using the inherited functions from std::basic_iostream. To control the associated sequence, an instance of std::basic_stringbuf is used, which this page refers to as sb.
Definition at line 708 of file sstream.
template<typename _CharT , typename _Traits , typename _Alloc >
Default constructor starts with an empty string buffer.
Initializes sb using the mode in|out, and passes &sb to the base class initializer. Does not allocate any buffer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management.
Definition at line 741 of file sstream.
template<typename _CharT , typename _Traits , typename _Alloc >
Starts with an empty string buffer.
- Parameters
-
| __m | Whether the buffer can read, or write, or both. |
Initializes sb using the mode from __m, and passes &sb to the base class initializer. Does not allocate any buffer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management.
Definition at line 756 of file sstream.
template<typename _CharT , typename _Traits , typename _Alloc >
Starts with an existing string buffer.
- Parameters
-
| __str | A string to copy as a starting buffer. |
| __m | Whether the buffer can read, or write, or both. |
Initializes sb using __str and __m, and passes &sb to the base class initializer.
That's a lie. We initialize the base class with NULL, because the string class does its own memory management.
Definition at line 772 of file sstream.
template<typename _CharT , typename _Traits >
Copies fields of __rhs into this.
- Parameters
-
| __rhs | The source values for the copies. |
- Returns
- Reference to this object.
All fields of __rhs are copied into this object except that rdbuf() and rdstate() remain unchanged. All values in the pword and iword arrays are copied. Before copying, each callback is invoked with erase_event. After copying, each (new) callback is invoked with copyfmt_event. The final step is to copy exceptions().
Definition at line 63 of file basic_ios.tcc.
References std::basic_ios< _CharT, _Traits >::exceptions(), std::basic_ios< _CharT, _Traits >::fill(), std::ios_base::flags(), std::ios_base::getloc(), std::ios_base::precision(), std::basic_ios< _CharT, _Traits >::tie(), std::tie(), and std::ios_base::width().
template<typename _CharT , typename _Traits >
Throwing exceptions on errors.
- Parameters
-
| __except | The new exceptions mask. |
By default, error flags are set silently. You can set an exceptions mask for each stream; if a bit in the mask becomes set in the error flags, then an exception of type std::ios_base::failure is thrown.
If the error flag is already set when the exceptions mask is added, the exception is immediately thrown. Try running the following under GCC 3.1 or later:
#include <iostream>
#include <fstream>
#include <exception>
int main()
{
std::set_terminate (__gnu_cxx::__verbose_terminate_handler);
std::ifstream f ("/etc/motd");
std::cerr << "Setting badbit\n";
f.setstate (std::ios_base::badbit);
std::cerr << "Setting exception mask\n";
f.exceptions (std::ios_base::badbit);
}
Definition at line 257 of file basic_ios.h.
References std::basic_ios< _CharT, _Traits >::clear().
template<typename _CharT , typename _Traits >
Sets a new empty character.
- Parameters
-
- Returns
- The previous fill character.
The fill character is used to fill out space when P+ characters have been requested (e.g., via setw), Q characters are actually used, and Q<P. It defaults to a space (' ') in the current locale.
Definition at line 390 of file basic_ios.h.
References std::basic_ios< _CharT, _Traits >::fill().
template<typename _CharT , typename _Traits >
Synchronizing the stream buffer.
- Returns
- *this
If rdbuf() is a null pointer, changes nothing.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit.
Definition at line 210 of file ostream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Extraction into another streambuf.
- Parameters
-
| __sb | A streambuf in which to store data. |
| __delim | A "stop" character. |
- Returns
- *this
Characters are extracted and inserted into __sb until one of the following happens:
- the input sequence reaches EOF
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted)
- the next character equals __delim (in this case, the character is not extracted)
- an exception occurs (and in this case is caught)
If no characters are stored, failbit is set in the stream's error state.
Definition at line 363 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Simple multiple-character extraction.
- Parameters
-
| __s | Pointer to an array. |
| __n | Maximum number of characters to store in __s. |
| __delim | A "stop" character. |
- Returns
- *this
Characters are extracted and stored into __s until one of the following happens:
__n-1 characters are stored
- the input sequence reaches EOF
- the next character equals __delim, in which case the character is not extracted
If no characters are stored, failbit is set in the stream's error state.
In any case, a null character is stored into the next location in the array.
- Note
- This function is not overloaded on signed char and unsigned char.
Definition at line 316 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
String extraction.
- Parameters
-
| __s | A character array in which to store the data. |
| __n | Maximum number of characters to extract. |
| __delim | A "stop" character. |
- Returns
- *this
Extracts and stores characters into __s until one of the following happens. Note that these criteria are required to be tested in the order listed here, to allow an input line to exactly fill the __s array without setting failbit.
- the input sequence reaches end-of-file, in which case eofbit is set in the stream error state
- the next character equals
__delim, in which case the character is extracted (and therefore counted in gcount()) but not stored
__n-1 characters are stored, in which case failbit is set in the stream error state
If no characters are extracted, failbit is set. (An empty line of input should therefore not cause failbit to be set.)
In any case, a null character is stored in the next location in the array.
Definition at line 407 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Discarding characters.
- Parameters
-
| __n | Number of characters to discard. |
| __delim | A "stop" character. |
- Returns
- *this
Extracts characters and throws them away until one of the following happens:
- if __n
!= std::numeric_limits<int>::max(), __n characters are extracted
- the input sequence reaches end-of-file
- the next character equals __delim (in this case, the character is extracted); note that this condition will never occur if __delim equals
traits::eof().
NB: Provide three overloads, instead of the single function (with defaults) mandated by the Standard: this leads to a better performing implementation, while still conforming to the Standard.
Definition at line 562 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
| long & std::ios_base::iword |
( |
int |
__ix | ) |
|
|
inlineinherited |
Access to integer array.
- Parameters
-
| __ix | Index into the array. |
- Returns
- A reference to an integer associated with the index.
The iword function provides access to an array of integers that can be used for any purpose. The array grows as required to hold the supplied index. All integers in the array are initialized to 0.
The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference.
Definition at line 816 of file ios_base.h.
template<typename _CharT , typename _Traits >
Extracting from another streambuf.
- Parameters
-
| __sb | A pointer to a streambuf |
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If __sb is NULL, the stream will set failbit in its error state.
Characters are extracted from __sb and inserted into *this until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output sequence fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs while getting a character from
__sb, which sets failbit in the error state
If the function inserts no characters, failbit is set.
Definition at line 63 of file ostream.tcc.
template<typename _CharT , typename _Traits >
Integer arithmetic inserters.
- Parameters
-
| __n | A variable of builtin integral type. |
- Returns
*this if successful
These functions use the stream's current locale (specifically, the num_get facet) to perform numeric formatting.
Definition at line 63 of file ostream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Extracting into another streambuf.
- Parameters
-
| __sb | A pointer to a streambuf |
This function behaves like one of the basic arithmetic extractors, in that it also constructs a sentry object and has the same error handling behavior.
If __sb is NULL, the stream will set failbit in its error state.
Characters are extracted from this stream and inserted into the __sb streambuf until one of the following occurs:
- the input stream reaches end-of-file,
- insertion into the output buffer fails (in this case, the character that would have been inserted is not extracted), or
- an exception occurs (and in this case is caught)
If the function inserts no characters, failbit is set.
Definition at line 211 of file istream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Integer arithmetic extractors.
- Parameters
-
| __n | A variable of builtin integral type. |
- Returns
*this if successful
These functions use the stream's current locale (specifically, the num_get facet) to parse the input data.
Definition at line 121 of file istream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
template<typename _CharT , typename _Traits >
Unextracting a single character.
- Parameters
-
| __c | The character to push back into the input stream. |
- Returns
- *this
If rdbuf() is not null, calls rdbuf()->sputbackc(c).
If rdbuf() is null or if sputbackc() fails, sets badbit in the error state.
- Note
- This function first clears eofbit. Since no characters are extracted, the next call to
gcount() will return 0, as required by DR 60.
Definition at line 718 of file istream.tcc.
| void *& std::ios_base::pword |
( |
int |
__ix | ) |
|
|
inlineinherited |
Access to void pointer array.
- Parameters
-
| __ix | Index into the array. |
- Returns
- A reference to a void* associated with the index.
The pword function provides access to an array of pointers that can be used for any purpose. The array grows as required to hold the supplied index. All pointers in the array are initialized to 0.
The implementation reserves several indices. You should use xalloc to obtain an index that is safe to use. Also note that since the array can grow dynamically, it is not safe to hold onto the reference.
Definition at line 837 of file ios_base.h.
template<typename _CharT , typename _Traits >
Changing the underlying buffer.
- Parameters
-
| __sb | The new stream buffer. |
- Returns
- The previous stream buffer.
Associates a new buffer with the current stream, and clears the error state.
Due to historical accidents which the LWG refuses to correct, the I/O library suffers from a design error: this function is hidden in derived classes by overrides of the zero-argument rdbuf(), which is non-virtual for hysterical raisins. As a result, you must use explicit qualifications to access this function via any derived class. For example:
std::fstream foo; // or some other derived type
std::streambuf* p = .....;
foo.ios::rdbuf(p); // ios == basic_ios<char>
Definition at line 53 of file basic_ios.tcc.
template<typename _CharT , typename _Traits >
Returns the error state of the stream buffer.
- Returns
- A bit pattern (well, isn't everything?)
See std::ios_base::iostate for the possible bit values. Most users will call one of the interpreting wrappers, e.g., good().
Definition at line 137 of file basic_ios.h.
Referenced by std::basic_ios< _CharT, _Traits >::bad(), std::basic_ios< _CharT, _Traits >::eof(), std::basic_ios< _CharT, _Traits >::fail(), std::basic_ios< _CharT, _Traits >::good(), std::basic_istream< _CharT, _Traits >::seekg(), std::basic_ios< _CharT, _Traits >::setstate(), and std::basic_istream< _CharT, _Traits >::unget().
template<typename _CharT , typename _Traits >
Extraction without delimiters.
- Parameters
-
| __s | A character array. |
| __n | Maximum number of characters to store. |
- Returns
- *this
If the stream state is good(), extracts characters and stores them into __s until one of the following happens:
- __n characters are stored
- the input sequence reaches end-of-file, in which case the error state is set to
failbit|eofbit.
- Note
- This function is not overloaded on signed char and unsigned char.
Definition at line 657 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Extraction until the buffer is exhausted, but no more.
- Parameters
-
| __s | A character array. |
| __n | Maximum number of characters to store. |
- Returns
- The number of characters extracted.
Extracts characters and stores them into __s depending on the number of characters remaining in the streambuf's buffer, rdbuf()->in_avail(), called A here:
- if
A == -1, sets eofbit and extracts no characters
- if
A == 0, extracts no characters
- if
A > 0, extracts min(A,n)
The goal is to empty the current buffer, and to not request any more from the external input sequence controlled by the streambuf.
Definition at line 686 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, and std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Changing the current read position.
- Parameters
-
| __off | A file offset object. |
| __dir | The direction in which to seek. |
- Returns
- *this
If fail() is not true, calls rdbuf()->pubseekoff(__off,__dir). If that function fails, sets failbit.
- Note
- This function first clears eofbit. It does not count the number of characters extracted, if any, and therefore does not affect the next call to
gcount().
Definition at line 891 of file istream.tcc.
References std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdstate().
template<typename _CharT , typename _Traits >
template<typename _CharT , typename _Traits >
Changing the current write position.
- Parameters
-
| __off | A file offset object. |
| __dir | The direction in which to seek. |
- Returns
- *this
If fail() is not true, calls rdbuf()->pubseekoff(off,dir). If that function fails, sets failbit.
Definition at line 289 of file ostream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Changing the current write position.
- Parameters
-
| __pos | A file position object. |
- Returns
- *this
If fail() is not true, calls rdbuf()->pubseekpos(pos). If that function fails, sets failbit.
Definition at line 257 of file ostream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Synchronizing the stream buffer.
- Returns
- 0 on success, -1 on failure
If rdbuf() is a null pointer, returns -1.
Otherwise, calls rdbuf()->pubsync(), and if that returns -1, sets badbit and returns -1.
Otherwise, returns 0.
- Note
- This function does not count the number of characters extracted, if any, and therefore does not affect the next call to
gcount().
Definition at line 788 of file istream.tcc.
References std::ios_base::goodbit.
template<typename _CharT , typename _Traits >
Getting the current read position.
- Returns
- A file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
- Note
- This function does not count the number of characters extracted, if any, and therefore does not affect the next call to
gcount(). At variance with putback, unget and seekg, eofbit is not cleared first.
Definition at line 824 of file istream.tcc.
template<typename _CharT , typename _Traits >
Getting the current write position.
- Returns
- A file position object.
If fail() is not false, returns pos_type(-1) to indicate failure. Otherwise returns rdbuf()->pubseekoff(0,cur,out).
Definition at line 236 of file ostream.tcc.
template<typename _CharT , typename _Traits >
template<typename _CharT , typename _Traits >
Unextracting the previous character.
- Returns
- *this
If rdbuf() is not null, calls rdbuf()->sungetc(c).
If rdbuf() is null or if sungetc() fails, sets badbit in the error state.
- Note
- This function first clears eofbit. Since no characters are extracted, the next call to
gcount() will return 0, as required by DR 60.
Definition at line 753 of file istream.tcc.
References std::basic_istream< _CharT, _Traits >::_M_gcount, std::basic_ios< _CharT, _Traits >::clear(), std::ios_base::eofbit, std::ios_base::goodbit, and std::basic_ios< _CharT, _Traits >::rdstate().
Referenced by std::__detail::operator>>().
| static int std::ios_base::xalloc |
( |
| ) |
|
| throw | ( | |
| ) | | |
|
staticinherited |
Access to unique indices.
- Returns
- An integer different from all previous calls.
This function returns a unique integer every time it is called. It can be used for any purpose, but is primarily intended to be a unique index for the iword and pword functions. The expectation is that an application calls xalloc in order to obtain an index in the iword and pword arrays that can be used without fear of conflict.
The implementation maintains a static variable that is incremented and returned on each invocation. xalloc is guaranteed to return an index that is safe to use in the iword and pword arrays.