ReactOS  0.4.14-dev-297-g23e575c
stdio_streambuf.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999
3  * Silicon Graphics Computer Systems, Inc.
4  *
5  * Copyright (c) 1999
6  * Boris Fomitchev
7  *
8  * This material is provided "as is", with absolutely no warranty expressed
9  * or implied. Any use is at your own risk.
10  *
11  * Permission to use or copy this software for any purpose is hereby granted
12  * without fee, provided the above notices are retained on all copies.
13  * Permission to modify the code and to distribute modified code is granted,
14  * provided the above notices are retained, and a notice that the code was
15  * modified is included with the above copyright notice.
16  *
17  */
18 
19 // This header defines two streambufs:
20 // stdio_istreambuf, a read-only streambuf synchronized with a C stdio
21 // FILE object
22 // stdio_ostreambuf, a write-only streambuf synchronized with a C stdio
23 // FILE object.
24 // Note that neither stdio_istreambuf nor stdio_ostreambuf is a template;
25 // both classes are derived from basic_streambuf<char, char_traits<char> >.
26 
27 // Note: the imbue() member function is a no-op. In particular, these
28 // classes assume that codecvt<char, char, mbstate_t> is always an identity
29 // transformation. This is true of the default locale, and of all locales
30 // defined for the C I/O library. If you need to use a locale where
31 // the codecvt<char, char, mbstate_t> facet performs a nontrivial
32 // conversion, then you should use basic_filebuf<> instead of stdio_istreambuf
33 // or stdio_ostreambuf. (If you don't understand what any of this means,
34 // then it's not a feature you need to worry about. Locales where
35 // codecvt<char, char, mbstate_t> does something nontrivial are a rare
36 // corner case.)
37 
38 
39 #ifndef _STLP_STDIO_STREAMBUF
40 #define _STLP_STDIO_STREAMBUF
41 
42 #include <streambuf>
43 #include <cstdio> // For FILE.
44 
47 
48 // Base class for features common to stdio_istreambuf and stdio_ostreambuf
50  public basic_streambuf<char, char_traits<char> > /* FILE_basic_streambuf */ {
51 public: // Constructor, destructor.
52  // The argument may not be null. It must be an open file pointer.
54 
55  // The destructor flushes the stream, but does not close it.
57 
58 protected: // Virtual functions from basic_streambuf.
59  streambuf* setbuf(char*, streamsize);
60 
67  int sync();
68 
69 protected:
71 };
72 
74 public: // Constructor, destructor.
77 
78 protected: // Virtual functions from basic_streambuf.
81  int_type uflow();
83 };
84 
86 public: // Constructor, destructor.
89 
90 protected: // Virtual functions from basic_streambuf.
93 };
94 
97 
98 #endif /* _STLP_STDIO_STREAMBUF */
99 
100 // Local Variables:
101 // mode:C++
102 // End:
static int_type _STLP_CALL eof()
Definition: char_traits.h:193
char_traits< char > ::int_type int_type
Definition: _streambuf.h:54
pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
streamsize showmanyc()
int seekdir
Definition: _ios_base.h:60
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
char_traits< char > ::pos_type pos_type
Definition: _streambuf.h:55
stdio_ostreambuf(FILE *__f)
pos_type seekpos(pos_type, ios_base::openmode=ios_base::in|ios_base::out)
stdio_istreambuf(FILE *__f)
streambuf * setbuf(char *, streamsize)
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
int openmode
Definition: _ios_base.h:59
const GLubyte * c
Definition: glext.h:8905
static FILE * out
Definition: regtests2xml.c:44
int_type overflow(int_type c=traits_type::eof())
streamsize showmanyc()
GLuint in
Definition: glext.h:9616
virtual int_type pbackfail(int_type c=traits_type::eof())
#define _STLP_END_NAMESPACE
Definition: features.h:503
ptrdiff_t streamsize
Definition: char_traits.h:81
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
char_traits< char > ::off_type off_type
Definition: _streambuf.h:56