<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>libdap++: Error.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>Error.h</h1><a href="Error_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00002"></a>00002 <span class="comment">// -*- mode: c++; c-basic-offset:4 -*-</span> <a name="l00003"></a>00003 <a name="l00004"></a>00004 <span class="comment">// This file is part of libdap, A C++ implementation of the OPeNDAP Data</span> <a name="l00005"></a>00005 <span class="comment">// Access Protocol.</span> <a name="l00006"></a>00006 <a name="l00007"></a>00007 <span class="comment">// Copyright (c) 2002,2003 OPeNDAP, Inc.</span> <a name="l00008"></a>00008 <span class="comment">// Author: James Gallagher <jgallagher@opendap.org></span> <a name="l00009"></a>00009 <span class="comment">//</span> <a name="l00010"></a>00010 <span class="comment">// This library is free software; you can redistribute it and/or</span> <a name="l00011"></a>00011 <span class="comment">// modify it under the terms of the GNU Lesser General Public</span> <a name="l00012"></a>00012 <span class="comment">// License as published by the Free Software Foundation; either</span> <a name="l00013"></a>00013 <span class="comment">// version 2.1 of the License, or (at your option) any later version.</span> <a name="l00014"></a>00014 <span class="comment">//</span> <a name="l00015"></a>00015 <span class="comment">// This library is distributed in the hope that it will be useful,</span> <a name="l00016"></a>00016 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00017"></a>00017 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00018"></a>00018 <span class="comment">// Lesser General Public License for more details.</span> <a name="l00019"></a>00019 <span class="comment">//</span> <a name="l00020"></a>00020 <span class="comment">// You should have received a copy of the GNU Lesser General Public</span> <a name="l00021"></a>00021 <span class="comment">// License along with this library; if not, write to the Free Software</span> <a name="l00022"></a>00022 <span class="comment">// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> <a name="l00023"></a>00023 <span class="comment">//</span> <a name="l00024"></a>00024 <span class="comment">// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="comment">// (c) COPYRIGHT URI/MIT 1999,2000</span> <a name="l00027"></a>00027 <span class="comment">// Please read the full copyright statement in the file COPYRIGHT_URI.</span> <a name="l00028"></a>00028 <span class="comment">//</span> <a name="l00029"></a>00029 <span class="comment">// Authors:</span> <a name="l00030"></a>00030 <span class="comment">// jhrg,jimg James Gallagher <jgallagher@gso.uri.edu></span> <a name="l00031"></a>00031 <a name="l00032"></a>00032 <span class="comment">// Interface for the Error class</span> <a name="l00033"></a>00033 <span class="comment">//</span> <a name="l00034"></a>00034 <span class="comment">// jhrg 4/23/96</span> <a name="l00035"></a>00035 <a name="l00036"></a>00036 <span class="preprocessor">#ifndef _error_h</span> <a name="l00037"></a>00037 <span class="preprocessor"></span><span class="preprocessor">#define _error_h</span> <a name="l00038"></a>00038 <span class="preprocessor"></span> <a name="l00039"></a>00039 <span class="preprocessor">#include <cstdio></span> <span class="comment">// For FILE *</span> <a name="l00040"></a>00040 <span class="preprocessor">#include <iostream></span> <a name="l00041"></a>00041 <span class="preprocessor">#include <string></span> <a name="l00042"></a>00042 <a name="l00043"></a>00043 <span class="keyword">using</span> std::cout; <a name="l00044"></a>00044 <span class="keyword">using</span> std::string; <a name="l00045"></a>00045 <span class="keyword">using</span> std::ostream; <a name="l00046"></a>00046 <a name="l00047"></a>00047 <span class="keyword">namespace </span>libdap <a name="l00048"></a>00048 { <a name="l00049"></a>00049 <a name="l00055"></a><a class="code" href="namespacelibdap.html#4d08204a35e99e555cda79022648362f">00055</a> <span class="keyword">typedef</span> <span class="keywordtype">int</span> <a class="code" href="namespacelibdap.html#4d08204a35e99e555cda79022648362f" title="An enumerated type for common errors.">ErrorCode</a>; <span class="comment">//using standard errno+netCDF error codes from server</span> <a name="l00056"></a>00056 <a name="l00059"></a><a class="code" href="Error_8h.html#48926e61b0a4fd4bdfded04ba1c06793">00059</a> <span class="preprocessor">#define undefined_error 1000 </span> <a name="l00060"></a><a class="code" href="Error_8h.html#40b0db75d00d0338a597aa84e71109bf">00060</a> <span class="preprocessor">#define unknown_error 1001 </span> <a name="l00061"></a><a class="code" href="Error_8h.html#462c17e7e8b2753700f2d369b361cb68">00061</a> <span class="preprocessor">#define internal_error 1002 </span> <a name="l00062"></a><a class="code" href="Error_8h.html#86fafcd8662f15e128d1d9b6cc0185ef">00062</a> <span class="preprocessor">#define no_such_file 1003</span> <a name="l00063"></a><a class="code" href="Error_8h.html#7827d6d4b379bc2cefa54fb2950fe124">00063</a> <span class="preprocessor"></span><span class="preprocessor">#define no_such_variable 1004</span> <a name="l00064"></a><a class="code" href="Error_8h.html#5806d25bc779e86c285438e687669803">00064</a> <span class="preprocessor"></span><span class="preprocessor">#define malformed_expr 1005</span> <a name="l00065"></a><a class="code" href="Error_8h.html#2822ec0f2748b4e0d08ac848c893b444">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define no_authorization 1006</span> <a name="l00066"></a><a class="code" href="Error_8h.html#bfb3e05b1e44bdd0f9be651a01ba464b">00066</a> <span class="preprocessor"></span><span class="preprocessor">#define cannot_read_file 1007</span> <a name="l00067"></a><a class="code" href="Error_8h.html#24d2864722eedd4643b427f8d185c245">00067</a> <span class="preprocessor"></span><span class="preprocessor">#define dummy_message 1008 // Dumplicate of 1007; see Error.cc</span> <a name="l00068"></a>00068 <span class="preprocessor"></span> <a name="l00070"></a>00070 <a name="l00090"></a><a class="code" href="classlibdap_1_1Error.html">00090</a> <span class="keyword">class </span><a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> <a name="l00091"></a>00091 { <a name="l00092"></a>00092 <span class="keyword">protected</span>: <a name="l00093"></a><a class="code" href="classlibdap_1_1Error.html#30226017ae9dfbe2e27be502b4fbdef4">00093</a> <a class="code" href="namespacelibdap.html#4d08204a35e99e555cda79022648362f" title="An enumerated type for common errors.">ErrorCode</a> <a class="code" href="classlibdap_1_1Error.html#30226017ae9dfbe2e27be502b4fbdef4">_error_code</a>; <a name="l00094"></a><a class="code" href="classlibdap_1_1Error.html#86b1ed1e500e2ad6bbcfdd046b870728">00094</a> <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1Error.html#86b1ed1e500e2ad6bbcfdd046b870728">_error_message</a>; <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="keyword">public</span>: <a name="l00097"></a>00097 <a class="code" href="classlibdap_1_1Error.html#0d75f4244ed27998bf2e5e031bc1bf4b">Error</a>(<a class="code" href="namespacelibdap.html#4d08204a35e99e555cda79022648362f" title="An enumerated type for common errors.">ErrorCode</a> ec, <span class="keywordtype">string</span> msg); <a name="l00098"></a>00098 <a class="code" href="classlibdap_1_1Error.html#0d75f4244ed27998bf2e5e031bc1bf4b">Error</a>(<span class="keywordtype">string</span> msg); <a name="l00099"></a>00099 <a class="code" href="classlibdap_1_1Error.html#0d75f4244ed27998bf2e5e031bc1bf4b">Error</a>(); <a name="l00100"></a>00100 <a name="l00101"></a>00101 <a class="code" href="classlibdap_1_1Error.html#0d75f4244ed27998bf2e5e031bc1bf4b">Error</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> &copy_from); <a name="l00102"></a>00102 <a name="l00103"></a>00103 <span class="keyword">virtual</span> <a class="code" href="classlibdap_1_1Error.html#746f8a7ae2a12f2c8f5c7b6d0e5c6283">~Error</a>(); <a name="l00104"></a>00104 <a name="l00105"></a>00105 <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> &<a class="code" href="classlibdap_1_1Error.html#351366d737b8b5899e68599b055fd596">operator=</a>(<span class="keyword">const</span> <a class="code" href="classlibdap_1_1Error.html" title="A class for error processing.">Error</a> &rhs); <a name="l00106"></a>00106 <a name="l00107"></a>00107 <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1Error.html#5624b1cca8a752a24d76a50e092fd61e" title="Is the Error object valid?">OK</a>() <span class="keyword">const</span>; <a name="l00108"></a>00108 <span class="keywordtype">bool</span> <a class="code" href="classlibdap_1_1Error.html#c705b3c1cfab1f7530d66a974eb0e8b6" title="Parse an Error object.">parse</a>(FILE *fp); <a name="l00109"></a>00109 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Error.html#f2185ebeb4236e2902abda772a2b5a49">print</a>(FILE *out) <span class="keyword">const</span>; <a name="l00110"></a>00110 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Error.html#f2185ebeb4236e2902abda772a2b5a49">print</a>(ostream &out) <span class="keyword">const</span>; <a name="l00111"></a>00111 <a class="code" href="namespacelibdap.html#4d08204a35e99e555cda79022648362f" title="An enumerated type for common errors.">ErrorCode</a> <a class="code" href="classlibdap_1_1Error.html#207b7ba3e52b236a5c48440525c99ab8">get_error_code</a>() <span class="keyword">const</span>; <a name="l00112"></a>00112 <span class="keywordtype">string</span> <a class="code" href="classlibdap_1_1Error.html#917fdf537b7dd7e587e9cf6dc7e4c687">get_error_message</a>() <span class="keyword">const</span>; <a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Error.html#47c0f4b6a38d8ca075d1056076d2845d">set_error_code</a>(<a class="code" href="namespacelibdap.html#4d08204a35e99e555cda79022648362f" title="An enumerated type for common errors.">ErrorCode</a> ec = <a class="code" href="Error_8h.html#48926e61b0a4fd4bdfded04ba1c06793" title="Undefined error code.">undefined_error</a>); <a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="classlibdap_1_1Error.html#f48fc071e737b88925dfd0bff8995304">set_error_message</a>(<span class="keywordtype">string</span> msg = <span class="stringliteral">""</span>); <a name="l00115"></a>00115 }; <a name="l00116"></a>00116 <a name="l00117"></a>00117 } <span class="comment">// namespace libdap</span> <a name="l00118"></a>00118 <a name="l00119"></a>00119 <span class="preprocessor">#endif // _error_h</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Oct 7 19:57:07 2009 for libdap++ by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>