2 // Provides support for FastCGI via C++ iostreams.
\r
4 // $Id: fcgio.h,v 1.7 2001/11/20 03:24:18 robs Exp $
6 // This work is based on routines written by George Feinberg. They
7 // have been mostly re-written and extensively changed by
10 // Rewritten again with bug fixes and numerous enhancements by
13 // And rewritten again by Rob Saccoccio.
15 // Special Thanks to Dietmar Kuehl for his help and the numerous custom
16 // streambuf examples on his web site.
18 // Copyright (c) 2000 Tux the Linux Penguin
\r
19 // Copyright (c) 2001 Rob Saccoccio and Chelsea Networks
21 // You are free to use this software without charge or royalty
22 // as long as this notice is not removed or altered, and recognition
23 // is given to the author(s)
25 // This code is offered as-is without any warranty either expressed or
26 // implied; without even the implied warranty of MERCHANTABILITY or
27 // FITNESS FOR A PARTICULAR PURPOSE. If it breaks, you get to keep
\r
39 #define DLLAPI __declspec(dllimport)
48 class fcgi_streambuf : public streambuf
52 DLLAPI fcgi_streambuf(FCGX_Stream * strm = NULL);
54 DLLAPI ~fcgi_streambuf(void);
56 DLLAPI int attach(FCGX_Stream * strm);
58 // Consume the put area (if buffered) and c (if c is not EOF).
59 DLLAPI virtual int overflow(int);
61 // Flush the put area (if buffered) and the FCGX buffer to the client.
\r
62 // Note: sync() is protected in some implementations.
63 DLLAPI virtual int sync();
65 // Fill the get area (if buffered) and return the next character.
66 DLLAPI virtual int underflow();
68 // Use a buffer. The only reasons that a buffer would be useful is
\r
69 // to support the use of the unget()/putback() or seek() methods. Using
\r
70 // a buffer will result in less efficient I/O. Note: the underlying
\r
71 // FastCGI library (FCGX) maintains its own input and output buffers.
\r
72 // Note: setbuf() is protected in some implementations.
73 DLLAPI virtual streambuf * setbuf(char * buf, int len);
75 DLLAPI virtual int xsgetn(char * s, int n);
\r
76 DLLAPI virtual int xsputn(const char * s, int n);
\r
82 // buf is just handy to have around
\r
85 // this isn't kept by the base class
\r
92 * fcgi_istream - deprecated
94 class fcgi_istream : public istream
99 DLLAPI fcgi_istream(FCGX_Stream * strm = NULL);
102 DLLAPI ~fcgi_istream(void) {}
105 DLLAPI virtual void attach(FCGX_Stream * strm);
109 fcgi_streambuf fcgi_strmbuf;
113 * fcgi_ostream - deprecated
115 class fcgi_ostream : public ostream
120 DLLAPI fcgi_ostream(FCGX_Stream * strm = NULL);
123 DLLAPI ~fcgi_ostream(void) {}
126 DLLAPI virtual void attach(FCGX_Stream *str);
130 fcgi_streambuf fcgi_strmbuf;