43# include <sys/utsname.h>
59 cout <<
"<form method=\"post\" action=\""
60 <<
cgi.getEnvironment().getScriptName() <<
"\">" <<
endl;
64 cout <<
"<tr><td class=\"title\">Cookie Name</td>"
65 <<
"<td class=\"form\">"
66 <<
"<input type=\"text\" name=\"name\" />"
67 <<
"</td></tr>" <<
endl;
69 cout <<
"<tr><td class=\"title\">Cookie Value</td>"
70 <<
"<td class=\"form\">"
71 <<
"<input type=\"text\" name=\"value\" />"
72 <<
"</td></tr>" <<
endl;
76 cout <<
"<div class=\"center\"><p>"
77 <<
"<input type=\"submit\" name=\"submit\" value=\"Set the cookie\" />"
78 <<
"<input type=\"reset\" value=\"Nevermind\" />"
79 <<
"</p></div></form>" <<
endl;
103 &&
value->getValue().empty() ==
false)
131 <<
" v"<<
cgi.getVersion() <<
" HTTPCookie Test Results"
138 cout <<
comment() <<
"This page generated by cgicc for "
140 cout <<
h4() <<
"Thanks for using cgi" <<
span(
"cc").
set(
"class",
"red")
141 <<
", " <<
env.getRemoteHost()
142 <<
'(' <<
env.getRemoteAddr() <<
")!" <<
h4() <<
endl;
145 &&
value->getValue().empty() ==
false) {
146 cout <<
p() <<
"A cookie with the name " <<
em(
name->getValue())
147 <<
" and value " <<
em(
value->getValue()) <<
" was set." <<
br();
148 cout <<
"In order for the cookie to show up here you must "
149 <<
a(
"refresh").
set(
"href",
env.getScriptName()) <<
p();
153 cout <<
h2(
"Cookie Information from the Environment") <<
endl;
159 cout <<
tr() <<
td(
"HTTPCookie").
set(
"class",
"title")
166 cout <<
h2(
"HTTP Cookies via vector") <<
endl;
172 cout <<
tr().
set(
"class",
"title") <<
td(
"Cookie Name")
173 <<
td(
"Cookie Value") <<
tr() <<
endl;
177 for(
iter =
env.getCookieList().begin();
178 iter !=
env.getCookieList().end();
193 cout <<
"GNU cgi" <<
span(
"cc").
set(
"class",
"red") <<
" v";
195 cout <<
"Compiled at " <<
cgi.getCompileTime();
198 cout <<
"Configured for " <<
cgi.getHost();
202 cout <<
". Running on " <<
info.sysname;
203 cout <<
' ' <<
info.release <<
" (";
214 long us = ((
end.tv_sec -
start.tv_sec) * 1000000)
217 cout <<
br() <<
"Total time for request = " <<
us <<
" us";
218 cout <<
" (" <<
static_cast<double>(
us/1000000.0) <<
" s)";
230 catch(
const std::exception&
e) {
237 html::reset(); head::reset(); body::reset();
238 title::reset(); h1::reset(); h4::reset();
240 table::reset(); cgicc::div::reset(); p::reset();
241 a::reset(); h2::reset(); colgroup::reset();
253 cout <<
"body { color: black; background-color: white; }" <<
endl;
254 cout <<
"hr.half { width: 60%; align: center; }" <<
endl;
255 cout <<
"span.red, strong.red { color: red; }" <<
endl;
256 cout <<
"div.notice { border: solid thin; padding: 1em; margin: 1em 0; "
257 <<
"background: #ddd; }" <<
endl;
267 <<
" caught an exception" <<
h1() <<
endl;
Platform and operating system specific macro definitions.
The main header file for the GNU cgicc library.
The header file containing HTML output classes.
Class encapsulating the CGI runtime environment.
The main class of the GNU cgicc library.
Template for concrete atomic HTMLElement subclasses.
HTMLAtomicElement()
Create a new empty atomic element.
virtual const char * getName() const
Get the name of this element.
static void reset()
Reset the state of this boolean element to closed.
Specifies the DTD of the HTML 4 document.
HTMLElement & set(const std::string &name)
Set an HTMLAttribute on this HTMLElement.
The namespace containing the cgicc library.
std::vector< HTTPCookie >::const_iterator const_cookie_iterator
A vector of const HTTPCookie objects.
std::vector< FormEntry >::const_iterator const_form_iterator
A vector of const FormEntry objects.
HTMLAttributeList set(const std::string &name)
Create a new HTMLAttributeList, and set an HTMLAttribute.