errorcode.cpp 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // © 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: UTF-8
  12. * tab size: 8 (not used)
  13. * indentation:4
  14. *
  15. * created on: 2009mar10
  16. * created by: Markus W. Scherer
  17. */
  18. #include "unicode/utypes.h"
  19. #include "unicode/errorcode.h"
  20. U_NAMESPACE_BEGIN
  21. ErrorCode::~ErrorCode() {}
  22. UErrorCode ErrorCode::reset() {
  23. UErrorCode code = errorCode;
  24. errorCode = U_ZERO_ERROR;
  25. return code;
  26. }
  27. void ErrorCode::assertSuccess() const {
  28. if(isFailure()) {
  29. handleFailure();
  30. }
  31. }
  32. const char* ErrorCode::errorName() const {
  33. return u_errorName(errorCode);
  34. }
  35. U_NAMESPACE_END