List of all members
cgicc::CgiInput Class Reference

Class that abstracts a data source. More...

#include <cgicc/CgiInput.h>

Public Member Functions

Constructor and Destructor
 CgiInput ()
 Constructor.
 
 CgiInput (const CgiInput &input)
 Copy constructor.
 
virtual ~CgiInput ()
 Destructor.
 
Overloaded Operators
bool operator== (const CgiInput &) const
 Compare two CgiInput objects for equality.
 
bool operator!= (const CgiInput &input) const
 Compare two CgiInput objects for inequality.
 
CgiInputoperator= (const CgiInput &)
 Assign one CgiInput to another.
 
Data Sources
virtual size_t read (char *data, size_t length)
 Read data from a data source.
 
virtual std::string getenv (const char *varName)
 Query the value of an environment variable.
 

Detailed Description

Class that abstracts a data source.

The CgiInput class is an abstraction for all input data to the CGI application. This allows input data to come from something other than standard input (cin). This is useful, in fact necessary, when using cgicc with FastCgi. Library users wishing to exploit this functionality should create a subclass and override the read and getenv methods.

Definition at line 58 of file CgiInput.h.

Constructor & Destructor Documentation

◆ CgiInput() [1/2]

cgicc::CgiInput::CgiInput ( )
inline

Constructor.

Create a new CgiInput object

Definition at line 73 of file CgiInput.h.

◆ CgiInput() [2/2]

cgicc::CgiInput::CgiInput ( const CgiInput input)
inline

Copy constructor.

If you subclass CgiInput, you must overload operator=

Parameters
inputThe CgiInput object to copy

Definition at line 84 of file CgiInput.h.

◆ ~CgiInput()

virtual cgicc::CgiInput::~CgiInput ( )
virtual

Destructor.

Delete this CgiInput object

Member Function Documentation

◆ getenv()

virtual std::string cgicc::CgiInput::getenv ( const char *  varName)
virtual

Query the value of an environment variable.

In the default implementation, this is a wrapper for std::getenv()

Parameters
varNameThe name of an environment variable
Returns
The value of the requested environment variable, or an empty string if not found.

◆ operator!=()

bool cgicc::CgiInput::operator!= ( const CgiInput input) const
inline

Compare two CgiInput objects for inequality.

In the default implementation all CgiInput objects are equal

Parameters
inputThe CgiInput object to compare to this one
Returns
false

Definition at line 120 of file CgiInput.h.

◆ operator=()

CgiInput & cgicc::CgiInput::operator= ( const CgiInput )
inline

Assign one CgiInput to another.

Does nothing in the default implementation

Parameters
inputThe CgiInput object to copy
Returns
A reference to this.

Definition at line 131 of file CgiInput.h.

◆ operator==()

bool cgicc::CgiInput::operator== ( const CgiInput ) const
inline

Compare two CgiInput objects for equality.

In the default implementation all CgiInput objects are equal

Parameters
inputThe CgiInput object to compare to this one
Returns
true

Definition at line 109 of file CgiInput.h.

◆ read()

virtual size_t cgicc::CgiInput::read ( char *  data,
size_t  length 
)
virtual

Read data from a data source.

In the default implementation, this is a wrapper for cin.read()

Parameters
dataThe target buffer
lengthThe number of characters to read
Returns
The number of characters read

The documentation for this class was generated from the following file:

GNU cgicc - A C++ class library for writing CGI applications
Copyright © 1996 - 2004 Stephen F. Booth
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front Cover Texts, and with no Back-Cover Texts.
Documentation generated Fri Mar 1 2024 08:39:42 for cgicc by doxygen 1.9.6