]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/errorcode.cpp
ICU-57131.0.1.tar.gz
[apple/icu.git] / icuSources / common / errorcode.cpp
CommitLineData
729e4ab9
A
1/*
2*******************************************************************************
3*
4388f060 4* Copyright (C) 2009-2011, International Business Machines
729e4ab9
A
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
20U_NAMESPACE_BEGIN
21
4388f060
A
22ErrorCode::~ErrorCode() {}
23
729e4ab9
A
24UErrorCode ErrorCode::reset() {
25 UErrorCode code = errorCode;
26 errorCode = U_ZERO_ERROR;
27 return code;
28}
29
30void ErrorCode::assertSuccess() const {
31 if(isFailure()) {
32 handleFailure();
33 }
34}
35
36const char* ErrorCode::errorName() const {
37 return u_errorName(errorCode);
38}
39
40U_NAMESPACE_END