[Modcplusplus-user] Request paramaters decode class
Brought to you by:
gr84b8,
johnksterling
From: Nathan S. <na...@al...> - 2002-04-25 16:13:57
|
Ok here's my first cut at a request parameters decoding class. A patch against cvs and a tarball of all new files created are at: http://stitt.org/code/mod_cplusplus/ I took the liberty of having the patch add a small description of the class to changelog, and setting my email to na...@st... vs na...@al.... na...@al... is my 'work' email, and seeing as I'm doing this on my own, I figured it would be better to use my private email, this gets confusing however as I usually send email from work. I also included a few minor cleanups in patch, which you may or may not find usefull. Let me know what you think, Nathan Short explanation of work follows I've created three classes: apache_output_buffer - Inherits from std::streambuf and sends all output to ap_rputs. It also features buffering, meaning output can be buffered and then sent all at once at the end of the requests. On my local lan this is slower, however it may or may not be under real load, as it be more efficient not to trickle output to grandma with her 9600 baud modem :) Also buffering has an advantage as it allows deciding against sending output later on in the request cycle (for instance if an error occurs). request_env - inherits from std::ostream allowing it to be used like so: request_env ap( pRequest->get_request_rec() ); ap << "Hello World!" << std::endl; also is responsible for decoding request parameters. See modified test_handler for (hopefuly) better explanation of it's use. env_value - holds each value that was decoded from request_env, basically a tiny wrapper around std::vector, only exposing parts that are usefull. |