BDE 4.14.0 Production release
|
#include <balxml_errorinfo.h>
Public Types | |
enum | Severity { e_NO_ERROR , e_WARNING , e_ERROR , e_FATAL_ERROR , BAEXML_NO_ERROR = e_NO_ERROR , BAEXML_WARNING = e_WARNING , BAEXML_ERROR = e_ERROR , BAEXML_FATAL_ERROR = e_FATAL_ERROR } |
Public Member Functions | |
BSLMF_NESTED_TRAIT_DECLARATION (ErrorInfo, bslma::UsesBslmaAllocator) | |
ErrorInfo (bslma::Allocator *basicAllocator=0) | |
ErrorInfo (const ErrorInfo &other, bslma::Allocator *basicAllocator=0) | |
~ErrorInfo () | |
Destroy this object. | |
ErrorInfo & | operator= (const ErrorInfo &rhs) |
void | setError (Severity severity, int lineNumber, int columnNumber, const bsl::string_view &source, const bsl::string_view &errorMsg) |
void | setError (const ErrorInfo &other) |
void | reset () |
bool | isNoError () const |
bool | isWarning () const |
bool | isError () const |
bool | isFatalError () const |
bool | isAnyError () const |
Severity | severity () const |
Return the severity level. | |
int | lineNumber () const |
int | columnNumber () const |
const bsl::string & | source () const |
Return the string that identifies the document being parsed. | |
const bsl::string & | message () const |
Return the string describing the error or warning. | |
This class provides detailed information for errors encountered during XML parsing. Such information is common for most parsers and contains the following data: line number, column number, severity code, identification of source document and the parser error message.
balxml::ErrorInfo::ErrorInfo | ( | bslma::Allocator * | basicAllocator = 0 | ) |
Construct an error info object using the (optionally) specified basicAllocator
, or the default allocator of none is specified. After construction, severity()
will return BAEXML_NO_ERROR
, lineNumber()
and columnNumber()
will each return 0, and source()
and message()
will each return an empty string.
balxml::ErrorInfo::ErrorInfo | ( | const ErrorInfo & | other, |
bslma::Allocator * | basicAllocator = 0 |
||
) |
Construct a copy of the specified other
object using the (optionally) specified basicAllocator
, or the default allocator of none is specified.
balxml::ErrorInfo::~ErrorInfo | ( | ) |
balxml::ErrorInfo::BSLMF_NESTED_TRAIT_DECLARATION | ( | ErrorInfo | , |
bslma::UsesBslmaAllocator | |||
) |
|
inline |
Return the column number. By convention, the first column is numbered 1. The constructors and reset
functions set the column number to 0, since there is no error column to report.
|
inline |
Return true if the severity() >=
BAEXML_ERROR' (i.e., BAEXML_ERROR
or BAEXML_FATAL_ERROR
) and false otherwise.
|
inline |
Return true if the severity() ==
BAEXML_ERROR' and false otherwise.
|
inline |
Return true if the severity() ==
BAEXML_FATAL_ERROR' and false otherwise.
|
inline |
Return true if the severity() ==
BAEXML_NO_ERROR' and false otherwise.
|
inline |
Return true if the severity() ==
BAEXML_WARNING' and false otherwise.
|
inline |
Return the line number of the warning or error. By convention, the first line is numbered 1. The constructors and reset
functions set the line number to 0, since there is no error line to report.
|
inline |
Copy the value of the specified rhs
object into this object and return a modifiable reference to this object.
void balxml::ErrorInfo::reset | ( | ) |
Reset this object to initial state, as if it were default constructed.
|
inline |
If the severity of the specified other
object is greater than the current value of this->severity()
, then assign this object the value of other
, otherwise do nothing.
void balxml::ErrorInfo::setError | ( | Severity | severity, |
int | lineNumber, | ||
int | columnNumber, | ||
const bsl::string_view & | source, | ||
const bsl::string_view & | errorMsg | ||
) |
If the specified severity
is greater than the current value of this->severity()
, then set this object's severity to severity
, line number to the specified lineNumber
, column number to the specified columnNumber
, source name to the specified source
, and error message to the specified errorMsg
, otherwise do nothing.
|
inline |
|
inline |