bes  Updated for version 3.20.6
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 
35 using std::endl;
36 using std::map;
37 
41 BESDapErrorInfo::BESDapErrorInfo(ErrorCode ec, const string &msg) :
42  BESInfo(), _error_code(ec), _error_msg(msg)
43 {
44 }
45 
46 BESDapErrorInfo::~BESDapErrorInfo()
47 {
48 }
49 
57 void BESDapErrorInfo::begin_response(const string &response_name, BESDataHandlerInterface &dhi)
58 {
59  BESInfo::begin_response(response_name, dhi);
60 }
61 
68 void BESDapErrorInfo::add_tag(const string & /*tag_name*/, const string & /*tag_data*/, map<string, string> * /*attrs*/)
69 {
70 }
71 
77 void BESDapErrorInfo::begin_tag(const string &tag_name, map<string, string> * /*attrs*/)
78 {
79  BESInfo::begin_tag(tag_name);
80 }
81 
88 void BESDapErrorInfo::end_tag(const string &tag_name)
89 {
90  BESInfo::end_tag(tag_name);
91 }
92 
99 void BESDapErrorInfo::add_data(const string & /*s*/)
100 {
101 }
102 
109 void BESDapErrorInfo::add_space(unsigned long /*num_spaces*/)
110 {
111 }
112 
119 void BESDapErrorInfo::add_break(unsigned long /*num_breaks*/)
120 {
121 }
122 
129 void BESDapErrorInfo::add_data_from_file(const string & /*key*/, const string & /*name*/)
130 {
131 }
132 
139 void BESDapErrorInfo::add_exception(BESError & /*e*/, const string & /*admin*/)
140 {
141 }
142 
151 {
152  transmitter->send_text(*this, dhi);
153 }
154 
159 void BESDapErrorInfo::print(ostream &strm)
160 {
161  Error new_e(_error_code, _error_msg);
162  new_e.print(strm);
163 }
164 
172 void BESDapErrorInfo::dump(ostream &strm) const
173 {
174  strm << BESIndent::LMarg << "BESDapErrorInfo::dump - (" << (void *) this << ")" << endl;
175  BESIndent::Indent();
176  BESInfo::dump(strm);
177  BESIndent::UnIndent();
178 }
179 
BESDapErrorInfo::add_data
virtual void add_data(const std::string &s)
add data to the informational object
Definition: BESDapErrorInfo.cc:99
BESDapErrorInfo::print
virtual void print(std::ostream &strm)
ignore printing the information
Definition: BESDapErrorInfo.cc:159
BESDapErrorInfo::end_tag
virtual void end_tag(const std::string &tag_name)
end a tagged part of the informational response
Definition: BESDapErrorInfo.cc:88
BESDapErrorInfo::add_break
virtual void add_break(unsigned long num_breaks)
add a line break to the information
Definition: BESDapErrorInfo.cc:119
BESDapErrorInfo::add_tag
virtual void add_tag(const std::string &tag_name, const std::string &tag_data, std::map< std::string, std::string > *attrs=0)
add tagged information to the informational response
Definition: BESDapErrorInfo.cc:68
BESDapErrorInfo::add_space
virtual void add_space(unsigned long num_spaces)
add a space to the informational response
Definition: BESDapErrorInfo.cc:109
BESDapErrorInfo::begin_tag
virtual void begin_tag(const std::string &tag_name, std::map< std::string, std::string > *attrs=0)
begin a tagged part of the information, information to follow
Definition: BESDapErrorInfo.cc:77
BESInfo
informational response object
Definition: BESInfo.h:63
BESDapErrorInfo::add_data_from_file
virtual void add_data_from_file(const std::string &key, const std::string &name)
ignore data from a file to the informational object.
Definition: BESDapErrorInfo.cc:129
BESTransmitter
Definition: BESTransmitter.h:47
BESDapErrorInfo::transmit
virtual void transmit(BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
transmit this informational object
Definition: BESDapErrorInfo.cc:150
BESDapErrorInfo::dump
virtual void dump(std::ostream &strm) const
dumps information about this object
Definition: BESDapErrorInfo.cc:172
BESInfo::dump
virtual void dump(std::ostream &strm) const
Displays debug information about this object.
Definition: BESInfo.cc:275
Error
BESInfo::begin_response
virtual void begin_response(const std::string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Definition: BESInfo.cc:124
BESDataHandlerInterface
Structure storing information used by the BES to handle the request.
Definition: BESDataHandlerInterface.h:56
BESError
Abstract exception class for the BES with basic string message.
Definition: BESError.h:58
BESDapErrorInfo::add_exception
virtual void add_exception(BESError &e, const std::string &admin)
ignore exception data to this informational object.
Definition: BESDapErrorInfo.cc:139
BESDapErrorInfo::begin_response
virtual void begin_response(const std::string &response_name, BESDataHandlerInterface &dhi)
begin the informational response
Definition: BESDapErrorInfo.cc:57