Definition at line 40 of file enc_filebuf.h.
typedef basic_streambuf<char_type, traits_type> std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::__streambuf_type [inherited] |
This is a non-standard type.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
typedef _CharT std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::char_type [inherited] |
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
typedef traits_type::int_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::int_type [inherited] |
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
typedef traits_type::off_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::off_type [inherited] |
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
typedef traits_type::pos_type __gnu_cxx::enc_filebuf< _CharT >::pos_type |
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.
Reimplemented from std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >.
Definition at line 46 of file enc_filebuf.h.
typedef encoding_char_traits<_CharT> __gnu_cxx::enc_filebuf< _CharT >::traits_type |
These are standard types. They permit a standardized way of referring to names of (or names dependant on) the template parameters, which are specific to the implementation.
Reimplemented from std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >.
Definition at line 44 of file enc_filebuf.h.
void std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_create_pback | ( | ) | [inline, protected, inherited] |
void std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_destroy_pback | ( | ) | throw () [inline, protected, inherited] |
void std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_set_buffer | ( | streamsize | __off | ) | [inline, protected, inherited] |
This function sets the pointers of the internal buffer, both get and put areas. Typically:
__off == egptr() - eback() upon underflow/uflow ('read' mode); __off == 0 upon overflow ('write' mode); __off == -1 upon open, setbuf, seekoff/pos ('uncommitted' mode).
NB: epptr() - pbase() == _M_buf_size - 1, since _M_buf_size reflects the actual allocated memory and the last cell is reserved for the overflow char of a full put area.
__filebuf_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::close | ( | ) | [inherited] |
Closes the currently associated file.
this
on success, NULL on failure
If a "put buffer area" exists, overflow(eof)
is called to flush all the characters. The file is then closed.
If any operations fail, this function also fails.
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::eback | ( | ) | const [inline, protected, inherited] |
Access to the get area.
These functions are only available to other protected functions, including derived classes.
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::egptr | ( | ) | const [inline, protected, inherited] |
Access to the get area.
These functions are only available to other protected functions, including derived classes.
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::epptr | ( | ) | const [inline, protected, inherited] |
Access to the put area.
These functions are only available to other protected functions, including derived classes.
void std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::gbump | ( | int | __n | ) | [inline, protected, inherited] |
locale std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::getloc | ( | ) | const [inline, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::gptr | ( | ) | const [inline, protected, inherited] |
Access to the get area.
These functions are only available to other protected functions, including derived classes.
virtual void std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::imbue | ( | const locale & | ) | [protected, virtual, inherited] |
Changes translations.
loc | A new locale. |
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
streamsize std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::in_avail | ( | ) | [inline, inherited] |
bool std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::is_open | ( | ) | const throw () [inline, inherited] |
__filebuf_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::open | ( | const std::string & | __s, | |
ios_base::openmode | __mode | |||
) | [inline, inherited] |
Opens an external file.
s | The name of the file. | |
mode | The open mode flags. |
this
on success, NULL on failure Definition at line 275 of file fstream.
References std::basic_string< _CharT, _Traits, _Alloc >::c_str(), and std::basic_filebuf< _CharT, _Traits >::open().
__filebuf_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::open | ( | const char * | __s, | |
ios_base::openmode | __mode | |||
) | [inherited] |
Opens an external file.
s | The name of the file. | |
mode | The open mode flags. |
this
on success, NULL on failureTable 92, adapted here, gives the relation between openmode combinations and the equivalent fopen() flags. (NB: lines app, in|out|app, in|app, binary|app, binary|in|out|app, and binary|in|app per DR 596) +---------------------------------------------------------+ | ios_base Flag combination stdio equivalent | |binary in out trunc app | +---------------------------------------------------------+ | + "w" | | + + "a" | | + "a" | | + + "w" | | + "r" | | + + "r+" | | + + + "w+" | | + + + "a+" | | + + "a+" | +---------------------------------------------------------+ | + + "wb" | | + + + "ab" | | + + "ab" | | + + + "wb" | | + + "rb" | | + + + "r+b" | | + + + + "w+b" | | + + + + "a+b" | | + + + "a+b" | +---------------------------------------------------------+
virtual int_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::overflow | ( | int_type | = _Traits::eof() |
) | [protected, virtual, inherited] |
Consumes data from the buffer; writes to the controlled sequence.
c | An additional character to consume. |
eof()
.For a formal definition of this function, see a good text such as Langer & Kreft, or [27.5.2.4.5]/3-7.
A functioning output streambuf can be created by overriding only this function (no buffer area will be used).
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
virtual int_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::pbackfail | ( | int_type | = _Traits::eof() |
) | [protected, virtual, inherited] |
Tries to back up the input sequence.
c | The character to be inserted back into the sequence. |
gptr()
, eback()
, and pptr()
are the same as for underflow()
.Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pbase | ( | ) | const [inline, protected, inherited] |
Access to the put area.
These functions are only available to other protected functions, including derived classes.
void std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pbump | ( | int | __n | ) | [inline, protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pptr | ( | ) | const [inline, protected, inherited] |
Access to the put area.
These functions are only available to other protected functions, including derived classes.
locale std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pubimbue | ( | const locale & | __loc | ) | [inline, inherited] |
pos_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pubseekoff | ( | off_type | __off, | |
ios_base::seekdir | __way, | |||
ios_base::openmode | __mode = ios_base::in | ios_base::out | |||
) | [inline, inherited] |
pos_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pubseekpos | ( | pos_type | __sp, | |
ios_base::openmode | __mode = ios_base::in | ios_base::out | |||
) | [inline, inherited] |
__streambuf_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pubsetbuf | ( | char_type * | __s, | |
streamsize | __n | |||
) | [inline, inherited] |
int std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::pubsync | ( | ) | [inline, inherited] |
int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sbumpc | ( | ) | [inline, inherited] |
virtual pos_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::seekoff | ( | off_type | , | |
ios_base::seekdir | , | |||
ios_base::openmode | = ios_base::in | ios_base::out | |||
) | [protected, virtual, inherited] |
Alters the stream positions.
Each derived class provides its own appropriate behavior.
pos_type
that represents an invalid stream position. Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
virtual pos_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::seekpos | ( | pos_type | , | |
ios_base::openmode | = ios_base::in | ios_base::out | |||
) | [protected, virtual, inherited] |
Alters the stream positions.
Each derived class provides its own appropriate behavior.
pos_type
that represents an invalid stream position. Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
virtual __streambuf_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::setbuf | ( | char_type * | __s, | |
streamsize | __n | |||
) | [protected, virtual, inherited] |
Manipulates the buffer.
s | Pointer to a buffer area. | |
n | Size of s. |
this
s
is used as a buffer; see http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25s02.html for more.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
void std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::setg | ( | char_type * | __gbeg, | |
char_type * | __gnext, | |||
char_type * | __gend | |||
) | [inline, protected, inherited] |
void std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::setp | ( | char_type * | __pbeg, | |
char_type * | __pend | |||
) | [inline, protected, inherited] |
int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sgetc | ( | ) | [inline, inherited] |
streamsize std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sgetn | ( | char_type * | __s, | |
streamsize | __n | |||
) | [inline, inherited] |
virtual streamsize std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::showmanyc | ( | ) | [protected, virtual, inherited] |
Investigating the data available.
underflow()
will not return traits::eof()
until at least that number of characters have been supplied. If showmanyc()
returns -1, then calls to underflow()
or uflow()
will fail." [27.5.2.4.3]/1
The standard adds that "the intention is not only that the calls [to underflow or uflow] will not return eof()
but that they will return "immediately".
The standard adds that "the morphemes of showmanyc
are "es-how-many-see", not "show-manic".
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::snextc | ( | ) | [inline, inherited] |
int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sputbackc | ( | char_type | __c | ) | [inline, inherited] |
Pushing characters back into the input stream.
c | The character to push back. |
int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sputc | ( | char_type | __c | ) | [inline, inherited] |
Entry point for all single-character output functions.
c | A character to output. |
If a write position is available for the output sequence (i.e., the buffer is not full), stores c in that position, increments the position, and returns traits::to_int_type(c)
. If a write position is not available, returns overflow(c)
.
streamsize std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sputn | ( | const char_type * | __s, | |
streamsize | __n | |||
) | [inline, inherited] |
void std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::stossc | ( | ) | [inline, inherited] |
Tosses a character.
Advances the read pointer, ignoring the character that would have been read.
int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::sungetc | ( | ) | [inline, inherited] |
Moving backwards in the input stream.
virtual int std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::sync | ( | void | ) | [protected, virtual, inherited] |
Synchronizes the buffer arrays with the controlled sequences.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
virtual int_type std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::uflow | ( | ) | [inline, protected, virtual, inherited] |
Fetches more data from the controlled sequence.
underflow()
, and in fact is required to call that function. It also returns the new character, like underflow()
does. However, this function also moves the read position forward by one.
virtual int_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::underflow | ( | ) | [protected, virtual, inherited] |
Fetches more data from the controlled sequence.
traits::eof()
to indicate a null pending sequence.For a formal definition of the pending sequence, see a good text such as Langer & Kreft, or [27.5.2.4.3]/7-14.
A functioning input streambuf can be created by overriding only this function (no buffer area will be used). For an example, see http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt11ch25.html
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
virtual streamsize std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::xsgetn | ( | char_type * | __s, | |
streamsize | __n | |||
) | [protected, virtual, inherited] |
Multiple character extraction.
s | A buffer area. | |
n | Maximum number of characters to assign. |
sbumpc()
. Stops when either n characters have been copied, or when traits::eof()
would be copied.It is expected that derived classes provide a more efficient implementation by overriding this definition.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
virtual streamsize std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::xsputn | ( | const char_type * | __s, | |
streamsize | __n | |||
) | [protected, virtual, inherited] |
Multiple character insertion.
s | A buffer area. | |
n | Maximum number of characters to write. |
sputc()
. Stops when either n characters have been copied, or when sputc()
would return traits::eof()
.It is expected that derived classes provide a more efficient implementation by overriding this definition.
Reimplemented from std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >.
char_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_buf [protected, inherited] |
locale std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_buf_locale [protected, inherited] |
size_t std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_buf_size [protected, inherited] |
char* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_ext_buf [protected, inherited] |
streamsize std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_ext_buf_size [protected, inherited] |
const char* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_ext_next [protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_in_beg [protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_in_cur [protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_in_end [protected, inherited] |
ios_base::openmode std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_mode [protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_out_beg [protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_out_cur [protected, inherited] |
char_type* std::basic_streambuf< _CharT , encoding_char_traits< _CharT > >::_M_out_end [protected, inherited] |
char_type std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_pback [protected, inherited] |
char_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_pback_cur_save [protected, inherited] |
char_type* std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_pback_end_save [protected, inherited] |
bool std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_pback_init [protected, inherited] |
bool std::basic_filebuf< _CharT , encoding_char_traits< _CharT > >::_M_reading [protected, inherited] |