29 #ifndef _STDIO_FILEBUF_H
30 #define _STDIO_FILEBUF_H 1
32 #pragma GCC system_header
38 _GLIBCXX_BEGIN_NAMESPACE_VERSION
49 template<
typename _CharT,
typename _Traits = std::
char_traits<_CharT> >
50 class stdio_filebuf :
public std::basic_filebuf<_CharT, _Traits>
54 typedef _CharT char_type;
55 typedef _Traits traits_type;
56 typedef typename traits_type::int_type int_type;
57 typedef typename traits_type::pos_type pos_type;
58 typedef typename traits_type::off_type off_type;
65 stdio_filebuf() : std::basic_filebuf<_CharT, _Traits>() {}
77 stdio_filebuf(
int __fd, std::ios_base::openmode __mode,
78 size_t __size = static_cast<size_t>(BUFSIZ));
90 stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
91 size_t __size = static_cast<size_t>(BUFSIZ));
109 fd() {
return this->_M_file.fd(); }
119 file() {
return this->_M_file.file(); }
122 template<
typename _CharT,
typename _Traits>
123 stdio_filebuf<_CharT, _Traits>::~stdio_filebuf()
126 template<
typename _CharT,
typename _Traits>
127 stdio_filebuf<_CharT, _Traits>::
128 stdio_filebuf(
int __fd, std::ios_base::openmode __mode,
size_t __size)
130 this->_M_file.sys_open(__fd, __mode);
133 this->_M_mode = __mode;
134 this->_M_buf_size =
__size;
135 this->_M_allocate_internal_buffer();
136 this->_M_reading =
false;
137 this->_M_writing =
false;
138 this->_M_set_buffer(-1);
142 template<
typename _CharT,
typename _Traits>
143 stdio_filebuf<_CharT, _Traits>::
144 stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
147 this->_M_file.sys_open(__f, __mode);
150 this->_M_mode = __mode;
151 this->_M_buf_size =
__size;
152 this->_M_allocate_internal_buffer();
153 this->_M_reading =
false;
154 this->_M_writing =
false;
155 this->_M_set_buffer(-1);
159 _GLIBCXX_END_NAMESPACE_VERSION
std::size_t __size(__stack_t __stack)
Definition: profiler_node.h:68
namespace std _GLIBCXX_VISIBILITY(default)
Definition: auto_ptr.h:36
__SIZE_TYPE__ size_t
Definition: stddef.h:212