bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
represents simple text information in a response object, such as version and help information. More...
#include <BESTextInfo.h>
Public Member Functions | |
void | add_break (unsigned long num_breaks) override |
add a line break to the information | |
void | add_data (const std::string &s) override |
add string data to the informational response | |
void | add_data_from_file (const std::string &key, const std::string &name) override |
add data from a file to the informational object | |
virtual void | add_exception (const BESError &e, const std::string &admin) |
add exception information to this informational object | |
void | add_space (unsigned long num_spaces) override |
add a space to the informational response | |
void | add_tag (const std::string &tag_name, const std::string &tag_data, std::map< std::string, std::string, std::less<> > *attrs=nullptr) override |
add tagged information to the inforamtional response | |
virtual void | begin_response (const std::string &response_name, std::map< std::string, std::string, std::less<> > *attrs, BESDataHandlerInterface &dhi) |
begin the informational response | |
void | begin_response (const std::string &response_name, BESDataHandlerInterface &dhi) override |
begin the informational response | |
void | begin_tag (const std::string &tag_name, std::map< std::string, std::string, std::less<> > *attrs=nullptr) override |
begin a tagged part of the information, information to follow | |
BESTextInfo (bool ishttp=false) | |
constructs a basic text information response object. | |
BESTextInfo (const std::string &key, std::ostream *strm, bool strm_owned, bool ishttp=false) | |
constructs a basic text information response object. | |
void | dump (std::ostream &strm) const override |
dumps information about this object | |
virtual void | end_response () |
void | end_tag (const std::string &tag_name) override |
end a tagged part of the informational response | |
virtual bool | is_buffered () |
return whether the information is to be buffered or not. | |
virtual void | print (std::ostream &strm) |
print the information from this informational object to the specified stream | |
void | transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi) override |
transmit the text information as text | |
Static Public Member Functions | |
static BESInfo * | BuildTextInfo (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 simple text information in a response object, such as version and help information.
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 48 of file BESTextInfo.h.
|
explicit |
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 55 of file BESTextInfo.cc.
BESTextInfo::BESTextInfo | ( | const std::string & | key, |
std::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 79 of file BESTextInfo.cc.
|
override |
Definition at line 84 of file BESTextInfo.cc.
|
overridevirtual |
add a line break to the information
num_breaks | the number of line breaks to add to the information |
Implements BESInfo.
Definition at line 183 of file BESTextInfo.cc.
|
overridevirtual |
add string data to the informational response
s | string data to add the informational response |
Reimplemented from BESInfo.
Definition at line 157 of file BESTextInfo.cc.
|
overridevirtual |
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 200 of file BESTextInfo.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.
Definition at line 221 of file BESInfo.cc.
|
overridevirtual |
add a space to the informational response
num_spaces | the number of spaces to add to the information |
Implements BESInfo.
Definition at line 170 of file BESTextInfo.cc.
|
overridevirtual |
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 106 of file BESTextInfo.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 108 of file BESInfo.cc.
|
overridevirtual |
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 95 of file BESTextInfo.cc.
|
overridevirtual |
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 125 of file BESTextInfo.cc.
|
static |
Definition at line 238 of file BESTextInfo.cc.
|
overridevirtual |
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 226 of file BESTextInfo.cc.
|
virtualinherited |
Reimplemented in BESHTMLInfo, and BESXMLInfo.
Definition at line 125 of file BESInfo.cc.
|
overridevirtual |
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 147 of file BESTextInfo.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, and BESXMLInfo.
Definition at line 249 of file BESInfo.cc.
|
overridevirtual |
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 214 of file BESTextInfo.cc.