36 using std::ostringstream ;
38 #include "BESHTMLInfo.h" 62 :
BESInfo( key, strm, strm_owned ),
68 BESHTMLInfo::~BESHTMLInfo()
88 add_data( (
string)
"<TITLE>" + response_name +
"</TITLE>\n" ) ;
89 if( _indent.length() >= 4 )
90 _indent = _indent.substr( 0, _indent.length()-4 ) ;
106 if( _indent.length() >= 4 )
107 _indent = _indent.substr( 0, _indent.length()-4 ) ;
109 if( _indent.length() >= 4 )
110 _indent = _indent.substr( 0, _indent.length()-4 ) ;
122 const string &tag_data,
123 map<string,string> *attrs )
125 string to_add = tag_name +
": " + tag_data +
"<BR />\n" ;
129 map<string,string>::const_iterator i = attrs->begin() ;
130 map<string,string>::const_iterator e = attrs->end() ;
133 string name = (*i).first ;
134 string val = (*i).second ;
147 map<string,string> *attrs )
149 BESInfo::begin_tag( tag_name ) ;
150 string to_add = tag_name +
"<BR />\n" ;
155 map<string,string>::const_iterator i = attrs->begin() ;
156 map<string,string>::const_iterator e = attrs->end() ;
159 string name = (*i).first ;
160 string val = (*i).second ;
175 BESInfo::end_tag( tag_name ) ;
176 if( _indent.length() >= 4 )
177 _indent = _indent.substr( 0, _indent.length()-4 ) ;
188 for(
unsigned long i = 0; i < num_spaces; i++ )
204 for(
unsigned long i = 0; i < num_breaks; i++ )
225 if( !_header && !_buffered )
248 string newkey = key +
".HTML" ;
264 transmitter->send_html( *
this, dhi ) ;
277 strm << BESIndent::LMarg <<
"BESHTMLInfo::dump - (" 278 << (
void *)
this <<
")" << endl ;
279 BESIndent::Indent() ;
280 strm << BESIndent::LMarg <<
"has header been added? " << _header << endl ;
281 strm << BESIndent::LMarg <<
"indentation \"" << _indent <<
"\"" << endl ;
282 strm << BESIndent::LMarg <<
"do indent? " << _do_indent << endl ;
284 BESIndent::UnIndent() ;
288 BESHTMLInfo::BuildHTMLInfo(
const string & )
BESHTMLInfo()
constructs an html formatted information response object.
virtual void add_data_from_file(const string &key, const string &name)
add data from a file to the informational object.
virtual void end_response()
end the response
virtual void dump(ostream &strm) const
Displays debug information about this object.
virtual void add_space(unsigned long num_spaces)
add a space to the informational response
informational response object
virtual void begin_tag(const string &tag_name, map< string, string > *attrs=0)
begin a tagged part of the information, information to follow
virtual void add_tag(const string &tag_name, const string &tag_data, map< string, string > *attrs=0)
add tagged information to the inforamtional response
static void set_mime_html(ostream &strm)
Generate an HTTP 1.0 response header for a html document.
virtual void add_data(const string &s)
add data to this informational object.
virtual void add_break(unsigned long num_breaks)
add a line break to the information
virtual void end_tag(const string &tag_name)
end a tagged part of the informational response
Structure storing information used by the BES to handle the request.
virtual void dump(ostream &strm) const
dumps information about this object
virtual void add_data_from_file(const string &key, const string &name)
add data from a file to the informational object
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
virtual void add_data(const string &s)
add data to this informational object. If buffering is not set then the information is output directl...
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit the text information as text
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response