OpenWord 1.0.0
Modern C++17 library for parsing, manipulating, and saving DOCX files.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
openword::SchemaValidator Class Reference

#include <Validator.h>

Public Member Functions

 SchemaValidator (gsl::czstring xsdPath)
 Loads an XSD schema for validation.
 
 ~SchemaValidator ()
 
 SchemaValidator (const SchemaValidator &)=delete
 
SchemaValidatoroperator= (const SchemaValidator &)=delete
 
bool isValid () const
 Checks if the schema was successfully loaded and parsed.
 
bool validate (gsl::czstring xmlContent, std::string &outErrors) const
 Validates an XML string against the loaded schema.
 

Constructor & Destructor Documentation

◆ SchemaValidator() [1/2]

openword::SchemaValidator::SchemaValidator ( gsl::czstring  xsdPath)
explicit

Loads an XSD schema for validation.

Parameters
xsdPathPath to the .xsd file.

◆ ~SchemaValidator()

openword::SchemaValidator::~SchemaValidator ( )

◆ SchemaValidator() [2/2]

openword::SchemaValidator::SchemaValidator ( const SchemaValidator )
delete

Member Function Documentation

◆ isValid()

bool openword::SchemaValidator::isValid ( ) const

Checks if the schema was successfully loaded and parsed.

◆ operator=()

SchemaValidator & openword::SchemaValidator::operator= ( const SchemaValidator )
delete

◆ validate()

bool openword::SchemaValidator::validate ( gsl::czstring  xmlContent,
std::string &  outErrors 
) const

Validates an XML string against the loaded schema.

Parameters
xmlContentThe XML string to validate.
outErrorsA string to hold any validation error messages.
Returns
true if valid, false if invalid.

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