bes  Updated for version 3.17.4
BESXMLInfo Class Reference

represents an xml formatted response object More...

#include <BESXMLInfo.h>

Inheritance diagram for BESXMLInfo:
Inheritance graph

Public Member Functions

virtual void add_break (unsigned long num_breaks)
 add a line break to the information More...
 
virtual void add_data (const string &s)
 add data to this informational object. If buffering is not set then the information is output directly to the output stream. More...
 
virtual void add_data_from_file (const string &key, const string &name)
 add data from a file to the informational object More...
 
virtual void add_exception (BESError &e, const 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 string &tag_name, const string &tag_data, map< string, string > *attrs=0)
 add tagged information to the inforamtional response More...
 
virtual void begin_response (const string &response_name, BESDataHandlerInterface &dhi)
 begin the informational response More...
 
virtual void begin_tag (const string &tag_name, map< string, string > *attrs=0)
 begin a tagged part of the information, information to follow More...
 
 BESXMLInfo ()
 constructs an informational response object as an xml document More...
 
virtual void dump (ostream &strm) const
 dumps information about this object More...
 
virtual void end_response ()
 end the response More...
 
virtual void end_tag (const 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 (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 BESInfoBuildXMLInfo (const string &info_type)
 

Protected Member Functions

virtual void begin_tag (const string &tag_name, const string &ns, const string &uri, map< string, string > *attrs=0)
 begin a tagged part of the information, information to follow More...
 

Protected Attributes

bool _buffered
 
string _response_name
 
bool _response_started
 
ostream * _strm
 
bool _strm_owned
 
stack< string > _tags
 

Detailed Description

An informational response object that is formated as an XML document.

See also
BESInfo
BESResponseObject

Definition at line 48 of file BESXMLInfo.h.

Constructor & Destructor Documentation

◆ BESXMLInfo()

BESXMLInfo::BESXMLInfo ( )
See also
BESInfo
BESResponseObject

Definition at line 49 of file BESXMLInfo.cc.

Member Function Documentation

◆ add_break()

void BESXMLInfo::add_break ( unsigned long  num_breaks)
virtual
Parameters
num_breaksthe number of line breaks to add to the information

Implements BESInfo.

Definition at line 476 of file BESXMLInfo.cc.

References BESInfo::add_data().

◆ add_data()

void BESXMLInfo::add_data ( const string &  s)
virtual
Parameters
sinformation to be added to this informational response object

Reimplemented from BESInfo.

Definition at line 487 of file BESXMLInfo.cc.

References BESInfo::add_data().

◆ add_data_from_file()

void BESXMLInfo::add_data_from_file ( const string &  key,
const string &  name 
)
virtual

This method simply adds a .XML to the end of the key and passes the request on up to the BESInfo parent class.

Parameters
keyKey from the initialization file specifying the file to be
nameA description of what is the information being loaded

Reimplemented from BESInfo.

Definition at line 501 of file BESXMLInfo.cc.

References BESInfo::add_data_from_file(), begin_tag(), and end_tag().

◆ add_exception()

void BESInfo::add_exception ( BESError e,
const string &  admin 
)
virtualinherited

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.

Parameters
eThe exception to add to the informational response object
adminThe contact information for the person responsible for this error

Reimplemented in BESVersionInfo, BESDapErrorInfo, and BESSilentInfo.

Definition at line 222 of file BESInfo.cc.

References BESError::get_error_type(), BESError::get_file(), BESError::get_line(), and BESError::get_message().

◆ add_space()

void BESXMLInfo::add_space ( unsigned long  num_spaces)
virtual
Parameters
num_spacesthe number of spaces to add to the information

Implements BESInfo.

Definition at line 461 of file BESXMLInfo.cc.

References BESInfo::add_data().

◆ add_tag()

void BESXMLInfo::add_tag ( const string &  tag_name,
const string &  tag_data,
map< string, string > *  attrs = 0 
)
virtual
Parameters
tag_namename of the tag to be added to the response
tag_datainformation describing the tag
attrsmap of attributes to add to the tag

Implements BESInfo.

Definition at line 275 of file BESXMLInfo.cc.

◆ begin_response()

void BESXMLInfo::begin_response ( const string &  response_name,
BESDataHandlerInterface dhi 
)
virtual

This will add the response name as well as the <response> tag tot he informational response object

Parameters
response_namename of the response this information represents
dhiinformation about the request and response

Reimplemented from BESInfo.

Definition at line 99 of file BESXMLInfo.cc.

References BESInfo::begin_response(), and BESDataHandlerInterface::data.

◆ begin_tag() [1/2]

void BESXMLInfo::begin_tag ( const string &  tag_name,
const string &  ns,
const string &  uri,
map< string, string > *  attrs = 0 
)
protectedvirtual
Parameters
tag_namename of the tag to begin
nsnamespace name to include in the tag
urinamespace uri
attrsmap of attributes to begin the tag with

Definition at line 356 of file BESXMLInfo.cc.

◆ begin_tag() [2/2]

void BESXMLInfo::begin_tag ( const string &  tag_name,
map< string, string > *  attrs = 0 
)
virtual
Parameters
tag_namename of the tag to begin
attrsmap of attributes to begin the tag with

Reimplemented from BESInfo.

Definition at line 342 of file BESXMLInfo.cc.

References begin_tag().

◆ dump()

void BESXMLInfo::dump ( ostream &  strm) const
virtual

Displays the pointer value of this instance along with information about this XML informational object.

Parameters
strmC++ i/o stream to dump the information to

Reimplemented from BESInfo.

Definition at line 555 of file BESXMLInfo.cc.

References BESInfo::dump().

◆ end_response()

void BESXMLInfo::end_response ( )
virtual

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 211 of file BESXMLInfo.cc.

◆ end_tag()

void BESXMLInfo::end_tag ( const string &  tag_name)
virtual

If the named tag is not the current tag then an error is thrown.

Parameters
tag_namename of the tag to end

Reimplemented from BESInfo.

Definition at line 423 of file BESXMLInfo.cc.

◆ is_buffered()

virtual bool BESInfo::is_buffered ( )
inlinevirtualinherited
Returns
true if information is buffered, false if not

Definition at line 123 of file BESInfo.h.

◆ print()

void BESXMLInfo::print ( ostream &  strm)
virtual
Parameters
strmoutput to this stream

Reimplemented from BESInfo.

Definition at line 538 of file BESXMLInfo.cc.

References end_response().

◆ transmit()

void BESXMLInfo::transmit ( BESTransmitter transmitter,
BESDataHandlerInterface dhi 
)
virtual

use the send_text method on the transmitter to transmit the information back to the client.

Parameters
transmitterThe type of transmitter to use to transmit the info
dhiinformation to help with the transmission

Implements BESInfo.

Definition at line 522 of file BESXMLInfo.cc.

References end_response().


The documentation for this class was generated from the following files: