Mod Cplusplus CVS committal
Author : gr84b8
Project : mod_cplusplus
Module : include
Dir : mod_cplusplus/include
Modified Files:
apache_output_buffer.h env_value.h request_env.h
Log Message:
clean up some formatting and remove some copyright stuff that slipped through
===================================================================
RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/apache_output_buffer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- apache_output_buffer.h 26 Apr 2002 18:57:00 -0000 1.1
+++ apache_output_buffer.h 3 May 2002 16:50:27 -0000 1.2
@@ -1,27 +1,6 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * $Id: apache_output_buffer.h,v 1.1 2002/04/26 18:57:00 gr84b8 Exp $
- * apache_output_buffer.h - Wed Apr 24 09:03:34 2002
- * Copyright (C) 2001 Nathan Stitt
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
#ifndef __APACHE_OUTPUT_BUFFER__
#define __APACHE_OUTPUT_BUFFER__
-
#if (defined (__GNUC__) && (__GNUC__ < 3))
#include <rope>
#else
@@ -37,44 +16,46 @@
#include <iostream>
#include <string>
-class apache_output_buffer
- : public std::streambuf {
-public:
- apache_output_buffer( request_rec* r, bool buffer = false );
-
- ~apache_output_buffer();
-
- // if buffering output, send buffered output to browser immediatly
- int flush();
-
- // if beffering output, clear buffer
- void clear();
-
- // set whether or not to buffer output
- void buffer ( bool val );
-
- // is output being buffered?
- bool buffer();
-
- // set what content type should be sent
- // to browser. Returns true on success, false
- // if we've already sent some content, and it's to
- // late to resend.
- bool set_content_type(const std::string& type);
-
-
-protected:
- int overflow(int c);
-
-private:
- inline void signal_sending();
- inline void send_http_header();
- request_rec *r_;
- std::crope memory;
- bool buffer_;
- bool output_anything_;
- std::string content_type_;
+class apache_output_buffer : public std::streambuf {
+ public:
+ apache_output_buffer( request_rec* r, bool buffer = false );
+
+ ~apache_output_buffer();
+
+ /* if buffering output, send buffered output to browser immediatly */
+ int flush();
+
+ /* if beffering output, clear buffer */
+ void clear();
+
+ /* set whether or not to buffer output */
+ void buffer ( bool val );
+
+ /* is output being buffered? */
+ bool buffer();
+
+ /*
+ * set what content type should be sent
+ * to browser. Returns true on success, false
+ * if we've already sent some content, and it's to
+ * late to resend.
+ */
+ bool set_content_type(const std::string& type);
+
+
+ protected:
+ int overflow(int c);
+
+ private:
+ inline void signal_sending();
+ inline void send_http_header();
+ request_rec *r_;
+ std::crope memory;
+ bool buffer_;
+ bool output_anything_;
+ std::string content_type_;
};
#endif // __APACHE_OUTPUT_BUFFER__
+
===================================================================
RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/env_value.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- env_value.h 26 Apr 2002 18:57:00 -0000 1.1
+++ env_value.h 3 May 2002 16:50:27 -0000 1.2
@@ -1,23 +1,3 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * $Id: env_value.h,v 1.1 2002/04/26 18:57:00 gr84b8 Exp $
- * env_value.h - Wed Apr 24 08:58:54 2002
- * Copyright (C) 2001 Nathan Stitt
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
#ifndef __ENV_VALUE_H__
#define __ENV_VALUE_H__
@@ -26,19 +6,19 @@
#include <iterator>
class env_value {
- friend class request_env;
-public:
- typedef std::vector<std::string>::const_iterator const_iterator;
-
- env_value();
- const_iterator end();
- const_iterator begin();
- int num_vals();
- std::string operator[]( int index );
-
-private:
- void add_value( const std::string& value );
- std::vector<std::string> vals_;
+ friend class request_env;
+ public:
+ typedef std::vector<std::string>::const_iterator const_iterator;
+
+ env_value();
+ const_iterator end();
+ const_iterator begin();
+ int num_vals();
+ std::string operator[]( int index );
+
+ private:
+ void add_value( const std::string& value );
+ std::vector<std::string> vals_;
};
===================================================================
RCS file: /cvsroot/modcplusplus/mod_cplusplus/include/request_env.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- request_env.h 26 Apr 2002 18:57:00 -0000 1.1
+++ request_env.h 3 May 2002 16:50:27 -0000 1.2
@@ -1,23 +1,3 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-/*
- * $Id: request_env.h,v 1.1 2002/04/26 18:57:00 gr84b8 Exp $
- * request_env.h - Tue Apr 16 11:09:28 2002
- * Copyright (C) 2001 Nathan Stitt
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
#ifndef __REQUEST_ENV_H__
#define __REQUEST_ENV_H__
@@ -38,54 +18,54 @@
class env_value;
class request_env : public std::ostream {
-public:
-
- request_env( request_rec *r,bool buffer = false );
-
- //! dump the values in ( hopefully ) nicely formatted html
- void dump();
-
- //! is request a post?
- bool s_post();
-
- //! returns number of bytes written to client, -1 on failure
- int flush();
-
- //! set the content type. Defaults to text/html if not set
- bool set_content_type(const std::string& type);
-
- void set_buffered( bool val );
- bool is_buffered();
- void clear_buffer();
- void flush_buffer();
- bool is_post();
- bool is_get();
-
- env_value* operator[]( const std::string& name );
-
- request_rec* raw_record();
-
- ~request_env();
-private:
-
- struct str_hash {
- std::size_t inline operator()(const std::string& key) const
- {return std::hash<const char*>()( key.c_str());}
- };
-
- typedef std::hash_map< std::string, env_value*, str_hash > hash_type;
-
- apache_output_buffer output_buffer_;
- request_rec *r_;
-
- env_value* search(const std::string& key);
-
- bool truncated_;
- void decode( char *ch, env_value *pPtr, std::string& pStr );
- hash_type env_;
- apr_size_t len_read_;
- bool is_post_;
-
+ public:
+
+ request_env( request_rec *r,bool buffer = false );
+
+ /* dump the values in ( hopefully ) nicely formatted html */
+ void dump();
+
+ /* is request a post? */
+ bool s_post();
+
+ /* returns number of bytes written to client, -1 on failure */
+ int flush();
+
+ /* set the content type. Defaults to text/html if not set */
+ bool set_content_type(const std::string& type);
+
+ void set_buffered( bool val );
+ bool is_buffered();
+ void clear_buffer();
+ void flush_buffer();
+ bool is_post();
+ bool is_get();
+
+ env_value* operator[]( const std::string& name );
+
+ request_rec* raw_record();
+
+ ~request_env();
+ private:
+
+ struct str_hash {
+ std::size_t inline operator()(const std::string& key) const
+ {return std::hash<const char*>()( key.c_str());}
+ };
+
+ typedef std::hash_map< std::string, env_value*, str_hash > hash_type;
+
+ apache_output_buffer output_buffer_;
+ request_rec *r_;
+
+ env_value* search(const std::string& key);
+
+ bool truncated_;
+ void decode( char *ch, env_value *pPtr, std::string& pStr );
+ hash_type env_;
+ apr_size_t len_read_;
+ bool is_post_;
+
};
|