23 #include <webview/page_reply.h> 24 #include <webview/page_header_generator.h> 25 #include <webview/page_footer_generator.h> 26 #include <utils/system/hostinfo.h> 45 const char * WebPageReply::PAGE_HEADER =
48 " <title>%s</title>\n" 49 " <link rel=\"stylesheet\" type=\"text/css\" href=\"/static/css/webview.css\" />\n" 55 const char * WebPageReply::PAGE_FOOTER =
67 navbar_enabled_ =
true;
68 footer_enabled_ =
true;
81 navbar_enabled_ =
true;
82 footer_enabled_ =
true;
113 if (headergen && navbar_enabled_)
118 if ( asprintf(&s, PAGE_HEADER,
_title.c_str(), __html_header.c_str(), hi.
short_name()) != -1 ) {
124 __merged_body +=
_body;
126 if (footergen && footer_enabled_) __merged_body += footergen->
html_footer();
127 else __merged_body += PAGE_FOOTER;
130 std::string::size_type
133 return __merged_body.length();
140 return __merged_body;
149 navbar_enabled_ = enabled;
157 return navbar_enabled_;
165 footer_enabled_ = enabled;
173 return footer_enabled_;
const char * short_name()
Get short hostname (up to first dot).
Fawkes library namespace.
void add_header(std::string header, std::string content)
Add a HTTP header.
std::string _body
Body of the reply.
Code code() const
Get response code.