This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Default buffer size of class basic_filebuf
- From: "Weber, Peter (Wilken GmbH)" <peter dot weber at wilken dot de>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 27 Apr 2012 14:00:54 +0000
- Subject: Re: Default buffer size of class basic_filebuf
- References: <1335527132.1822.33.camel@ws-lnx-pew>
Thanks for your answer, seems I figured it out. I always thought I can't
be in the file fstream and fstream.tcc -> but exactly there is
everything I want to know.
// from fstream
#include <istream>
#include <ostream>
#include <bits/codecvt.h>
#include <cstdio> // For BUFSIZ
...
...
...
/**
* Actual size of internal buffer. This number is equal to the
size
* of the put area + 1 position, reserved for the overflow char
of
* a full area.
*/
size_t _M_buf_size;
// from fstream
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::
basic_filebuf() : __streambuf_type(), _M_lock(), _M_file(&_M_lock),
_M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(),
_M_state_last(), _M_buf(0), _M_buf_size(BUFSIZ),
_M_buf_allocated(false), _M_reading(false), _M_writing(false),
_M_pback(),
_M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
_M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0),
_M_ext_end(0)
{
if (has_facet<__codecvt_type>(this->_M_buf_locale))
_M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
}
Thanks for your patience. Anything I should keep in mind?
Bye