bes  Updated for version 3.17.4
BESDapErrorInfo.cc
1 // BESDapErrorInfo.cc
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 //
23 // You can contact University Corporation for Atmospheric Research at
24 // 3080 Center Green Drive, Boulder, CO 80301
25 
26 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
28 //
29 // Authors:
30 // pwest Patrick West <pwest@ucar.edu>
31 // jgarcia Jose Garcia <jgarcia@ucar.edu>
32 
33 #include "BESDapErrorInfo.h"
34 
38 BESDapErrorInfo::BESDapErrorInfo( ErrorCode ec, const string &msg )
39  :BESInfo( ),
40  _error_code( ec ),
41  _error_msg( msg )
42 {
43 }
44 
45 BESDapErrorInfo::~BESDapErrorInfo()
46 {
47 }
48 
56 void
57 BESDapErrorInfo::begin_response( const string &response_name,
59 {
60  BESInfo::begin_response( response_name, dhi ) ;
61 }
62 
69 void
70 BESDapErrorInfo::add_tag( const string & /*tag_name*/,
71  const string & /*tag_data*/,
72  map<string,string> * /*attrs*/ )
73 {
74 }
75 
81 void
82 BESDapErrorInfo::begin_tag( const string &tag_name ,
83  map<string,string> * /*attrs*/ )
84 {
85  BESInfo::begin_tag( tag_name ) ;
86 }
87 
94 void
95 BESDapErrorInfo::end_tag( const string &tag_name )
96 {
97  BESInfo::end_tag( tag_name ) ;
98 }
99 
106 void
107 BESDapErrorInfo::add_data( const string & /*s*/ )
108 {
109 }
110 
117 void
118 BESDapErrorInfo::add_space( unsigned long /*num_spaces*/ )
119 {
120 }
121 
128 void
129 BESDapErrorInfo::add_break( unsigned long /*num_breaks*/ )
130 {
131 }
132 
139 void
140 BESDapErrorInfo::add_data_from_file( const string & /*key*/,
141  const string & /*name*/ )
142 {
143 }
144 
151 void
152 BESDapErrorInfo::add_exception( BESError & /*e*/, const string & /*admin*/ )
153 {
154 }
155 
163 void
166 {
167  transmitter->send_text( *this, dhi ) ;
168 }
169 
174 void
175 BESDapErrorInfo::print( ostream &strm )
176 {
177  Error new_e( _error_code, _error_msg ) ;
178  new_e.print( strm ) ;
179 }
180 
188 void
189 BESDapErrorInfo::dump( ostream &strm ) const
190 {
191  strm << BESIndent::LMarg << "BESDapErrorInfo::dump - ("
192  << (void *)this << ")" << endl ;
193  BESIndent::Indent() ;
194  BESInfo::dump( strm ) ;
195  BESIndent::UnIndent() ;
196 }
197 
virtual void dump(ostream &strm) const
Displays debug information about this object.
Definition: BESInfo.cc:263
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit this informational object
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 add_break(unsigned long num_breaks)
add a line break to the information
virtual void add_tag(const string &tag_name, const string &tag_data, map< string, string > *attrs=0)
add tagged information to the informational response
informational response object
Definition: BESInfo.h:68
Abstract exception class for the BES with basic string message.
Definition: BESError.h:56
virtual void print(ostream &strm)
ignore printing the information
virtual void add_space(unsigned long num_spaces)
add a space to the informational response
virtual void add_exception(BESError &e, const string &admin)
ignore exception data to this informational object.
Structure storing information used by the BES to handle the request.
virtual void add_data(const string &s)
add data to the informational object
virtual void begin_response(const string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Definition: BESInfo.cc:112
virtual void dump(ostream &strm) const
dumps information about this object
virtual void add_data_from_file(const string &key, const string &name)
ignore data from a file to the informational object.
virtual void end_tag(const string &tag_name)
end a tagged part of the informational response