]> git.saurik.com Git - apple/icu.git/blame - icuSources/common/errorcode.cpp
ICU-66108.tar.gz
[apple/icu.git] / icuSources / common / errorcode.cpp
CommitLineData
f3c0d7a5
A
1// © 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
729e4ab9
A
3/*
4*******************************************************************************
5*
4388f060 6* Copyright (C) 2009-2011, International Business Machines
729e4ab9
A
7* Corporation and others. All Rights Reserved.
8*
9*******************************************************************************
10* file name: errorcode.cpp
f3c0d7a5 11* encoding: UTF-8
729e4ab9
A
12* tab size: 8 (not used)
13* indentation:4
14*
15* created on: 2009mar10
16* created by: Markus W. Scherer
17*/
18
19#include "unicode/utypes.h"
20#include "unicode/errorcode.h"
21
22U_NAMESPACE_BEGIN
23
4388f060
A
24ErrorCode::~ErrorCode() {}
25
729e4ab9
A
26UErrorCode ErrorCode::reset() {
27 UErrorCode code = errorCode;
28 errorCode = U_ZERO_ERROR;
29 return code;
30}
31
32void ErrorCode::assertSuccess() const {
33 if(isFailure()) {
34 handleFailure();
35 }
36}
37
38const char* ErrorCode::errorName() const {
39 return u_errorName(errorCode);
40}
41
42U_NAMESPACE_END