1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>oberror.h Source File</title>
<link href="/site.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="search/search.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!--#include file="header.html" -->
<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.shtml"><span>Main Page</span></a></li>
<li><a href="pages.shtml"><span>Related Pages</span></a></li>
<li><a href="modules.shtml"><span>Modules</span></a></li>
<li><a href="namespaces.shtml"><span>Namespaces</span></a></li>
<li><a href="annotated.shtml"><span>Classes</span></a></li>
<li class="current"><a href="files.shtml"><span>Files</span></a></li>
<li><a href="examples.shtml"><span>Examples</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.shtml"><span>File List</span></a></li>
<li><a href="globals.shtml"><span>File Members</span></a></li>
</ul>
</div>
<div class="header">
<div class="headertitle">
<div class="title">oberror.h</div> </div>
</div>
<div class="contents">
<a href="oberror_8h.shtml">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**********************************************************************</span>
<a name="l00002"></a>00002 <span class="comment">oberror.h - Handle error messages, warnings, notices, etc.</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">Copyright (C) 2002 by Stefan Kebekus</span>
<a name="l00005"></a>00005 <span class="comment">Some portions Copyright (C) 2003-2006 by Geoffrey R. Hutchison</span>
<a name="l00006"></a>00006 <span class="comment"></span>
<a name="l00007"></a>00007 <span class="comment">This file is part of the Open Babel project.</span>
<a name="l00008"></a>00008 <span class="comment">For more information, see <http://openbabel.org/></span>
<a name="l00009"></a>00009 <span class="comment"></span>
<a name="l00010"></a>00010 <span class="comment">This program is free software; you can redistribute it and/or modify</span>
<a name="l00011"></a>00011 <span class="comment">it under the terms of the GNU General Public License as published by</span>
<a name="l00012"></a>00012 <span class="comment">the Free Software Foundation version 2 of the License.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">This program is distributed in the hope that it will be useful, but</span>
<a name="l00015"></a>00015 <span class="comment">WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00016"></a>00016 <span class="comment">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span>
<a name="l00017"></a>00017 <span class="comment">General Public License for more details.</span>
<a name="l00018"></a>00018 <span class="comment">***********************************************************************/</span>
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="preprocessor">#ifndef OB_ERROR_H</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define OB_ERROR_H</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00023"></a>00023 <span class="preprocessor">#include <openbabel/babelconfig.h></span>
<a name="l00024"></a>00024
<a name="l00025"></a>00025 <span class="preprocessor">#include <iosfwd></span>
<a name="l00026"></a>00026 <span class="preprocessor">#include <sstream></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include <string></span>
<a name="l00028"></a>00028 <span class="preprocessor">#include <vector></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include <deque></span>
<a name="l00030"></a>00030
<a name="l00031"></a>00031 <span class="preprocessor">#ifndef OBERROR</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define OBERROR</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span>
<a name="l00035"></a>00035 <span class="keyword">namespace </span>OpenBabel
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037
<a name="l00039"></a><a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9">00039</a> <span class="keyword">enum</span> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> {
<a name="l00040"></a><a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afbf66ee4ae8ad04bc5003a16aa9b2b77">00040</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afbf66ee4ae8ad04bc5003a16aa9b2b77" title="for critical errors (e.g., cannot read a file)">obError</a>,
<a name="l00041"></a><a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a600e966aac7d34fec05f2067eb6b989b">00041</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a600e966aac7d34fec05f2067eb6b989b" title="for non-critical problems (e.g., molecule appears empty)">obWarning</a>,
<a name="l00042"></a><a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a8239e6e8daa5c812be192e6447979814">00042</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a8239e6e8daa5c812be192e6447979814" title="for informative messages (e.g., file is a non-standard format)">obInfo</a>,
<a name="l00043"></a><a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afca370a4ce993c0a266c7d120c3a6310">00043</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afca370a4ce993c0a266c7d120c3a6310" title="for messages auditing methods which destroy or perceive molecular data (e.g., kekulization, atom typing, etc.)">obAuditMsg</a>,
<a name="l00044"></a><a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afd56eb19b254da4133c9c28f7cccf5ce">00044</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afd56eb19b254da4133c9c28f7cccf5ce" title="for messages only useful for debugging purposes">obDebug</a>
<a name="l00045"></a>00045 };
<a name="l00046"></a>00046
<a name="l00047"></a><a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82ae7f48063a6bfea08184eda6c5eba743b">00047</a> <span class="keyword">enum</span> <a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82">errorQualifier</a> {<a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82a94bec3e41bc9810307020aaae030baa5">always</a>, <a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82ae7f48063a6bfea08184eda6c5eba743b">onceOnly</a>};
<a name="l00048"></a>00048
<a name="l00052"></a><a class="code" href="classOpenBabel_1_1OBError.shtml">00052</a> <span class="keyword">class </span>OBERROR <a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>
<a name="l00053"></a>00053 {
<a name="l00054"></a>00054 <span class="keyword">public</span>:
<a name="l00055"></a>00055
<a name="l00057"></a>00057 <a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>( <span class="keyword">const</span> std::string &method = <span class="stringliteral">""</span>,
<a name="l00058"></a>00058 <span class="keyword">const</span> std::string &errorMsg = <span class="stringliteral">""</span>,
<a name="l00059"></a>00059 <span class="keyword">const</span> std::string &explanation = <span class="stringliteral">""</span>,
<a name="l00060"></a>00060 <span class="keyword">const</span> std::string &possibleCause = <span class="stringliteral">""</span>,
<a name="l00061"></a>00061 <span class="keyword">const</span> std::string &suggestedRemedy = <span class="stringliteral">""</span>,
<a name="l00062"></a>00062 <span class="keyword">const</span> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> = <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afd56eb19b254da4133c9c28f7cccf5ce" title="for messages only useful for debugging purposes">obDebug</a> );
<a name="l00063"></a>00063
<a name="l00065"></a>00065 std::string message(<span class="keywordtype">void</span>) <span class="keyword">const</span>;
<a name="l00066"></a>00066
<a name="l00068"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a79f2d96335566944848c00c7749286f6">00068</a> <span class="keyword">friend</span> std::ostream& <a class="code" href="namespaceOpenBabel.shtml#a70c653ee69fdbd27f77d430e4aed3cad" title="Prints a representation of the vector as a row vector of the form "<0.1,1,2>".">operator<< </a>( std::ostream &os, <span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a> &er )
<a name="l00069"></a>00069 { <span class="keywordflow">return</span> os << er.<a class="code" href="classOpenBabel_1_1OBError.shtml#a58895ce0cba9231c40070623841e2cf6">message</a>(); };
<a name="l00070"></a>00070
<a name="l00073"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#ae83765d3b6cb73748b93accfacfa04ac">00073</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#ae83765d3b6cb73748b93accfacfa04ac">GetMethod</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _method; }
<a name="l00075"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a8dd97637a04d25f1f1ebe3ecd0fa94c7">00075</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#a8dd97637a04d25f1f1ebe3ecd0fa94c7">GetError</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _errorMsg; }
<a name="l00077"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a62dab1c2b6974eb6984a1c464e3a85c9">00077</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#a62dab1c2b6974eb6984a1c464e3a85c9">GetExplanation</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _explanation; }
<a name="l00079"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#ab559c02256338e44ad62ddcf21b00cc3">00079</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#ab559c02256338e44ad62ddcf21b00cc3">GetPossibleCause</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _possibleCause; }
<a name="l00081"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a2663dcd1c88b8e71a3460abbff5830e8">00081</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#a2663dcd1c88b8e71a3460abbff5830e8">GetSuggestedRemedy</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _suggestedRemedy; }
<a name="l00083"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a7d29f141e4eb1eddddf66925372b6379">00083</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> <a class="code" href="classOpenBabel_1_1OBError.shtml#a7d29f141e4eb1eddddf66925372b6379">GetLevel</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> _level; }
<a name="l00084"></a>00084
<a name="l00085"></a>00085 <span class="keywordtype">bool</span> <a class="code" href="namespaceOpenBabel.shtml#ac001b331f648fbbd8590576f59d4d2ab">operator== </a>(<span class="keyword">const</span> <a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a>&)<span class="keyword">const</span>;
<a name="l00086"></a>00086
<a name="l00087"></a>00087 <span class="keyword">protected</span>:
<a name="l00088"></a>00088
<a name="l00090"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#ab76b110ce78dbf832f2be94de64d4393">00090</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#ab76b110ce78dbf832f2be94de64d4393" title="The method causing the error (typically from the compiler macro __FUNCTION__)">_method</a>;
<a name="l00092"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#ae555e3ad2f9ba1a05c02c8e728da3e6f">00092</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#ae555e3ad2f9ba1a05c02c8e728da3e6f" title="The actual error message.">_errorMsg</a>;
<a name="l00094"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a51f6cb8ac4c800345ad82cf63df0f9cb">00094</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#a51f6cb8ac4c800345ad82cf63df0f9cb" title="Optional explanation message: more detailed than the brief error.">_explanation</a>;
<a name="l00096"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a89443235c00d3d81208c0e339adbf6a7">00096</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#a89443235c00d3d81208c0e339adbf6a7" title="Optional cause message.">_possibleCause</a>;
<a name="l00098"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#aa04ab009d8cdab368735f2bdf66f8a73">00098</a> std::string <a class="code" href="classOpenBabel_1_1OBError.shtml#aa04ab009d8cdab368735f2bdf66f8a73" title="Optional workaround or remedy.">_suggestedRemedy</a>;
<a name="l00099"></a>00099
<a name="l00101"></a><a class="code" href="classOpenBabel_1_1OBError.shtml#a20898b53aeee396c51fb24d5fad05df0">00101</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> <a class="code" href="classOpenBabel_1_1OBError.shtml#a20898b53aeee396c51fb24d5fad05df0" title="The severity level: used for filtering via OBMessageHandler.">_level</a>;
<a name="l00102"></a>00102 };
<a name="l00103"></a>00103
<a name="l00105"></a>00105 <span class="comment">// More documentation in oberror.cpp</span>
<a name="l00106"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml">00106</a> <span class="keyword">class </span>OBERROR <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml" title="Handle error messages, warnings, debugging information and the like.">OBMessageHandler</a>
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108 <span class="keyword">protected</span>:
<a name="l00110"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a5812cd4eb01367908022f9ef86e49ec6">00110</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> _messageCount[5];
<a name="l00111"></a>00111
<a name="l00112"></a>00112 <span class="keyword">public</span>:
<a name="l00113"></a>00113 <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml" title="Handle error messages, warnings, debugging information and the like.">OBMessageHandler</a>();
<a name="l00114"></a>00114 ~<a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml" title="Handle error messages, warnings, debugging information and the like.">OBMessageHandler</a>();
<a name="l00115"></a>00115
<a name="l00117"></a>00117 <span class="keywordtype">void</span> <a class="code" href="namespaceOpenBabel.shtml#a32ba50e0b43cb1dfdf1978d1e72099c5">ThrowError</a>(<a class="code" href="classOpenBabel_1_1OBError.shtml" title="Customizable error handling and logging -- store a message, including the method yielding the error...">OBError</a> err, <a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82">errorQualifier</a> qqualifier = <a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82a94bec3e41bc9810307020aaae030baa5">always</a>);
<a name="l00119"></a>00119 <span class="keywordtype">void</span> <a class="code" href="namespaceOpenBabel.shtml#a32ba50e0b43cb1dfdf1978d1e72099c5">ThrowError</a>(<span class="keyword">const</span> std::string &method, <span class="keyword">const</span> std::string &errorMsg,
<a name="l00120"></a>00120 <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> level = <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afd56eb19b254da4133c9c28f7cccf5ce" title="for messages only useful for debugging purposes">obDebug</a>, <a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82">errorQualifier</a> qualifier = <a class="code" href="namespaceOpenBabel.shtml#a91e6912277f7537a670952698f7b2d82a94bec3e41bc9810307020aaae030baa5">always</a>);
<a name="l00121"></a>00121
<a name="l00123"></a>00123 std::vector<std::string> GetMessagesOfLevel(<span class="keyword">const</span> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a>);
<a name="l00124"></a>00124
<a name="l00126"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a2ddeff91a6a4f113be67243d32aae4f0">00126</a> <span class="keywordtype">void</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a2ddeff91a6a4f113be67243d32aae4f0" title="Start logging messages (default)">StartLogging</a>() { _logging = <span class="keyword">true</span>; }
<a name="l00128"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a08d309e66bc4091df861de396b6dd4a4">00128</a> <span class="keywordtype">void</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a08d309e66bc4091df861de396b6dd4a4" title="Stop logging messages completely.">StopLogging</a>() { _logging = <span class="keyword">false</span>; }
<a name="l00129"></a>00129
<a name="l00131"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a77f52cdbd233a78a86a17fdbc5b1aeba">00131</a> <span class="keywordtype">void</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a77f52cdbd233a78a86a17fdbc5b1aeba" title="Set the maximum number of entries (or 0 for no limit)">SetMaxLogEntries</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> max) { _maxEntries = max; }
<a name="l00133"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#ad5cc775d9bcbe374ba8e3a7706441187">00133</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#ad5cc775d9bcbe374ba8e3a7706441187">GetMaxLogEntries</a>() { <span class="keywordflow">return</span> _maxEntries; }
<a name="l00134"></a>00134
<a name="l00136"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#af69ea3bc45568000475c11f584bd6506">00136</a> <span class="keywordtype">void</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#af69ea3bc45568000475c11f584bd6506" title="Clear the current message log entirely.">ClearLog</a>() { _messageList.clear(); }
<a name="l00137"></a>00137
<a name="l00140"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#ae467fbd6fca625ae5ee0ea066810280f">00140</a> <span class="keywordtype">void</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#ae467fbd6fca625ae5ee0ea066810280f" title="Set the level of messages to output (i.e., messages with at least this priority will be output)...">SetOutputLevel</a>(<span class="keyword">const</span> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> level) { _outputLevel = level; }
<a name="l00142"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a3e6a1f72967b7b5e99d6a25cdde2fe34">00142</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a3e6a1f72967b7b5e99d6a25cdde2fe34">GetOutputLevel</a>() { <span class="keywordflow">return</span> _outputLevel; }
<a name="l00143"></a>00143
<a name="l00144"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a8d5a7033d340808ae4eb4602a6f638de">00144</a> <span class="keywordtype">void</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a8d5a7033d340808ae4eb4602a6f638de">SetOutputStream</a>(std::ostream *os) { _outputStream = os; }
<a name="l00145"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#afa3e05fe5fa00cc48db4a2b5b5f3ba95">00145</a> std::ostream* <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#afa3e05fe5fa00cc48db4a2b5b5f3ba95">GetOutputStream</a>() { <span class="keywordflow">return</span> _outputStream; }
<a name="l00146"></a>00146
<a name="l00148"></a>00148 <span class="keywordtype">bool</span> StartErrorWrap();
<a name="l00150"></a>00150 <span class="keywordtype">bool</span> StopErrorWrap();
<a name="l00151"></a>00151
<a name="l00153"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a43dbb5cf7a6a8e51944720b532ebf0a3">00153</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a43dbb5cf7a6a8e51944720b532ebf0a3">GetErrorMessageCount</a>() { <span class="keywordflow">return</span> _messageCount[<a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afbf66ee4ae8ad04bc5003a16aa9b2b77" title="for critical errors (e.g., cannot read a file)">obError</a>];}
<a name="l00155"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#ad8c74030fe5436581bebd5c42af17bc5">00155</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#ad8c74030fe5436581bebd5c42af17bc5">GetWarningMessageCount</a>() { <span class="keywordflow">return</span> _messageCount[<a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a600e966aac7d34fec05f2067eb6b989b" title="for non-critical problems (e.g., molecule appears empty)">obWarning</a>];}
<a name="l00157"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a00c4e7133ee9e7290c0002445789c1c6">00157</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a00c4e7133ee9e7290c0002445789c1c6">GetInfoMessageCount</a>() { <span class="keywordflow">return</span> _messageCount[<a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a8239e6e8daa5c812be192e6447979814" title="for informative messages (e.g., file is a non-standard format)">obInfo</a>];}
<a name="l00159"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a48866a67a47b80b0d0c6adf5267e72eb">00159</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a48866a67a47b80b0d0c6adf5267e72eb">GetAuditMessageCount</a>() { <span class="keywordflow">return</span> _messageCount[<a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afca370a4ce993c0a266c7d120c3a6310" title="for messages auditing methods which destroy or perceive molecular data (e.g., kekulization, atom typing, etc.)">obAuditMsg</a>];}
<a name="l00161"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a673ec0e1a1c14ca7117e07a90efcd8ee">00161</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a673ec0e1a1c14ca7117e07a90efcd8ee">GetDebugMessageCount</a>() { <span class="keywordflow">return</span> _messageCount[<a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9afd56eb19b254da4133c9c28f7cccf5ce" title="for messages only useful for debugging purposes">obDebug</a>];}
<a name="l00163"></a>00163 std::string GetMessageSummary();
<a name="l00164"></a>00164
<a name="l00165"></a>00165 <span class="keyword">protected</span>:
<a name="l00167"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a08ea2212aebb85ea22895ec49bd81f85">00167</a> std::deque<OBError> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a08ea2212aebb85ea22895ec49bd81f85" title="Log of messages for later retrieval via GetMessagesOfLevel()">_messageList</a>;
<a name="l00168"></a>00168
<a name="l00170"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#abddad1d062682a33800f8d048a1e35f6">00170</a> <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9" title="Levels of error and audit messages to allow filtering.">obMessageLevel</a> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#abddad1d062682a33800f8d048a1e35f6" title="Filtering level for messages and logging (messages of lower priority will be ignored.">_outputLevel</a>;
<a name="l00171"></a>00171
<a name="l00172"></a>00172 <span class="comment">// self-explanatory</span>
<a name="l00173"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#adff5b7b50cde9f6620dc08128df860c4">00173</a> std::ostream *<a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#adff5b7b50cde9f6620dc08128df860c4">_outputStream</a>;
<a name="l00174"></a>00174
<a name="l00176"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a3c4c6fad78b988cdc4fc9b7ade5e788c">00176</a> <span class="keywordtype">bool</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a3c4c6fad78b988cdc4fc9b7ade5e788c" title="Whether messages will be logged into _messageList.">_logging</a>;
<a name="l00178"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a7a0d2d55c1de9a5afc3bf71abedfdddd">00178</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a7a0d2d55c1de9a5afc3bf71abedfdddd" title="The maximum size of _messageList log.">_maxEntries</a>;
<a name="l00179"></a>00179
<a name="l00181"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a3e0837dfabcca64b1bdf2392e70b3228">00181</a> std::streambuf *<a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a3e0837dfabcca64b1bdf2392e70b3228" title="The default stream buffer for the output stream (saved if wrapping is ued)">_inWrapStreamBuf</a>;
<a name="l00183"></a><a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a9285cdb5ae08c9a33cd6d6998cd69a26">00183</a> std::streambuf *<a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a9285cdb5ae08c9a33cd6d6998cd69a26" title="The filtered obLogBuf stream buffer to wrap error messages.">_filterStreamBuf</a>;
<a name="l00184"></a>00184 };
<a name="l00185"></a>00185
<a name="l00186"></a>00186 OBERROR <span class="keyword">extern</span> <a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml" title="Handle error messages, warnings, debugging information and the like.">OBMessageHandler</a> <a class="code" href="namespaceOpenBabel.shtml#a394eef44b3dd6a9174067715712c2d16" title="Global OBMessageHandler error handler.">obErrorLog</a>;
<a name="l00187"></a>00187
<a name="l00190"></a>00190
<a name="l00200"></a><a class="code" href="classOpenBabel_1_1obLogBuf.shtml">00200</a> <span class="keyword">class </span>OBERROR <a class="code" href="classOpenBabel_1_1obLogBuf.shtml" title="A minimal streambuf derivative to wrap calls to cerr into calls to OBMessageHandler as needed...">obLogBuf</a> : <span class="keyword">public</span> std::stringbuf
<a name="l00201"></a>00201 {
<a name="l00202"></a>00202 <span class="keyword">public</span>:
<a name="l00204"></a><a class="code" href="classOpenBabel_1_1obLogBuf.shtml#ad22e8f4b05ebff4d7292436b23c62666">00204</a> <span class="keyword">virtual</span> <a class="code" href="classOpenBabel_1_1obLogBuf.shtml#ad22e8f4b05ebff4d7292436b23c62666" title="Close the output buffer, flush, and call OBMessageHandler::ThrowError()">~obLogBuf</a>() { sync(); }
<a name="l00205"></a>00205
<a name="l00206"></a>00206 <span class="keyword">protected</span>:
<a name="l00208"></a><a class="code" href="classOpenBabel_1_1obLogBuf.shtml#a553fc1343cc7a747775864d1d124a5d5">00208</a> <span class="keywordtype">int</span> sync()
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210 <a class="code" href="namespaceOpenBabel.shtml#a394eef44b3dd6a9174067715712c2d16" title="Global OBMessageHandler error handler.">obErrorLog</a>.<a class="code" href="classOpenBabel_1_1OBMessageHandler.shtml#a2482566201934523c4631d85b1214a70" title="Throw an error with an already-formatted OBError object.">ThrowError</a>(<span class="stringliteral">""</span>, str(), <a class="code" href="namespaceOpenBabel.shtml#acf195409ac7024002db5c178f20862d9a8239e6e8daa5c812be192e6447979814" title="for informative messages (e.g., file is a non-standard format)">obInfo</a>);
<a name="l00211"></a>00211 str(std::string()); <span class="comment">// clear the buffer</span>
<a name="l00212"></a>00212 <span class="keywordflow">return</span> 0;
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 };
<a name="l00215"></a>00215
<a name="l00216"></a>00216 } <span class="comment">// end namespace OpenBabel</span>
<a name="l00217"></a>00217
<a name="l00218"></a>00218 <span class="preprocessor">#endif</span>
<a name="l00219"></a>00219 <span class="preprocessor"></span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Defines</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- end content -->
<!--#include file="footer.html" -->
<div id="footer">
<hr size="1">
<img src="http://openbabel.org/babel256.png" width="136" height="127" alt="" style="float: left;" />
<p>This file is part of the documentation for <a href="http://openbabel.org/wiki/">Open Babel</a>, version 2.3.</p>
<div class="bottom">
Documentation copyright © 1998-2007, the <a href="http://openbabel.org/wiki/THANKS">Open Babel Developers</a>.<br>
Open Babel is hosted by: <a href="http://sourceforge.net">
<img src="http://sourceforge.net/sflogo.php?group_id=40728"
width="88" height="31" border="0" alt="SourceForge Logo"></a><br>
Generated on Thu Oct 13 2011 16:08:07 by <a href="http://www.doxygen.org/"><img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.7.5.1.
</div>
</body>
</html>
|