outputbaseclass

The outputbase class is meant to be used as a base class for creating your own cgi output classes e.g. maybe a JSON class or an image class. It gives you the basic building blocks for this. e.g. The xhtml class included in ceegeye is an outputbase derived class.

The interface:

   outputbase(CGI& Cgi, T& Output = cout);
   ~outputbase();
   // stream the built in types.
// now we can do: xhtmlObject << 10 << " hello world";
outputbase& operator<<(const char* in);
outputbase& operator<<(const string& in);
outputbase& operator<<(char in);
outputbase& operator<<(int in);
outputbase& operator<<(short in);
outputbase& operator<<(long in);
outputbase& operator<<(__int64 in);
outputbase& operator<<(float in);
outputbase& operator<<(double in);
outputbase& operator<<(long double in);
outputbase& operator<<(unsigned int in);
outputbase& operator<<(unsigned short in);
outputbase& operator<<(unsigned long in);

// end the http headers ready for the data we are sending
// after calling this the data stream is open.

void closeheaders(const string& contenttype);

As you can see it is basic just allowing to stream basic types and a function closeheaders which closes the header of an http request indicating to a calling agent (e.g. web browser etc) that all that is left is data.