BESTextInfo Class Reference

#include <BESTextInfo.h>

Inheritance diagram for BESTextInfo:

Inheritance graph
[legend]
Collaboration diagram for BESTextInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BESTextInfo (bool ishttp=false)
 constructs a basic text information response object.
 BESTextInfo (const string &key, 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 (BESException &e)
 add exception information to this informational object
virtual void print (FILE *out)
 print the information from this informational object to the specified FILE descriptor
virtual bool set_buffered (bool buffered)
 return whether the information is to be buffered or not.
virtual bool is_buffered ()
 return whether the information is to be buffered or not.

Static Public Member Functions

static BESInfoBuildTextInfo (const string &info_type)

Protected Attributes

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

Detailed Description

brief represents simple text information in a response object, such as version and help inforamtion.

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.

See also:
BESInfo

BESResponseObject


Constructor & Destructor Documentation

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.

See also:
BESInfo

BESResponseObject

BESTextInfo::BESTextInfo const string &  key,
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.

See also:
BESInfo

BESResponseObject

BESTextInfo::~BESTextInfo  )  [virtual]
 


Member Function Documentation

void BESTextInfo::add_break unsigned long  num_breaks  )  [virtual]
 

add a line break to the information

Parameters:
num_breaks the number of line breaks to add to the information

Implements BESInfo.

void BESTextInfo::add_data const string &  s  )  [virtual]
 

add string data to the informational response

Parameters:
s string data to add the informational response

Reimplemented from BESInfo.

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.

Parameters:
key Key from the initialization file specifying the file to be
name A description of what is the information being loaded

Reimplemented from BESInfo.

void BESInfo::add_exception BESException e  )  [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.

Parameters:
type The type of exception being thrown
e The exception to add to the informational response object

Reimplemented in BESSilentInfo, and BESVersionInfo.

void BESTextInfo::add_space unsigned long  num_spaces  )  [virtual]
 

add a space to the informational response

Parameters:
num_spaces the number of spaces to add to the information

Implements BESInfo.

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

Parameters:
tag_name name of the tag to be added to the response
tag_data information describing the tag

Implements BESInfo.

void BESTextInfo::begin_response const string &  response_name  )  [virtual]
 

begin the informational response

Because this is text informational object, no begin tags are needed

Parameters:
response_name name of the response this information represents

Reimplemented from BESInfo.

void BESTextInfo::begin_tag const string &  tag_name,
map< string, string > *  attrs = 0
[virtual]
 

begin a tagged part of the information, information to follow

Parameters:
tag_name name of the tag to begin

Reimplemented from BESInfo.

BESInfo * BESTextInfo::BuildTextInfo const string &  info_type  )  [static]
 

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

Parameters:
strm C++ i/o stream to dump the information to

Reimplemented from BESInfo.

void BESInfo::end_response  )  [virtual, inherited]
 

Reimplemented in BESHTMLInfo, BESVersionInfo, and BESXMLInfo.

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.

Parameters:
tag_name name of the tag to end

Reimplemented from BESInfo.

virtual bool BESInfo::is_buffered  )  [inline, virtual, inherited]
 

return whether the information is to be buffered or not.

Returns:
true if information is buffered, false if not

void BESInfo::print FILE *  out  )  [virtual, inherited]
 

print the information from this informational object to the specified FILE descriptor

If the information was not buffered then this method does nothing, otherwise the information is output to the specified FILE descriptor.

Parameters:
out output to this file descriptor if information buffered.

Reimplemented in BESSilentInfo, BESVersionInfo, and BESXMLInfo.

virtual bool BESInfo::set_buffered bool  buffered  )  [inline, virtual, inherited]
 

return whether the information is to be buffered or not.

Returns:
true if information is buffered, false if not

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.

Parameters:
transmitter The type of transmitter to use to transmit the info
dhi information to help with the transmission

Implements BESInfo.


Member Data Documentation

bool BESInfo::_buffered [protected, inherited]
 

string BESInfo::_response_name [protected, inherited]
 

bool BESInfo::_response_started [protected, inherited]
 

ostream* BESInfo::_strm [protected, inherited]
 

stack<string> BESInfo::_tags [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Tue Feb 13 11:16:36 2007 for OPeNDAP Back End Server (BES) by  doxygen 1.4.6