XMLError.cpp File Reference

Detailed Description

Represents errors (and messages) encountered during an XML parse.

Author:
Ben Bornstein
Include dependency graph for XMLError.cpp:

Functions

ostream & operator<< (ostream &s, const XMLError &error)
LIBLAX_EXTERN XMLError_t * XMLError_create (void)
 Creates a new XMLError to report that something occurred.
LIBLAX_EXTERN XMLError_t * XMLError_createWithIdAndMessage (unsigned int errorId, const char *message)
 Creates a new XMLError with the identification number and detailed message set.
LIBLAX_EXTERN void XMLError_free (XMLError_t *error)
 Frees the given XMLError_t structure.
LIBLAX_EXTERN unsigned int XMLError_getCategory (const XMLError_t *error)
 Return the category of this XMLError.
LIBLAX_EXTERN const char * XMLError_getCategoryAsString (const XMLError_t *error)
 Return the category of this XMLError as a string.
LIBLAX_EXTERN unsigned int XMLError_getColumn (const XMLError_t *error)
 Return the column number where this XMLError occurred.
LIBLAX_EXTERN unsigned int XMLError_getErrorId (const XMLError_t *error)
 Returns the id of this XMLError.
LIBLAX_EXTERN unsigned int XMLError_getLine (const XMLError_t *error)
 Return the line number where this XMLError occurred.
LIBLAX_EXTERN const char * XMLError_getMessage (const XMLError_t *error)
 Returns the message text of this XMLError.
LIBLAX_EXTERN unsigned int XMLError_getSeverity (const XMLError_t *error)
 Return the severity of this XMLError.
LIBLAX_EXTERN const char * XMLError_getSeverityAsString (const XMLError_t *error)
 Return the severity of this XMLError as a string.erity_t.
LIBLAX_EXTERN const char * XMLError_getShortMessage (const XMLError_t *error)
 Returns the short message text of this XMLError.
LIBLAX_EXTERN int XMLError_isError (const XMLError_t *error)
 Predicate returning true or false depending on whether this XMLError_t structure is an error.
LIBLAX_EXTERN int XMLError_isFatal (const XMLError_t *error)
 Predicate returning true or false depending on whether this XMLError_t structure is a fatal error.
LIBLAX_EXTERN int XMLError_isInfo (const XMLError_t *error)
 Predicate returning true or false depending on whether this XMLError_t structure is for information only.
LIBLAX_EXTERN int XMLError_isWarning (const XMLError_t *error)
 Predicate returning true or false depending on whether this XMLError_t structure is a warning.
LIBLAX_EXTERN void XMLError_print (const XMLError_t *error, FILE *stream)
 Outputs this XMLError to stream in the following format (and followed by a newline):

Function Documentation

ostream& operator<< ( ostream &  s,
const XMLError &  error 
)
LIBLAX_EXTERN XMLError_t* XMLError_create ( void  )

Creates a new XMLError to report that something occurred.

LIBLAX_EXTERN XMLError_t* XMLError_createWithIdAndMessage ( unsigned int  errorId,
const char *  message 
)

Creates a new XMLError with the identification number and detailed message set.

If the identifier is < 10000, it must be one of the predefined XML layer error codes.

Parameters:
errorIdan unsigned int, the identification number of the error.
messagea string, the error message.
LIBLAX_EXTERN void XMLError_free ( XMLError_t *  error)

Frees the given XMLError_t structure.

Parameters:
errorthe XMLError_t structure to be freed.
LIBLAX_EXTERN unsigned int XMLError_getCategory ( const XMLError_t *  error)

Return the category of this XMLError.

The possible values (for the XML layers) are those from the enumeration XMLErrorCategory_t.

Parameters:
errorthe XMLError_t from which to return the category.
Returns:
the category of this XMLError.
LIBLAX_EXTERN const char* XMLError_getCategoryAsString ( const XMLError_t *  error)

Return the category of this XMLError as a string.

Parameters:
errorthe XMLError_t from which to return the category.
Returns:
string representing the category of this XMLError.
LIBLAX_EXTERN unsigned int XMLError_getColumn ( const XMLError_t *  error)

Return the column number where this XMLError occurred.

Parameters:
errorthe XMLError_t from which to return the column number.
Returns:
the column number where this XMLError occurred.
LIBLAX_EXTERN unsigned int XMLError_getErrorId ( const XMLError_t *  error)

Returns the id of this XMLError.

Parameters:
errorthe XMLError_t from which to return the id.
Returns:
the id of this XMLError.
LIBLAX_EXTERN unsigned int XMLError_getLine ( const XMLError_t *  error)

Return the line number where this XMLError occurred.

Parameters:
errorthe XMLError_t from which to return the line number.
Returns:
the line number where this XMLError occurred.
LIBLAX_EXTERN const char* XMLError_getMessage ( const XMLError_t *  error)

Returns the message text of this XMLError.

Parameters:
errorthe XMLError_t from which to return the message.
Returns:
the message text of this XMLError.
LIBLAX_EXTERN unsigned int XMLError_getSeverity ( const XMLError_t *  error)

Return the severity of this XMLError.

The possible values (for the XML layer) are those from the enumeration XMLErrorSeverity_t.

Parameters:
errorthe XMLError_t from which to return the severity.
Returns:
the severity of this XMLError.
LIBLAX_EXTERN const char* XMLError_getSeverityAsString ( const XMLError_t *  error)

Return the severity of this XMLError as a string.erity_t.

Parameters:
errorthe XMLError_t from which to return the severity.
Returns:
string representing the severity of this XMLError.
LIBLAX_EXTERN const char* XMLError_getShortMessage ( const XMLError_t *  error)

Returns the short message text of this XMLError.

Parameters:
errorthe XMLError_t from which to return the short message.
Returns:
the message text of this XMLError.
LIBLAX_EXTERN int XMLError_isError ( const XMLError_t *  error)

Predicate returning true or false depending on whether this XMLError_t structure is an error.

Parameters:
errorthe XMLError_t.
Returns:
non-zero (true) if this XMLError is an error, zero (false) otherwise.
LIBLAX_EXTERN int XMLError_isFatal ( const XMLError_t *  error)

Predicate returning true or false depending on whether this XMLError_t structure is a fatal error.

Parameters:
errorthe XMLError_t.
Returns:
non-zero (true) if this XMLError is a fatal error, zero (false) otherwise.
LIBLAX_EXTERN int XMLError_isInfo ( const XMLError_t *  error)

Predicate returning true or false depending on whether this XMLError_t structure is for information only.

Parameters:
errorthe XMLError_t.
Returns:
non-zero (true) if this XMLError is for informational purposes only, zero (false) otherwise.
LIBLAX_EXTERN int XMLError_isWarning ( const XMLError_t *  error)

Predicate returning true or false depending on whether this XMLError_t structure is a warning.

Parameters:
errorthe XMLError_t.
Returns:
non-zero (true) if this XMLError is a warning, zero (false) otherwise.
LIBLAX_EXTERN void XMLError_print ( const XMLError_t *  error,
FILE *  stream 
)

Outputs this XMLError to stream in the following format (and followed by a newline):

line: (id) message

Parameters:
error,theXMLError_t structure to write.
stream,thestream to write to.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines