ReactOS 0.4.16-dev-197-g92996da
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 */ {
51public: // 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
58protected: // Virtual functions from basic_streambuf.
60
63 = ios_base::in | ios_base::out);
66 = ios_base::in | ios_base::out);
67 int sync();
68
69protected:
71};
72
74public: // Constructor, destructor.
77
78protected: // Virtual functions from basic_streambuf.
83};
84
86public: // Constructor, destructor.
89
90protected: // Virtual functions from basic_streambuf.
93};
94
97
98#endif /* _STLP_STDIO_STREAMBUF */
99
100// Local Variables:
101// mode:C++
102// End:
ptrdiff_t streamsize
Definition: char_traits.h:81
static int_type _STLP_CALL eof()
Definition: char_traits.h:193
int openmode
Definition: _ios_base.h:59
int seekdir
Definition: _ios_base.h:60
stdio_istreambuf(FILE *__f)
virtual int_type pbackfail(int_type c=traits_type::eof())
streamsize showmanyc()
streamsize showmanyc()
stdio_ostreambuf(FILE *__f)
int_type overflow(int_type c=traits_type::eof())
streambuf * setbuf(char *, streamsize)
pos_type seekpos(pos_type, ios_base::openmode=ios_base::in|ios_base::out)
pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode=ios_base::in|ios_base::out)
#define _STLP_MOVE_TO_STD_NAMESPACE
Definition: features.h:525
#define _STLP_BEGIN_NAMESPACE
Definition: features.h:501
#define _STLP_END_NAMESPACE
Definition: features.h:503
#define _STLP_MOVE_TO_PRIV_NAMESPACE
Definition: features.h:524
const GLubyte * c
Definition: glext.h:8905