1 /* 2 ******************************************************************************* 3 * 4 * Copyright (C) 2009, International Business Machines 5 * Corporation and others. All Rights Reserved. 6 * 7 ******************************************************************************* 8 * file name: errorcode.cpp 9 * encoding: US-ASCII 10 * tab size: 8 (not used) 11 * indentation:4 12 * 13 * created on: 2009mar10 14 * created by: Markus W. Scherer 15 */ 16 17 #include "unicode/utypes.h" 18 #include "unicode/errorcode.h" 19 20 U_NAMESPACE_BEGIN 21 22 UErrorCode ErrorCode::reset() { 23 UErrorCode code = errorCode; 24 errorCode = U_ZERO_ERROR; 25 return code; 26 } 27 28 void ErrorCode::assertSuccess() const { 29 if(isFailure()) { 30 handleFailure(); 31 } 32 } 33 34 const char* ErrorCode::errorName() const { 35 return u_errorName(errorCode); 36 } 37 38 U_NAMESPACE_END 39