2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: streambuf.h /main/4 1996/06/11 17:39:15 cde-hal $ */
26 #ifndef _x_streambuf_h
27 #define _x_streambuf_h
38 typedef long streampos;
43 #define streambuf x_streambuf
44 #define filebuf x_filebuf
46 #define iostream x_iostream
47 #define istream x_istream
48 #define ostream x_ostream
49 #define fstream x_fstream
50 #define istrstream x_istrstream
51 #define ostrstream x_ostrstream
71 enum notify_action_t { GET, PUT };
72 virtual void notify(int) {};
74 virtual int overflow() { return EOF;};
75 virtual int underflow() { return EOF; };
77 int full() { return ( _size == _capacity ) ? 1 : 0 ; };
78 int empty() { return ( _size == 0 ) ? 1 : 0 ; };
82 put_ptr = get_ptr = base;
85 int move_get_ptr(int);
86 int move_put_ptr(int);
90 streambuf(char* p, int l, int pHasContent = 0);
93 virtual int examine() ; // EOF: no char available. Otherwise,
94 // return 0.The get_ptr pointer does
97 virtual int get() ; // EOF: can't get a char. Otherwise,
98 // return 0. The get_ptr pointer does move.
100 virtual int putback(char c) ; // EOF: can't put back. Otherwise,
101 // putback operation is ok.
102 virtual int put(char c) ; // EOF: can't put. Otherwise,
103 // put operation is ok.
105 int gcount() { return _gcount; };
106 void clear_gcount() { _gcount = 0; };
108 int pcount() { return _pcount; };
109 void clear_pcount() { _pcount = 0; };
111 virtual int flush() { return EOF; };
112 virtual int seekg(streampos) { return EOF; };
114 char* get_buf() { return base; };