7 #ifndef __FWRUNTIME_IO_VALIDATOR_HPP__ 8 #define __FWRUNTIME_IO_VALIDATOR_HPP__ 13 #include <boost/filesystem/path.hpp> 14 #include <libxml/tree.h> 15 #include <libxml/xmlschemastypes.h> 17 #include "fwRuntime/config.hpp" 56 FWRUNTIME_API
Validator(
const std::string & schema );
65 FWRUNTIME_API
Validator(
const boost::filesystem::path & path );
82 FWRUNTIME_API
const std::string
getErrorLog()
const;
91 FWRUNTIME_API
bool validate(
const boost::filesystem::path & xmlFile );
100 FWRUNTIME_API
bool validate( xmlNodePtr node );
112 void initializeContext();
114 std::string m_xsd_content;
115 std::ostringstream m_errorLog;
117 typedef std::shared_ptr< xmlSchemaParserCtxt > SchemaParserCtxtSptr;
118 typedef std::shared_ptr< xmlSchema > SchemaSptr;
119 typedef std::shared_ptr< xmlSchemaValidCtxt > SchemaValidCtxtSptr;
121 SchemaParserCtxtSptr m_schemaParserContext;
123 SchemaValidCtxtSptr m_schemaValidContext;
125 static void ErrorHandler(
void * userData, xmlErrorPtr error );
void clearErrorLog()
Clears the error log.
FWRUNTIME_API const std::string getErrorLog() const
Retrieves the error log content.
FWRUNTIME_API bool validate(const boost::filesystem::path &xmlFile)
Validates the given file.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
Implements an XML validator.
FWRUNTIME_API Validator(const Validator &validator)
Copy Constructor.
FWRUNTIME_API ~Validator()
Destructor.
FWRUNTIME_API std::string getXsdContent()
Returns the xsd content in string format.