NCBI C++ ToolKit
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
xml::error_messages Class Reference

Search Toolkit Book for xml::error_messages

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

#include <misc/xmlwrapp/errors.hpp>

+ Collaboration diagram for xml::error_messages:

Public Types

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

Public Member Functions

const error_messages_typeget_messages (void) const
 Get the error messages. More...
 
error_messages_typeget_messages (void)
 Get the error messages. More...
 
bool has_warnings (void) const
 Check if there are warnings in the error messages. More...
 
bool has_errors (void) const
 Check if there are errors in the error messages. More...
 
bool has_fatal_errors (void) const
 Check if there are fatal errors in the error messages. More...
 
std::string print (void) const
 Convert error messages into a single printable string. More...
 
void append_messages (const error_messages &other)
 Appends the messages from the other container. More...
 
 error_messages ()=default
 
 error_messages (const error_messages &other)=default
 
error_messagesoperator= (const error_messages &other)=default
 
 error_messages (error_messages &&other)=default
 
error_messagesoperator= (error_messages &&other)=default
 

Private Member Functions

bool has_messages_of_type (error_message::message_type type) const
 

Private Attributes

error_messages_type error_messages_
 

Detailed Description

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

Definition at line 136 of file errors.hpp.

Member Typedef Documentation

◆ error_messages_type

A type to store multiple messages.

Definition at line 140 of file errors.hpp.

Constructor & Destructor Documentation

◆ error_messages() [1/3]

xml::error_messages::error_messages ( )
default

◆ error_messages() [2/3]

xml::error_messages::error_messages ( const error_messages other)
default

◆ error_messages() [3/3]

xml::error_messages::error_messages ( error_messages &&  other)
default

Member Function Documentation

◆ append_messages()

void error_messages::append_messages ( const error_messages other)

Appends the messages from the other container.

Definition at line 147 of file errors.cpp.

References error_messages_, and get_messages().

Referenced by xml::impl::collect_https_messages().

◆ get_messages() [1/2]

error_messages::error_messages_type & error_messages::get_messages ( void  )

Get the error messages.

Returns
The error messages.

Definition at line 103 of file errors.cpp.

References error_messages_.

◆ get_messages() [2/2]

const error_messages::error_messages_type & error_messages::get_messages ( void  ) const

◆ has_errors()

bool error_messages::has_errors ( void  ) const

◆ has_fatal_errors()

bool error_messages::has_fatal_errors ( void  ) const

◆ has_messages_of_type()

bool error_messages::has_messages_of_type ( error_message::message_type  type) const
private

Definition at line 108 of file errors.cpp.

References error_messages_.

Referenced by has_errors(), has_fatal_errors(), and has_warnings().

◆ has_warnings()

bool error_messages::has_warnings ( void  ) const

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 and fatal errors.

Definition at line 118 of file errors.cpp.

References has_messages_of_type(), and xml::error_message::type_warning.

Referenced by xml::schema::construct(), xml::document::is_failure(), xml::event_parser::is_failure(), xml::dtd::validate(), xml::schema::validate(), and xml::document::validate().

◆ operator=() [1/2]

error_messages& xml::error_messages::operator= ( const error_messages other)
default

◆ operator=() [2/2]

error_messages& xml::error_messages::operator= ( error_messages &&  other)
default

◆ print()

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

Convert error messages into a single printable string.

Returns
string representation of the errors list ('
' separated)

Definition at line 130 of file errors.cpp.

References buffer, error_messages_, xml::error_message::message_type_str(), and string.

Referenced by CPMCIDConverterServer::GetPmids(), CHydraServer::RunHydraSearch(), CEUtilsGeneric::TryQuery(), xml::parser_exception::what(), CEutilsClient::x_CountOnce(), CEutilsClient::x_LinkOnceT(), and CEutilsClient::x_ParseSearchResults().

Member Data Documentation

◆ error_messages_

error_messages_type xml::error_messages::error_messages_
private

Definition at line 202 of file errors.hpp.

Referenced by append_messages(), get_messages(), has_messages_of_type(), and print().


The documentation for this class was generated from the following files:
Modified on Mon Jun 17 05:05:04 2024 by modify_doxy.py rev. 669887