Update of /cvsroot/mod-c/ehtml/include
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11351/include
Modified Files:
Response.h
Log Message:
* Added support for apache output stream.
Index: Response.h
===================================================================
RCS file: /cvsroot/mod-c/ehtml/include/Response.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Response.h 12 Sep 2006 00:26:47 -0000 1.4
--- Response.h 5 Oct 2006 14:53:59 -0000 1.5
***************
*** 24,27 ****
--- 24,46 ----
#include "EHTMLApplication.h"
+ #include <iostream>
+ #include <streambuf>
+ class ApacheResponseStreamBuf: public std::streambuf {
+ request_rec* _r;
+ char _buf[256]; //TODO FIXME saving buffers in objects is not really wise
+ public:
+ ApacheResponseStreamBuf(request_rec* r);
+ virtual ~ApacheResponseStreamBuf();
+
+ virtual std::streamsize sputc(char c);
+ virtual std::streamsize sputn(char* s, std::streamsize n);
+ virtual std::streamsize sputn(const char* s, std::streamsize n);
+ protected:
+ virtual std::streamsize xsputn(char* s, std::streamsize n);
+ virtual std::streamsize xsputn(const char* s, std::streamsize n);
+ virtual int sync();
+ virtual char overflow(char c = traits_type::eof());
+ };
+
/**
* The wrapper for all response related configuration.
***************
*** 47,50 ****
--- 66,75 ----
void SetCookie(const std::string& name, const std::string& value);
+ /**
+ * Returns the response stream
+ *
+ */
+ std::ostream& GetStream() { return _stream; }
+
protected:
/**
***************
*** 56,59 ****
--- 81,92 ----
*/
EHTMLApplication * Application;
+ /**
+ * The response stream
+ */
+ std::ostream _stream;
+ /**
+ * The response streambuf
+ */
+ ApacheResponseStreamBuf _buf;
};
|