<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>ICU 58.2: errorcode.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">ICU 58.2  <span id="projectnumber">58.2</span> </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_b2f33c71d4aa5e7af42a1ca61ff5af1b.html">source</a></li><li class="navelem"><a class="el" href="dir_30087b5439e04c85304dbcf15650710b.html">common</a></li><li class="navelem"><a class="el" href="dir_8bf9c54ed6ca2fd1e2117fb037e4ad06.html">unicode</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">errorcode.h</div> </div> </div><!--header--> <div class="contents"> <a href="errorcode_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// Copyright (C) 2016 and later: Unicode, Inc. and others.</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// License & terms of use: http://www.unicode.org/copyright.html</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">/*</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">*******************************************************************************</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">*</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">* Copyright (C) 2009-2011, International Business Machines</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">* Corporation and others. All Rights Reserved.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">*</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">*******************************************************************************</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">* file name: errorcode.h</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">* encoding: US-ASCII</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">* tab size: 8 (not used)</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">* indentation:4</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">*</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">* created on: 2009mar10</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">* created by: Markus W. Scherer</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">*/</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#ifndef __ERRORCODE_H__</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#define __ERRORCODE_H__</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="utypes_8h.html">unicode/utypes.h</a>"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="uobject_8h.html">unicode/uobject.h</a>"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <a class="code" href="uversion_8h.html#a7d9374e037299886d4192b763b4c5e8b">U_NAMESPACE_BEGIN</a></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html"> 81</a></span> <span class="keyword">class </span><a class="code" href="utypes_8h.html#a559955ec3bc692657c5d8b1c6de8e334">U_COMMON_API</a> <a class="code" href="classicu_1_1ErrorCode.html">ErrorCode</a>: <span class="keyword">public</span> <a class="code" href="classicu_1_1UMemory.html">UMemory</a> {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#ac675f8556eb05f4a6b3edc6ecc69a520"> 87</a></span>  <a class="code" href="classicu_1_1ErrorCode.html#ac675f8556eb05f4a6b3edc6ecc69a520">ErrorCode</a>() : errorCode(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78caa43dbfc9499c5f911d04e1a0ca3bf6f9">U_ZERO_ERROR</a>) {}</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keyword">virtual</span> ~<a class="code" href="classicu_1_1ErrorCode.html">ErrorCode</a>();</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#ac25c72b1c6791252b3dfbba031a28088"> 91</a></span>  <span class="keyword">operator</span> <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> & () { <span class="keywordflow">return</span> errorCode; }</div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#ae546113fa2d0a19c41dcf9a1347c6853"> 93</a></span>  <span class="keyword">operator</span> <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> * () { <span class="keywordflow">return</span> &errorCode; }</div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#acf301523080d1204eccc01105eb325bb"> 95</a></span>  <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> <a class="code" href="classicu_1_1ErrorCode.html#acf301523080d1204eccc01105eb325bb">isSuccess</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711">U_SUCCESS</a>(errorCode); }</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#a76f92eccadcb4d884dbb18996ad73a1c"> 97</a></span>  <a class="code" href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a> <a class="code" href="classicu_1_1ErrorCode.html#a76f92eccadcb4d884dbb18996ad73a1c">isFailure</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f">U_FAILURE</a>(errorCode); }</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#a78aaf35396b76c8f90a43655ba0c09b5"> 99</a></span>  <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> <span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> errorCode; }</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#aa6429d4ddbb20e212d7c5c095ae8cfd3"> 101</a></span>  <span class="keywordtype">void</span> <span class="keyword">set</span>(<a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> value) { errorCode=value; }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> reset();</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordtype">void</span> assertSuccess() <span class="keyword">const</span>;</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keyword">const</span> <span class="keywordtype">char</span>* errorName() <span class="keyword">const</span>;</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#a541d64c42a846715e2c345e813672a2b"> 127</a></span>  <a class="code" href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a> <a class="code" href="classicu_1_1ErrorCode.html#a541d64c42a846715e2c345e813672a2b">errorCode</a>;</div><div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classicu_1_1ErrorCode.html#acc59cd45476fe2af87563c2c37d7e545"> 134</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classicu_1_1ErrorCode.html#acc59cd45476fe2af87563c2c37d7e545">handleFailure</a>()<span class="keyword"> const </span>{}</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> };</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <a class="code" href="uversion_8h.html#a3da1f00f3b02976ac53c014a3e4c0933">U_NAMESPACE_END</a></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> </div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="preprocessor">#endif // __ERRORCODE_H__</span></div><div class="ttc" id="classicu_1_1ErrorCode_html_acc59cd45476fe2af87563c2c37d7e545"><div class="ttname"><a href="classicu_1_1ErrorCode.html#acc59cd45476fe2af87563c2c37d7e545">icu::ErrorCode::handleFailure</a></div><div class="ttdeci">virtual void handleFailure() const </div><div class="ttdoc">Called by assertSuccess() if isFailure() is true. </div><div class="ttdef"><b>Definition:</b> <a href="errorcode_8h_source.html#l00134">errorcode.h:134</a></div></div> <div class="ttc" id="classicu_1_1ErrorCode_html_ac675f8556eb05f4a6b3edc6ecc69a520"><div class="ttname"><a href="classicu_1_1ErrorCode.html#ac675f8556eb05f4a6b3edc6ecc69a520">icu::ErrorCode::ErrorCode</a></div><div class="ttdeci">ErrorCode()</div><div class="ttdoc">Default constructor. </div><div class="ttdef"><b>Definition:</b> <a href="errorcode_8h_source.html#l00087">errorcode.h:87</a></div></div> <div class="ttc" id="utypes_8h_html_a527f2c69e6b2e3b2c53ad8a99fb36711"><div class="ttname"><a href="utypes_8h.html#a527f2c69e6b2e3b2c53ad8a99fb36711">U_SUCCESS</a></div><div class="ttdeci">#define U_SUCCESS(x)</div><div class="ttdoc">Does the error code indicate success? </div><div class="ttdef"><b>Definition:</b> <a href="utypes_8h_source.html#l00683">utypes.h:683</a></div></div> <div class="ttc" id="utypes_8h_html_a4d202200b6aa6f3c965ea370e0c8155f"><div class="ttname"><a href="utypes_8h.html#a4d202200b6aa6f3c965ea370e0c8155f">U_FAILURE</a></div><div class="ttdeci">#define U_FAILURE(x)</div><div class="ttdoc">Does the error code indicate a failure? </div><div class="ttdef"><b>Definition:</b> <a href="utypes_8h_source.html#l00688">utypes.h:688</a></div></div> <div class="ttc" id="classicu_1_1ErrorCode_html"><div class="ttname"><a href="classicu_1_1ErrorCode.html">icu::ErrorCode</a></div><div class="ttdoc">Wrapper class for UErrorCode, with conversion operators for direct use in ICU C and C++ APIs...</div><div class="ttdef"><b>Definition:</b> <a href="errorcode_8h_source.html#l00081">errorcode.h:81</a></div></div> <div class="ttc" id="utypes_8h_html_a3343c1c8a8377277046774691c98d78caa43dbfc9499c5f911d04e1a0ca3bf6f9"><div class="ttname"><a href="utypes_8h.html#a3343c1c8a8377277046774691c98d78caa43dbfc9499c5f911d04e1a0ca3bf6f9">U_ZERO_ERROR</a></div><div class="ttdoc">No error, no warning. </div><div class="ttdef"><b>Definition:</b> <a href="utypes_8h_source.html#l00430">utypes.h:430</a></div></div> <div class="ttc" id="uversion_8h_html_a7d9374e037299886d4192b763b4c5e8b"><div class="ttname"><a href="uversion_8h.html#a7d9374e037299886d4192b763b4c5e8b">U_NAMESPACE_BEGIN</a></div><div class="ttdeci">#define U_NAMESPACE_BEGIN</div><div class="ttdoc">This is used to begin a declaration of a public ICU C++ API. </div><div class="ttdef"><b>Definition:</b> <a href="uversion_8h_source.html#l00131">uversion.h:131</a></div></div> <div class="ttc" id="classicu_1_1ErrorCode_html_a541d64c42a846715e2c345e813672a2b"><div class="ttname"><a href="classicu_1_1ErrorCode.html#a541d64c42a846715e2c345e813672a2b">icu::ErrorCode::errorCode</a></div><div class="ttdeci">UErrorCode errorCode</div><div class="ttdoc">Internal UErrorCode, accessible to subclasses. </div><div class="ttdef"><b>Definition:</b> <a href="errorcode_8h_source.html#l00127">errorcode.h:127</a></div></div> <div class="ttc" id="uobject_8h_html"><div class="ttname"><a href="uobject_8h.html">uobject.h</a></div><div class="ttdoc">C++ API: Common ICU base class UObject. </div></div> <div class="ttc" id="uversion_8h_html_a3da1f00f3b02976ac53c014a3e4c0933"><div class="ttname"><a href="uversion_8h.html#a3da1f00f3b02976ac53c014a3e4c0933">U_NAMESPACE_END</a></div><div class="ttdeci">#define U_NAMESPACE_END</div><div class="ttdoc">This is used to end a declaration of a public ICU C++ API. </div><div class="ttdef"><b>Definition:</b> <a href="uversion_8h_source.html#l00132">uversion.h:132</a></div></div> <div class="ttc" id="classicu_1_1ErrorCode_html_acf301523080d1204eccc01105eb325bb"><div class="ttname"><a href="classicu_1_1ErrorCode.html#acf301523080d1204eccc01105eb325bb">icu::ErrorCode::isSuccess</a></div><div class="ttdeci">UBool isSuccess() const </div><div class="ttdoc">Tests for U_SUCCESS(). </div><div class="ttdef"><b>Definition:</b> <a href="errorcode_8h_source.html#l00095">errorcode.h:95</a></div></div> <div class="ttc" id="utypes_8h_html_a3343c1c8a8377277046774691c98d78c"><div class="ttname"><a href="utypes_8h.html#a3343c1c8a8377277046774691c98d78c">UErrorCode</a></div><div class="ttdeci">UErrorCode</div><div class="ttdoc">Error code to replace exception handling, so that the code is compatible with all C++ compilers...</div><div class="ttdef"><b>Definition:</b> <a href="utypes_8h_source.html#l00396">utypes.h:396</a></div></div> <div class="ttc" id="utypes_8h_html"><div class="ttname"><a href="utypes_8h.html">utypes.h</a></div><div class="ttdoc">Basic definitions for ICU, for both C and C++ APIs. </div></div> <div class="ttc" id="utypes_8h_html_a559955ec3bc692657c5d8b1c6de8e334"><div class="ttname"><a href="utypes_8h.html#a559955ec3bc692657c5d8b1c6de8e334">U_COMMON_API</a></div><div class="ttdeci">#define U_COMMON_API</div><div class="ttdoc">Set to export library symbols from inside the common library, and to import them from outside...</div><div class="ttdef"><b>Definition:</b> <a href="utypes_8h_source.html#l00359">utypes.h:359</a></div></div> <div class="ttc" id="classicu_1_1ErrorCode_html_a76f92eccadcb4d884dbb18996ad73a1c"><div class="ttname"><a href="classicu_1_1ErrorCode.html#a76f92eccadcb4d884dbb18996ad73a1c">icu::ErrorCode::isFailure</a></div><div class="ttdeci">UBool isFailure() const </div><div class="ttdoc">Tests for U_FAILURE(). </div><div class="ttdef"><b>Definition:</b> <a href="errorcode_8h_source.html#l00097">errorcode.h:97</a></div></div> <div class="ttc" id="classicu_1_1UMemory_html"><div class="ttname"><a href="classicu_1_1UMemory.html">icu::UMemory</a></div><div class="ttdoc">UMemory is the common ICU base class. </div><div class="ttdef"><b>Definition:</b> <a href="uobject_8h_source.html#l00112">uobject.h:112</a></div></div> <div class="ttc" id="umachine_8h_html_a349ef00011f20ccd1d3b424445681aa5"><div class="ttname"><a href="umachine_8h.html#a349ef00011f20ccd1d3b424445681aa5">UBool</a></div><div class="ttdeci">int8_t UBool</div><div class="ttdoc">The ICU boolean type. </div><div class="ttdef"><b>Definition:</b> <a href="umachine_8h_source.html#l00259">umachine.h:259</a></div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>