ReactOS 0.4.15-dev-8219-ge8b88cf
stdio_streambuf_base Class Reference

#include <stdio_streambuf.h>

Inheritance diagram for stdio_streambuf_base:
Collaboration diagram for stdio_streambuf_base:

Public Member Functions

 stdio_streambuf_base (FILE *)
 
 ~stdio_streambuf_base ()
 
- Public Member Functions inherited from basic_streambuf< char, char_traits< char > >
virtual ~basic_streambuf ()
 
char_type_M_eback () const
 
char_type_M_gptr () const
 
char_type_M_egptr () const
 
void _M_gbump (int __n)
 
void _M_setg (char_type *__gbegin, char_type *__gnext, char_type *__gend)
 
basic_streambuf< char, char_traits< char > > * pubsetbuf (char_type *__s, streamsize __n)
 
pos_type pubseekoff (off_type __offset, ios_base::seekdir __way, ios_base::openmode __mod=ios_base::in|ios_base::out)
 
pos_type pubseekpos (pos_type __sp, ios_base::openmode __mod=ios_base::in|ios_base::out)
 
int pubsync ()
 
int_type sputc (char_type __c)
 
streamsize sputn (const char_type *__s, streamsize __n)
 
streamsize _M_sputnc (char_type __c, streamsize __n)
 
streamsize in_avail ()
 
int_type snextc ()
 
int_type sbumpc ()
 
int_type sgetc ()
 
streamsize sgetn (char_type *__s, streamsize __n)
 
int_type sputbackc (char_type __c)
 
int_type sungetc ()
 
locale pubimbue (const locale &)
 
locale getloc () const
 
void stossc ()
 

Protected Member Functions

streambufsetbuf (char *, streamsize)
 
