Added static method to convert arbitrary ErrorID to a string.

Updated tests to print ErrorID and bool values as strings.
This commit is contained in:
kezenator
2016-11-26 13:54:42 +10:00
parent f80d78d938
commit 5a70071241
3 changed files with 18 additions and 3 deletions

View File

@@ -2226,14 +2226,19 @@ void XMLDocument::SetError( XMLError error, const char* str1, const char* str2 )
_errorStr2.SetStr(str2);
}
const char* XMLDocument::ErrorName() const
const char* XMLDocument::ErrorName(XMLError errorID)
{
TIXMLASSERT( _errorID >= 0 && _errorID < XML_ERROR_COUNT );
const char* errorName = _errorNames[_errorID];
TIXMLASSERT( errorID >= 0 && errorID < XML_ERROR_COUNT );
const char* errorName = _errorNames[errorID];
TIXMLASSERT( errorName && errorName[0] );
return errorName;
}
const char* XMLDocument::ErrorName() const
{
return ErrorName(_errorID);
}
void XMLDocument::PrintError() const
{
if ( Error() ) {