libstdc++
|
class enc_filebuf.
Definition at line 42 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 48 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 46 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 failureIf no file is currently open, this function immediately fails.
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 & | __loc | ) | [protected, virtual, inherited] |
Changes translations.
__loc | A new locale. |
Translations done during I/O which depend on the current locale are changed by this call. The standard adds, Between invocations of this function a class derived from streambuf can safely cache results of calls to locale functions and to members of facets so obtained.
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 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 failureIf a file is already open, this function immediately fails. Otherwise it tries to open the file named __s using the flags given in mode.
Table 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 | +---------------------------------------------------------+
__filebuf_type* std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::open | ( | const std::string & | __s, |
ios_base::openmode | __mode | ||
) | [inline, inherited] |
virtual int_type std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::overflow | ( | int_type | __c = _Traits::eof() | ) | [protected, virtual, inherited] |
Consumes data from the buffer; writes to the controlled sequence.
__c | An additional character to consume. |
Informally, this function is called when the output buffer is full (or does not exist, as buffering need not actually be done). If a buffer exists, it is consumed, with some effect on the controlled sequence. (Typically, the buffer is written out to the sequence verbatim.) In either case, the character c is also written out, if __c is not 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 | __c = _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
If no file has been opened, and both __s and __n are zero, then the stream becomes unbuffered. Otherwise, __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.
If it returns a positive value, then successive calls to 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
eof()
but that they will return immediately. 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. |
Similar to sungetc(), but __c is pushed onto the stream instead of the previous character. If successful, the next character fetched from the input stream will be __c.
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. |
One of two public output functions.
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] |
int_type std::basic_streambuf< _CharT, encoding_char_traits< _CharT > >::sungetc | ( | ) | [inline, inherited] |
Moving backwards in the input stream.
If a putback position is available, this function decrements the input pointer and returns that character. Otherwise, calls and returns pbackfail(). The effect is to unget the last character gotten.
virtual int std::basic_filebuf< _CharT, encoding_char_traits< _CharT > >::sync | ( | void | ) | [protected, virtual, inherited] |
Synchronizes the buffer arrays with the controlled sequences.
Each derived class provides its own appropriate behavior, including the definition of failure.
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.
Informally, this function does the same thing as 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.
Informally, this function is called when the input buffer is exhausted (or does not exist, as buffering need not actually be done). If a buffer exists, it is refilled. In either case, the next available character is returned, or 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. |
Fills __s[0] through __s[__n-1] with characters from the input sequence, as if by 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. |
Writes __s[0] through __s[__n-1] to the output sequence, as if by 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] |