#include <BESTextInfo.h>
Inheritance diagram for BESTextInfo:
Public Member Functions | |
BESTextInfo (bool ishttp=false) | |
constructs a basic text information response object. | |
BESTextInfo (const string &key, ostream *strm, bool strm_owned, bool ishttp=false) | |
constructs a basic text information response object. | |
virtual | ~BESTextInfo () |
virtual void | begin_response (const string &response_name) |
begin the informational response | |
virtual void | add_tag (const string &tag_name, const string &tag_data, map< string, string > *attrs=0) |
add tagged information to the inforamtional response | |
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 | end_tag (const string &tag_name) |
end a tagged part of the informational response | |
virtual void | add_data (const string &s) |
add string data to the informational response | |
virtual void | add_space (unsigned long num_spaces) |
add a space to the informational response | |
virtual void | add_break (unsigned long num_breaks) |
add a line break to the information | |
virtual void | add_data_from_file (const string &key, const string &name) |
add data from a file to the informational object | |
virtual void | transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi) |
transmit the text information as text | |
virtual void | dump (ostream &strm) const |
dumps information about this object | |
virtual void | end_response () |
virtual void | add_exception (BESError &e, const string &admin) |
add exception information to this informational object | |
virtual void | print (ostream &strm) |
print the information from this informational object to the specified stream | |
virtual bool | is_buffered () |
return whether the information is to be buffered or not. | |
Static Public Member Functions | |
static BESInfo * | BuildTextInfo (const string &info_type) |
Protected Attributes | |
ostream * | _strm |
bool | _strm_owned |
bool | _buffered |
bool | _response_started |
stack< string > | _tags |
string | _response_name |
Uses the default add_data and print methods, where the print method, if the response is going to a browser, sets the mime type to text.
Definition at line 47 of file BESTextInfo.h.
BESTextInfo::BESTextInfo | ( | bool | ishttp = false |
) |
constructs a basic text information response object.
Text informational objects can also be sent as html with an html header. We need to know this if the informationl is not buffered. If it isn't buffered then we need to send that text header.
Definition at line 54 of file BESTextInfo.cc.
Referenced by BuildTextInfo().
BESTextInfo::BESTextInfo | ( | const string & | key, | |
ostream * | strm, | |||
bool | strm_owned, | |||
bool | ishttp = false | |||
) |
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.
Text informational objects can also be sent as html with an html header. We need to know this if the informationl is not buffered. If it isn't buffered then we need to send that text header.
key | parameter from BES configuration file | |
strm | if not buffered then use the passed stream | |
strm_owned | if strm created (not cout or cerr for example) then tells whether strm owned or not and can be deleted | |
ishttp | tells whether this text information is html text and therefor requires the html header |
Definition at line 80 of file BESTextInfo.cc.
BESTextInfo::~BESTextInfo | ( | ) | [virtual] |
Definition at line 88 of file BESTextInfo.cc.
void BESTextInfo::begin_response | ( | const string & | response_name | ) | [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 |
Reimplemented from BESInfo.
Definition at line 99 of file BESTextInfo.cc.
References BESInfo::begin_response().
Here is the call graph for this function:
void BESTextInfo::add_tag | ( | const string & | tag_name, | |
const string & | tag_data, | |||
map< string, string > * | attrs = 0 | |||
) | [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 111 of file BESTextInfo.cc.
References add_data().
Here is the call graph for this function:
void BESTextInfo::begin_tag | ( | const string & | tag_name, | |
map< string, string > * | attrs = 0 | |||
) | [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 BESTextInfo.cc.
References add_data(), and BESInfo::begin_tag().
Here is the call graph for this function:
void BESTextInfo::end_tag | ( | const string & | tag_name | ) | [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 161 of file BESTextInfo.cc.
References BESInfo::end_tag().
Here is the call graph for this function:
void BESTextInfo::add_data | ( | const string & | s | ) | [virtual] |
add string data to the informational response
s | string data to add the informational response |
Reimplemented from BESInfo.
Definition at line 173 of file BESTextInfo.cc.
References BESInfo::_buffered, BESInfo::_strm, BESInfo::add_data(), and BESUtil::set_mime_text().
Referenced by add_break(), add_space(), add_tag(), and begin_tag().
Here is the call graph for this function:
void BESTextInfo::add_space | ( | unsigned long | num_spaces | ) | [virtual] |
add a space to the informational response
num_spaces | the number of spaces to add to the information |
Implements BESInfo.
Definition at line 188 of file BESTextInfo.cc.
References add_data().
Here is the call graph for this function:
void BESTextInfo::add_break | ( | unsigned long | num_breaks | ) | [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 203 of file BESTextInfo.cc.
References add_data().
Here is the call graph for this function:
void BESTextInfo::add_data_from_file | ( | const string & | key, | |
const string & | name | |||
) | [virtual] |
add data from a file to the informational object
This method simply adds a .TXT 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 222 of file BESTextInfo.cc.
References BESInfo::add_data_from_file().
Here is the call graph for this function:
void BESTextInfo::transmit | ( | BESTransmitter * | transmitter, | |
BESDataHandlerInterface & | dhi | |||
) | [virtual] |
transmit the text information as text
use the send_text method on the transmitter to transmit the 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 BESTextInfo.cc.
References BESTransmitter::send_text().
Here is the call graph for this function:
void BESTextInfo::dump | ( | ostream & | strm | ) | const [virtual] |
dumps information about this object
Displays the pointer value of this instance along with information about this text information object
strm | C++ i/o stream to dump the information to |
Reimplemented from BESInfo.
Definition at line 251 of file BESTextInfo.cc.
References BESInfo::dump(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().
Here is the call graph for this function:
BESInfo * BESTextInfo::BuildTextInfo | ( | const string & | info_type | ) | [static] |
Definition at line 264 of file BESTextInfo.cc.
References BESTextInfo().
Referenced by BESDefaultModule::initialize().
Here is the call graph for this function:
void BESInfo::end_response | ( | ) | [virtual, inherited] |
Reimplemented in BESHTMLInfo, BESVersionInfo, and BESXMLInfo.
Definition at line 115 of file BESInfo.cc.
References BESInfo::_response_started, and BESInfo::_tags.
Referenced by BESXMLInfo::end_response(), BESVersionInfo::end_response(), BESStatusResponseHandler::execute(), BESShowDefsResponseHandler::execute(), BESShowContextResponseHandler::execute(), BESShowContainersResponseHandler::execute(), BESProcIdResponseHandler::execute(), BESHelpResponseHandler::execute(), BESConfigResponseHandler::execute(), BESCatalogResponseHandler::execute(), and BESExceptionManager::handle_exception().
void BESInfo::add_exception | ( | BESError & | e, | |
const string & | administrator | |||
) | [virtual, inherited] |
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 |
Reimplemented in BESDapErrorInfo, BESSilentInfo, and BESVersionInfo.
Definition at line 217 of file BESInfo.cc.
References BESInfo::add_tag(), BESInfo::begin_tag(), BESInfo::end_tag(), BESError::get_error_type(), BESError::get_file(), BESError::get_line(), and BESError::get_message().
Referenced by BESVersionInfo::add_exception(), and BESExceptionManager::handle_exception().
Here is the call graph for this function:
void BESInfo::print | ( | ostream & | strm | ) | [virtual, inherited] |
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 BESDapErrorInfo, BESSilentInfo, BESVersionInfo, and BESXMLInfo.
Definition at line 245 of file BESInfo.cc.
References BESInfo::_buffered, and BESInfo::_strm.
Referenced by BESInterface::finish(), BESXMLInfo::print(), BESVersionInfo::print(), BESFilterTransmitter::send_html(), BESBasicTransmitter::send_html(), BESFilterTransmitter::send_text(), BESBasicTransmitter::send_text(), and BESInterface::transmit_data().
virtual bool BESInfo::is_buffered | ( | ) | [inline, virtual, inherited] |
return whether the information is to be buffered or not.
Definition at line 122 of file BESInfo.h.
References BESInfo::_buffered.
Referenced by BESFilterTransmitter::send_html(), BESBasicHttpTransmitter::send_html(), BESFilterTransmitter::send_text(), and BESBasicHttpTransmitter::send_text().
ostream* BESInfo::_strm [protected, inherited] |
Definition at line 71 of file BESInfo.h.
Referenced by add_data(), BESHTMLInfo::add_data(), BESInfo::BESInfo(), BESInfo::print(), and BESInfo::~BESInfo().
bool BESInfo::_strm_owned [protected, inherited] |
bool BESInfo::_buffered [protected, inherited] |
Definition at line 73 of file BESInfo.h.
Referenced by add_data(), BESHTMLInfo::add_data(), BESInfo::BESInfo(), BESInfo::dump(), BESInfo::is_buffered(), and BESInfo::print().
bool BESInfo::_response_started [protected, inherited] |
Definition at line 74 of file BESInfo.h.
Referenced by BESInfo::begin_response(), BESInfo::dump(), and BESInfo::end_response().
stack<string> BESInfo::_tags [protected, inherited] |
Definition at line 76 of file BESInfo.h.
Referenced by BESInfo::begin_tag(), BESInfo::dump(), BESInfo::end_response(), and BESInfo::end_tag().
string BESInfo::_response_name [protected, inherited] |
Definition at line 77 of file BESInfo.h.
Referenced by BESXMLInfo::begin_response(), BESInfo::begin_response(), BESInfo::dump(), and BESXMLInfo::end_response().