pos_type seekoff (off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
 
pos_type seekpos (pos_type, ios_base::openmode=ios_base::in|ios_base::out)
 
int sync ()
 
- Protected Member Functions inherited from basic_streambuf< char, char_traits< char > >
 basic_streambuf ()
 
char_typeeback () const
 
char_typegptr () const
 
char_typeegptr () const
 
void gbump (int __n)
 
void setg (char_type *__gbegin, char_type *__gnext, char_type *__gend)
 
char_typepbase () const
 
char_typepptr () const
 
char_typeepptr () const
 
void pbump (int __n)
 
void setp (char_type *__pbegin, char_type *__pend)
 
virtual basic_streambuf< char, char_traits< char > > * setbuf (char_type *, streamsize)
 
virtual pos_type seekoff (off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
 
virtual pos_type seekpos (pos_type, ios_base::openmode=ios_base::in|ios_base::out)
 
virtual int sync ()
 
virtual streamsize showmanyc ()
 
virtual streamsize xsgetn (char_type *__s, streamsize __n)
 
virtual int_type underflow ()
 
virtual int_type uflow ()
 
virtual int_type pbackfail (int_type=traits_type::eof())
 
virtual streamsize xsputn (const char_type *__s, streamsize __n)
 
virtual streamsize _M_xsputnc (char_type __c, streamsize __n)
 
virtual int_type overflow (int_type=traits_type::eof())
 
virtual void imbue (const locale &)
 

Protected Attributes

FILE_M_file
 

Additional Inherited Members

- Public Types inherited from basic_streambuf< char, char_traits< char > >
typedef char char_type
 
typedef _Traits::int_type int_type
 
typedef _Traits::pos_type pos_type
 
typedef _Traits::off_type off_type
 
typedef char_traits< chartraits_type
 

Detailed Description

Definition at line 49 of file stdio_streambuf.h.

Constructor & Destructor Documentation

◆ stdio_streambuf_base()

stdio_streambuf_base::stdio_streambuf_base ( FILE file)

Definition at line 55 of file stdio_streambuf.cpp.

56 : /* _STLP_STD::FILE_basic_streambuf(file, 0), */
58{}
Definition: fci.c:127

◆ ~stdio_streambuf_base()

stdio_streambuf_base::~stdio_streambuf_base ( )

Definition at line 60 of file stdio_streambuf.cpp.

60 {
61 _STLP_VENDOR_CSTD::fflush(_M_file);
62}

Member Function Documentation

◆ seekoff()

stdio_streambuf_base::pos_type stdio_streambuf_base::seekoff ( off_type  off,
ios_base::seekdir  dir,
ios_base::openmode  = ios_base::in | ios_base::out 
)
protected

Definition at line 76 of file stdio_streambuf.cpp.

77 {
78 int whence;
79 switch (dir) {
80 case ios_base::beg:
81 whence = SEEK_SET;
82 break;
83 case ios_base::cur:
84 whence = SEEK_CUR;
85 break;
86 case ios_base::end:
87 whence = SEEK_END;
88 break;
89 default:
90 return pos_type(-1);
91 }
92
93 if (off <= numeric_limits<off_type>::max() && FSEEK(_M_file, off, whence) == 0) {
94 FPOS_T pos;
96 // added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
97 // of a primitive type
98#if (defined (__GLIBC__) && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2))))
99 return pos_type((streamoff)pos.__pos);
100#elif defined (__ISCPP__) || defined (__MVS__) || defined (__OS400__)
101 return pos_type(pos.__fpos_elem[ 0 ]);
102#elif defined (__EMX__)
103 return pos_type((streamoff)pos._pos);
104#else
105 return pos_type(pos);
106#endif
107 }
108 else
109 return pos_type(-1);
110}
unsigned int dir
Definition: maze.c:112
#define SEEK_END
Definition: cabinet.c:29
off_t streamoff
Definition: char_traits.h:74
#define FSEEK
#define SEEK_SET
Definition: jmemansi.c:26
#define SEEK_CUR
Definition: util.h:63
#define FGETPOS
#define FPOS_T

◆ seekpos()

stdio_streambuf_base::pos_type stdio_streambuf_base::seekpos ( pos_type  pos,
ios_base::openmode  = ios_base::in | ios_base::out 
)
protected

Definition at line 114 of file stdio_streambuf.cpp.

114 {
115 // added 21 june 00 mdb,rjf,wjs: glibc 2.2 changed fpos_t to be a struct instead
116 // of a primitive type
117#if (defined(__GLIBC__) && ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 2) ) ) )
118 FPOS_T p;
119 p.__pos = pos;
120# ifdef _STLP_USE_UCLIBC
121# ifdef __STDIO_MBSTATE
122 memset( &(p.__mbstate), 0, sizeof(p.__mbstate) );
123# endif
124# ifdef __STDIO_WIDE
125 p.mblen_pending = 0;
126# endif
127# else
128 memset( &(p.__state), 0, sizeof(p.__state) );
129# endif
130#elif defined (__MVS__) || defined (__OS400__)
131 FPOS_T p;
132 p.__fpos_elem[0] = pos;
133#elif defined (__EMX__)
134 FPOS_T p;
135 p._pos = pos;
136 memset( &(p._mbstate), 0, sizeof(p._mbstate) );
137#else
138 FPOS_T p(pos);
139#endif
140
141 return FSETPOS(_M_file, &p) == 0 ? pos : pos_type(-1);
142}
GLfloat GLfloat p
Definition: glext.h:8902
#define memset(x, y, z)
Definition: compat.h:39
#define FSETPOS

◆ setbuf()

_STLP_STD::streambuf * stdio_streambuf_base::setbuf ( char s,
streamsize  n 
)
protected

Definition at line 64 of file stdio_streambuf.cpp.

64 {
65#ifdef _STLP_WCE
66 // no buffering in windows ce .NET
67#else
68 size_t __n_size_t = (sizeof(streamsize) > sizeof(size_t)) ? __STATIC_CAST(size_t, (min)(__STATIC_CAST(streamsize, (numeric_limits<size_t>::max)()), n))
69 : __STATIC_CAST(size_t, n);
70 _STLP_VENDOR_CSTD::setvbuf(_M_file, s, (s == 0 && n == 0) ? _IONBF : _IOFBF, __n_size_t);
71#endif
72 return this;
73}
ptrdiff_t streamsize
Definition: char_traits.h:81
#define __STATIC_CAST(__x, __y)
Definition: features.h:585
GLdouble s
Definition: gl.h:2039
GLdouble n
Definition: glext.h:7729
#define _IONBF
Definition: stdio.h:129
#define _IOFBF
Definition: stdio.h:127
#define min(a, b)
Definition: monoChain.cc:55

◆ sync()

int stdio_streambuf_base::sync ( )
protectedvirtual

Reimplemented from basic_streambuf< char, char_traits< char > >.

Definition at line 144 of file stdio_streambuf.cpp.

144 {
145 return _STLP_VENDOR_CSTD::fflush(_M_file) == 0 ? 0 : -1;
146}

Member Data Documentation

◆ _M_file


The documentation for this class was generated from the following files: