xmlwrapp
Public Types | Public Member Functions | Protected Member Functions | List of all members
xml::error_messages Class Reference

The xml::error_messages class is used to store all the error messages which are collected while parsing or validating an XML document. More...

#include <errors.h>

+ Inheritance diagram for xml::error_messages:
+ Collaboration diagram for xml::error_messages:

Public Types

typedef std::list< error_messagemessages_type
 A type to store multiple messages. More...
 

Public Member Functions

const messages_typemessages () const
 Get the error messages. More...
 
bool empty () const
 Convenience function to find if there are any messages at all. More...
 
bool has_warnings () const
 Check if there are warnings in the error messages. More...
 
bool has_errors () const
 Check if there are any errors. More...
 
std::string print () const
 Convert error messages into a single printable string. More...
 
void on_error (const std::string &msg)
 Called by xmlwrapp to report an error. More...
 
void on_warning (const std::string &msg)
 Called by xmlwrapp to report a warning. More...
 

Protected Member Functions

virtual std::string format_for_print (const error_message &msg) const
 Called by print() to format a single message. More...
 

Detailed Description

The xml::error_messages class is used to store all the error messages which are collected while parsing or validating an XML document.

Since
0.7.0

Member Typedef Documentation

A type to store multiple messages.

Member Function Documentation

bool xml::error_messages::empty ( ) const
inline

Convenience function to find if there are any messages at all.

virtual std::string xml::error_messages::format_for_print ( const error_message msg) const
protectedvirtual

Called by print() to format a single message.

bool xml::error_messages::has_errors ( ) const
inline

Check if there are any errors.

bool xml::error_messages::has_warnings ( ) const
inline

Check if there are warnings in the error messages.

Returns
true if there is at least one warning in the error messages. It does not consider errors.
const messages_type& xml::error_messages::messages ( ) const
inline

Get the error messages.

void xml::error_messages::on_error ( const std::string &  msg)
virtual

Called by xmlwrapp to report an error.

Implements xml::error_handler.

void xml::error_messages::on_warning ( const std::string &  msg)
virtual

Called by xmlwrapp to report a warning.

Implements xml::error_handler.

std::string xml::error_messages::print ( ) const

Convert error messages into a single printable string.

The returned string is typically multiline, with the messages separated with newlines ('
').


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