39 using std::ostringstream ;
46 #define BES_INFO_FILE_BUFFER_SIZE 4096 58 _strm =
new ostringstream ;
84 if( b ==
"true" || b ==
"True" || b ==
"TRUE" ||
85 b ==
"yes" || b ==
"Yes" || b ==
"YES" )
87 _strm =
new ostringstream ;
90 if( strm && strm_owned )
97 string s =
"Informational response not buffered but no stream passed" ;
136 string s =
"Not all tags were ended in info response" ;
143 map<string,string> *attrs )
145 _tags.push( tag_name ) ;
151 if(
_tags.size() == 0 ||
_tags.top() != tag_name )
153 string s = (string)
"tag " + tag_name
154 +
" already ended or not started" ;
207 +
" not found, information not available\n" ) ;
211 ifstream ifs( file.c_str() ) ;
212 int myerrno = errno ;
215 string serr = name +
" file " + file
216 +
" not found, information not available: " ;
217 char *err = strerror( myerrno ) ;
221 serr +=
"Unknown error" ;
258 ostringstream stype ;
260 add_tag(
"Type", stype.str() ) ;
262 add_tag(
"Administrator", admin ) ;
266 ostringstream sline ;
268 add_tag(
"Line", sline.str() ) ;
287 strm << ((ostringstream *)
_strm)->str() ;
302 << (
void *)
this <<
")" << endl ;
311 stack<string> temp_tags =
_tags ;
312 while( !temp_tags.empty() )
314 string tag = temp_tags.top() ;
virtual void end_response()
virtual void dump(ostream &strm) const
Displays debug information about this object.
exception thrown if inernal error encountered
virtual void add_data_from_file(const string &key, const string &name)
add data from a file to the informational object.
BESInfo()
constructs a BESInfo object
virtual void add_tag(const string &tag_name, const string &tag_data, map< string, string > *attrs=0)=0
virtual int get_error_type()
Return the return code for this error class.
virtual string get_file()
get the file name where the exception was thrown
virtual string get_message()
get the error message for this exception
Abstract exception class for the BES with basic string message.
virtual void add_exception(BESError &e, const string &admin)
add exception information to this informational object
virtual void begin_tag(const string &tag_name, map< string, string > *attrs=0)
static ostream & LMarg(ostream &strm)
void get_value(const string &s, string &val, bool &found)
Retrieve the value of a given key, if set.
Structure storing information used by the BES to handle the request.
#define BES_INFO_FILE_BUFFER_SIZE
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
virtual void add_data(const string &s)
add data to this informational object.
virtual void print(ostream &strm)
print the information from this informational object to the specified stream
static BESKeys * TheKeys()
virtual void end_tag(const string &tag_name)
virtual int get_line()
get the line number where the exception was thrown