CMS 3D CMS Logo

Public Member Functions | Protected Attributes

CgiReader Class Reference

#include <CgiReader.h>

List of all members.

Public Member Functions

 CgiReader (xgi::Input *the_in)
std::string read_cookie (std::string name)
void read_form (std::multimap< std::string, std::string > &form_info)
 ~CgiReader ()

Protected Attributes

xgi::Input * in
xgi::Output * out
std::string url

Detailed Description

Definition at line 17 of file CgiReader.h.


Constructor & Destructor Documentation

CgiReader::CgiReader ( xgi::Input *  the_in) [inline]

Definition at line 28 of file CgiReader.h.

References in.

    {
      in  = the_in;
    }
CgiReader::~CgiReader ( ) [inline]

Definition at line 33 of file CgiReader.h.

{}

Member Function Documentation

std::string CgiReader::read_cookie ( std::string  name)

Definition at line 28 of file CgiReader.cc.

References web::browse_db::env, in, matplotRender::reader, and relativeConstraints::value.

{
  cgicc::Cgicc reader(in);
  std::string value;

  const cgicc::CgiEnvironment& env = reader.getEnvironment();

  cgicc::const_cookie_iterator it;
  for (it = env.getCookieList().begin(); 
       it != env.getCookieList().end();
       it ++)
    {
      if (name == it->getName())
        {
          value = it->getValue();
        }
    }
  return value;
}
void CgiReader::read_form ( std::multimap< std::string, std::string > &  form_info)

Definition at line 6 of file CgiReader.cc.

References python::tagInventory::entries, i, in, mergeVDriftHistosByStation::name, matplotRender::reader, and relativeConstraints::value.

Referenced by WebInterface::Configure(), WebInterface::ContentsOpen(), WebInterface::DrawGif(), SiStripWebInterface::handleAnalyserRequest(), SiPixelWebInterface::handleEDARequest(), WebInterface::handleStandardRequest(), and WebInterface::Open().

{
  cgicc::Cgicc reader(in);

  std::vector<cgicc::FormEntry> entries = reader.getElements();

  //  std::cout << "Trying to read a form of " << entries.size() << " elements!" << std::endl;

  form_info.clear();

  for (unsigned int i = 0; i < entries.size(); i++)
    {
      std::string name  = entries[i].getName();
      std::string value = entries[i].getValue();

      //      std::cout << "Read " << name << " = " << value << std::endl;

      std::pair<std::string, std::string> map_entry(name, value);
      form_info.insert(map_entry);
    }
}

Member Data Documentation

xgi::Input* CgiReader::in [protected]

Definition at line 23 of file CgiReader.h.

Referenced by CgiReader(), read_cookie(), and read_form().

xgi::Output* CgiReader::out [protected]

Definition at line 24 of file CgiReader.h.

std::string CgiReader::url [protected]

Definition at line 21 of file CgiReader.h.