#include <CgiWriter.h>
Public Member Functions | |
CgiWriter (xgi::Output *the_out, std::string the_contextURL) | |
void | output_finish () |
void | output_head () |
void | output_preamble () |
~CgiWriter () | |
Private Attributes | |
std::string | contextURL |
xgi::Output * | out |
Definition at line 5 of file CgiWriter.h.
CgiWriter::CgiWriter | ( | xgi::Output * | the_out, |
std::string | the_contextURL | ||
) | [inline] |
Definition at line 14 of file CgiWriter.h.
References contextURL, gather_cfg::cout, and out.
{ out = the_out; contextURL = the_contextURL; std::cout << "Created a CgiWriter! ContextURL=" << contextURL << std::endl; }
CgiWriter::~CgiWriter | ( | ) | [inline] |
Definition at line 21 of file CgiWriter.h.
{}
void CgiWriter::output_finish | ( | ) |
Definition at line 33 of file CgiWriter.cc.
References out.
Referenced by WebInterface::Default().
{ *out << "</html>" << std::endl; }
void CgiWriter::output_head | ( | ) |
Definition at line 17 of file CgiWriter.cc.
References contextURL, link(), and out.
Referenced by WebInterface::Default().
{ std::string js_file_url = contextURL + "/temporary/WebLib.js"; std::string css_file_url = contextURL + "/temporary/style.css"; *out << cgicc::head() << std::endl; *out << cgicc::script().set("src", js_file_url.c_str()) << cgicc::script() << std::endl; *out << cgicc::link().set("type", "text/css").set("href", css_file_url.c_str()).set("rel", "stylesheet") << std::endl; *out << cgicc::meta().set("https-equiv", "pragma").set("content", "no-cache") << std::endl; *out << cgicc::head() << std::endl; }
void CgiWriter::output_preamble | ( | ) |
Definition at line 3 of file CgiWriter.cc.
References packageDocSplitter::html, and out.
Referenced by WebInterface::Default().
{ out->getHTTPResponseHeader().addHeader("Content-Type", "text/html"); out->getHTTPResponseHeader().addHeader("Expires", "0"); out->getHTTPResponseHeader().addHeader("Cache-Control", "no-store, no-cache, must-revalidate, max-age=0"); out->getHTTPResponseHeader().addHeader("Cache-Control", "post-check=0, pre-check=0"); out->getHTTPResponseHeader().addHeader("Pragma", "no-cache"); *out << cgicc::HTMLDoctype(cgicc::HTMLDoctype::eStrict) << std::endl; // This is here for the sake of producing correct html: // *out << cgicc::html() << std::endl; *out << cgicc::html().set("lang", "en").set("dir","ltr") << std::endl; }
std::string CgiWriter::contextURL [private] |
Definition at line 10 of file CgiWriter.h.
Referenced by CgiWriter(), and output_head().
xgi::Output* CgiWriter::out [private] |
Definition at line 9 of file CgiWriter.h.
Referenced by CgiWriter(), output_finish(), output_head(), and output_preamble().