1// Copyright (C) 2016 and later: Unicode, Inc. and others.
2// License & terms of use: http://www.unicode.org/copyright.html
3/*
4*******************************************************************************
5*
6*   Copyright (C) 2009-2011, International Business Machines
7*   Corporation and others.  All Rights Reserved.
8*
9*******************************************************************************
10*   file name:  errorcode.cpp
11*   encoding:   US-ASCII
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
24ErrorCode::~ErrorCode() {}
25
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
43