29 #ifndef _STDIO_FILEBUF_H
30 #define _STDIO_FILEBUF_H 1
32 #ifdef _GLIBCXX_SYSHDR
33 #pragma GCC system_header
40 namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
53 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT> >
58 typedef _CharT char_type;
59 typedef _Traits traits_type;
60 typedef typename traits_type::int_type int_type;
61 typedef typename traits_type::pos_type pos_type;
62 typedef typename traits_type::off_type off_type;
63 typedef std::size_t size_t;
82 size_t __size =
static_cast<size_t>(_GLIBCXX_BUFSIZ));
94 stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
95 size_t __size =
static_cast<size_t>(_GLIBCXX_BUFSIZ));
104 #if __cplusplus >= 201103L
122 fd() {
return this->_M_file.fd(); }
132 file() {
return this->_M_file.file(); }
135 template<
typename _CharT,
typename _Traits>
139 template<
typename _CharT,
typename _Traits>
141 stdio_filebuf(
int __fd, std::ios_base::openmode __mode,
size_t __size)
143 this->_M_file.sys_open(__fd, __mode);
146 this->_M_mode = __mode;
147 this->_M_buf_size = __size;
148 this->_M_allocate_internal_buffer();
149 this->_M_reading =
false;
150 this->_M_writing =
false;
151 this->_M_set_buffer(-1);
155 template<
typename _CharT,
typename _Traits>
157 stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
160 this->_M_file.sys_open(__f, __mode);
163 this->_M_mode = __mode;
164 this->_M_buf_size = __size;
165 this->_M_allocate_internal_buffer();
166 this->_M_reading =
false;
167 this->_M_writing =
false;
168 this->_M_set_buffer(-1);
172 _GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
GNU extensions for public use.
The actual work of input and output (for files).
basic_filebuf()
Does not open any files.
Provides a layer of compatibility for C/POSIX.