libxml++ 5.0.1

- Main Page
- Related Pages
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
xmlpp::Validator Class Referenceabstract

Base class for XML validators. More...

`#include <libxml++/validators/validator.h>`

Inheritance diagram for xmlpp::Validator:
[legend]

## Public Member Functions
LIBXMLPP_API | Validator () noexcept
LIBXMLPP_API | ~Validator () override
virtual LIBXMLPP_API | operator bool () const noexcept=0
| Test whether a schema or a DTD has been parsed. More...
virtual LIBXMLPP_API void | parse_file (const std::string& filename)=0
| Parse a schema definition file or an external subset (DTD file). More...
virtual LIBXMLPP_API void | parse_memory (const ustring& contents)=0
| Parse a schema definition or a DTD from a string. More...
virtual LIBXMLPP_API void | validate (const Document* document)=0
| Validate a document, using a previously parsed schema or DTD. More...

## Protected Member Functions
virtual LIBXMLPP_API void | check_for_exception ()
virtual LIBXMLPP_API void | check_for_validity_messages ()
virtual LIBXMLPP_API void | handle_exception ()
| To be called in an exception handler. More...
virtual LIBXMLPP_API void | initialize_context ()
virtual LIBXMLPP_API void | on_validity_error (const ustring& message)
virtual LIBXMLPP_API void | on_validity_warning (const ustring& message)
virtual LIBXMLPP_API void | release_underlying ()
Protected Member Functions inherited from xmlpp::NonCopyable
| NonCopyable () noexcept
| NonCopyable (const NonCopyable&)=delete
| NonCopyable (NonCopyable&&)=delete
virtual | ~NonCopyable ()
NonCopyable& | operator= (const NonCopyable&)=delete
NonCopyable& | operator= (NonCopyable&&)=delete

## Static Protected Member Functions
static LIBXMLPP_API void | callback_validity_error (void* ctx, const char* msg,...)
static LIBXMLPP_API void | callback_validity_warning (void* ctx, const char* msg,...)

## Protected Attributes
std::unique_ptr< exception > | exception_
ustring | validate_error_
ustring | validate_warning_

## Detailed Description

Base class for XML validators.

## Constructor & Destructor Documentation

LIBXMLPP_API xmlpp::Validator::Validator | ( |  | ) |
| noexcept

LIBXMLPP_API xmlpp::Validator::~Validator | ( |  | ) |
| override

## Member Function Documentation

static LIBXMLPP_API void xmlpp::Validator::callback_validity_error | ( | void * | ctx,
|  | const char * | msg,
|  |  | ...
| ) |  |
| static protected

static LIBXMLPP_API void xmlpp::Validator::callback_validity_warning | ( | void * | ctx,
|  | const char * | msg,
|  |  | ...
| ) |  |
| static protected

virtual LIBXMLPP_API void xmlpp::Validator::check_for_exception | ( |  | ) |
| protected virtual

virtual LIBXMLPP_API void xmlpp::Validator::check_for_validity_messages | ( |  | ) |
| protected virtual

virtual LIBXMLPP_API void xmlpp::Validator::handle_exception | ( |  | ) |
| protected virtual

To be called in an exception handler.

virtual LIBXMLPP_API void xmlpp::Validator::initialize_context | ( |  | ) |
| protected virtual

Reimplemented in xmlpp::RelaxNGValidator, xmlpp::XsdValidator, xmlpp::DtdValidator, and xmlpp::SchemaValidatorBase.

virtual LIBXMLPP_API void xmlpp::Validator::on_validity_error | ( | const ustring& | message | ) |
| protected virtual

virtual LIBXMLPP_API void xmlpp::Validator::on_validity_warning | ( | const ustring& | message | ) |
| protected virtual

virtual LIBXMLPP_API xmlpp::Validator::operator bool | ( |  | ) | const
| explicit pure virtual noexcept

Test whether a schema or a DTD has been parsed.

For instance

if (validator)
do_something();

Implemented in xmlpp::RelaxNGValidator, xmlpp::XsdValidator, xmlpp::DtdValidator, and xmlpp::SchemaValidatorBase.

virtual LIBXMLPP_API void xmlpp::Validator::parse_file | ( | const std::string & | filename | ) |
| pure virtual

Parse a schema definition file or an external subset (DTD file).

Parameters

  filename | The URL of the schema or the DTD.

Exceptions

  xmlpp::parse_error |

Implemented in xmlpp::RelaxNGValidator, xmlpp::XsdValidator, xmlpp::DtdValidator, and xmlpp::SchemaValidatorBase.

virtual LIBXMLPP_API void xmlpp::Validator::parse_memory | ( | const ustring& | contents | ) |
| pure virtual

Parse a schema definition or a DTD from a string.

Parameters

  contents | The schema definition or the DTD as a string.

Exceptions

  xmlpp::parse_error |

Implemented in xmlpp::RelaxNGValidator, xmlpp::XsdValidator, xmlpp::DtdValidator, and xmlpp::SchemaValidatorBase.

virtual LIBXMLPP_API void xmlpp::Validator::release_underlying | ( |  | ) |
| protected virtual

Reimplemented in xmlpp::RelaxNGValidator, xmlpp::XsdValidator, xmlpp::DtdValidator, and xmlpp::SchemaValidatorBase.

virtual LIBXMLPP_API void xmlpp::Validator::validate | ( | const Document* | document | ) |
| pure virtual

Validate a document, using a previously parsed schema or DTD.

Parameters

  document | Pointer to the document.

Exceptions

  xmlpp::internal_error |
  xmlpp::validity_error |

Implemented in xmlpp::RelaxNGValidator, xmlpp::XsdValidator, xmlpp::DtdValidator, and xmlpp::SchemaValidatorBase.

## Member Data Documentation

std::unique_ptr<exception> xmlpp::Validator::exception_
| protected

ustring xmlpp::Validator::validate_error_
| protected

ustring xmlpp::Validator::validate_warning_
| protected