Quick Links:

bal | bbl | bdl | bsl

Public Types | Public Member Functions

balxml::ErrorInfo Class Reference

#include <balxml_errorinfo.h>

List of all members.

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 ()
ErrorInfooperator= (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
int lineNumber () const
int columnNumber () const
const bsl::stringsource () const
const bsl::stringmessage () const

Detailed Description

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.

See Component balxml_errorinfo


Member Enumeration Documentation

Enumerator:
e_NO_ERROR 
e_WARNING 
e_ERROR 
e_FATAL_ERROR 
BAEXML_NO_ERROR 
BAEXML_WARNING 
BAEXML_ERROR 
BAEXML_FATAL_ERROR 

Constructor & Destructor Documentation

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 (  ) 

Destroy this object.


Member Function Documentation

balxml::ErrorInfo::BSLMF_NESTED_TRAIT_DECLARATION ( ErrorInfo  ,
bslma::UsesBslmaAllocator   
)
ErrorInfo& balxml::ErrorInfo::operator= ( const ErrorInfo rhs  ) 

Copy the value of the specified rhs object into this object and return a modifiable reference to this object.

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.

void balxml::ErrorInfo::setError ( const ErrorInfo other  ) 

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::reset (  ) 

Reset this object to initial state, as if it were default constructed.

bool balxml::ErrorInfo::isNoError (  )  const

Return true if the severity() == 'BAEXML_NO_ERROR and false otherwise.

bool balxml::ErrorInfo::isWarning (  )  const

Return true if the severity() == 'BAEXML_WARNING and false otherwise.

bool balxml::ErrorInfo::isError (  )  const

Return true if the severity() == 'BAEXML_ERROR and false otherwise.

bool balxml::ErrorInfo::isFatalError (  )  const

Return true if the severity() == 'BAEXML_FATAL_ERROR and false otherwise.

bool balxml::ErrorInfo::isAnyError (  )  const

Return true if the severity() >= 'BAEXML_ERROR (i.e., BAEXML_ERROR or BAEXML_FATAL_ERROR) and false otherwise.

Severity balxml::ErrorInfo::severity (  )  const

Return the severity level.

int balxml::ErrorInfo::lineNumber (  )  const

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.

int balxml::ErrorInfo::columnNumber (  )  const

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.

const bsl::string& balxml::ErrorInfo::source (  )  const

Return the string that identifies the document being parsed.

const bsl::string& balxml::ErrorInfo::message (  )  const

Return the string describing the error or warning.


The documentation for this class was generated from the following file: