ICU-7121 add ErrorCode::errorName() convenience method

X-SVN-Rev: 26856
This commit is contained in:
Fredrik Roubert 2009-11-09 15:40:57 +00:00
parent af6765a0a1
commit 4a6d872c21
2 changed files with 11 additions and 0 deletions

View file

@ -31,4 +31,8 @@ void ErrorCode::assertSuccess() const {
}
}
const char* ErrorCode::errorName() const {
return u_errorName(errorCode);
}
U_NAMESPACE_END

View file

@ -109,6 +109,13 @@ public:
* @draft ICU 4.4
*/
void assertSuccess() const;
/**
* Return a string for the UErrorCode value.
* The string will be the same as the name of the error code constant
* in the UErrorCode enum.
* @draft ICU 4.4
*/
const char* errorName() const;
protected:
/**