bes
Updated for version 3.20.6
|
represents an html formatted response object More...
#include <BESHTMLInfo.h>
Public Member Functions | |
virtual void | add_break (unsigned long num_breaks) |
add a line break to the information More... | |
virtual void | add_data (const std::string &s) |
add data to this informational object. More... | |
virtual void | add_data_from_file (const std::string &key, const std::string &name) |
add data from a file to the informational object More... | |
virtual void | add_exception (BESError &e, const std::string &admin) |
add exception information to this informational object More... | |
virtual void | add_space (unsigned long num_spaces) |
add a space to the informational response More... | |
virtual void | add_tag (const std::string &tag_name, const std::string &tag_data, std::map< std::string, std::string > *attrs=0) |
add tagged information to the inforamtional response More... | |
virtual void | begin_response (const std::string &response_name, BESDataHandlerInterface &dhi) |
begin the informational response More... | |
virtual void | begin_response (const std::string &response_name, std::map< std::string, std::string > *attrs, BESDataHandlerInterface &dhi) |
begin the informational response More... | |
virtual void | begin_tag (const std::string &tag_name, std::map< std::string, std::string > *attrs=0) |
begin a tagged part of the information, information to follow More... | |
BESHTMLInfo () | |
constructs an html formatted information response object. More... | |
BESHTMLInfo (const std::string &key, std::ostream *strm, bool strm_owned) | |
constructs a basic text information response object. More... | |
virtual void | dump (std::ostream &strm) const |
dumps information about this object More... | |
virtual void | end_response () |
end the response More... | |
virtual void | end_tag (const std::string &tag_name) |
end a tagged part of the informational response More... | |
virtual bool | is_buffered () |
return whether the information is to be buffered or not. More... | |
virtual void | print (std::ostream &strm) |
print the information from this informational object to the specified stream More... | |
virtual void | transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi) |
transmit the text information as text More... | |
Static Public Member Functions | |
static BESInfo * | BuildHTMLInfo (const std::string &info_type) |
Protected Attributes | |
bool | _buffered |
std::string | _response_name |
bool | _response_started |
std::ostream * | _strm |
bool | _strm_owned |
std::stack< std::string > | _tags |
represents an html formatted response object
Uses the default add_data method, but overwrites print method in order to set the mime type to html.
Definition at line 46 of file BESHTMLInfo.h.
BESHTMLInfo::BESHTMLInfo | ( | ) |
constructs an html formatted information response object.
Definition at line 51 of file BESHTMLInfo.cc.
BESHTMLInfo::BESHTMLInfo | ( | const std::string & | key, |
std::ostream * | strm, | ||
bool | strm_owned | ||
) |
constructs a basic text information response object.
Uses the default specified key in the bes configuration file to determine whether the information should be buffered or not.
Definition at line 64 of file BESHTMLInfo.cc.
|
virtual |
add a line break to the information
num_breaks | the number of line breaks to add to the information |
Implements BESInfo.
Definition at line 182 of file BESHTMLInfo.cc.
|
virtual |
add data to this informational object.
If buffering is not set then the information is output directly to the output stream.
Formatting is up to the user
s | information to be added to this response object |
Reimplemented from BESInfo.
Definition at line 202 of file BESHTMLInfo.cc.
|
virtual |
add data from a file to the informational object
This method simply adds a .HTML to the end of the key and passes the request on up to the BESInfo parent class.
key | Key from the initialization file specifying the file to be |
name | A description of what is the information being loaded |
Reimplemented from BESInfo.
Definition at line 223 of file BESHTMLInfo.cc.
|
virtualinherited |
add exception information to this informational object
Exception information is added differently to different informational objects, such as html, xml, plain text. But, using the other methods of this class we can take care of exceptions here.
e | The exception to add to the informational response object |
admin | The contact information for the person responsible for this error |
Reimplemented in BESVersionInfo, and BESDapErrorInfo.
Definition at line 234 of file BESInfo.cc.
|
virtual |
add a space to the informational response
num_spaces | the number of spaces to add to the information |
Implements BESInfo.
Definition at line 168 of file BESHTMLInfo.cc.
|
virtual |
add tagged information to the inforamtional response
tag_name | name of the tag to be added to the response |
tag_data | information describing the tag |
attrs | map of attributes to add to the tag |
Implements BESInfo.
Definition at line 115 of file BESHTMLInfo.cc.
|
virtual |
begin the informational response
Because this is text informational object, no begin tags are needed
response_name | name of the response this information represents |
dhi | information about the request and response |
Reimplemented from BESInfo.
Definition at line 80 of file BESHTMLInfo.cc.
|
virtualinherited |
begin the informational response
basic setup of the response from abstract class
response_name | name of the response this information represents |
dhi | information about the request and response |
Reimplemented in BESXMLInfo.
Definition at line 111 of file BESInfo.cc.
|
virtual |
begin a tagged part of the information, information to follow
tag_name | name of the tag to begin |
attrs | map of attributes to begin the tag with |
Reimplemented from BESInfo.
Definition at line 135 of file BESHTMLInfo.cc.
|
virtual |
dumps information about this object
Displays the pointer value of this instance along with values of private data members.
strm | C++ i/o stream to dump the information to |
Reimplemented from BESInfo.
Definition at line 249 of file BESHTMLInfo.cc.
|
virtual |
end the response
Add the terminating tags for the response and for the response name. If there are still tags that have not been closed then an exception is thrown.
Reimplemented from BESInfo.
Definition at line 101 of file BESHTMLInfo.cc.
|
virtual |
end a tagged part of the informational response
If the named tag is not the current tag then an error is thrown.
tag_name | name of the tag to end |
Reimplemented from BESInfo.
Definition at line 158 of file BESHTMLInfo.cc.
|
inlinevirtualinherited |
|
virtualinherited |
print the information from this informational object to the specified stream
If the information was not buffered then this method does nothing, otherwise the information is output to the specified ostream.
strm | output to this file descriptor if information buffered. |
Reimplemented in BESVersionInfo, BESXMLInfo, and BESDapErrorInfo.
Definition at line 261 of file BESInfo.cc.
|
virtual |
transmit the text information as text
use the send_html method on the transmitter to transmit the html formatted information back to the client
transmitter | The type of transmitter to use to transmit the info |
dhi | information to help with the transmission |
Implements BESInfo.
Definition at line 237 of file BESHTMLInfo.cc.