fw4spl
|
Implements an XML validator. More...
#include <Validator.hpp>
Public Member Functions | |
FWRUNTIME_API | Validator (const Validator &validator) |
Copy Constructor. More... | |
FWRUNTIME_API | Validator (const std::string &schema) |
Constructor. More... | |
FWRUNTIME_API | Validator (const boost::filesystem::path &path) |
Constructor. More... | |
FWRUNTIME_API | ~Validator () |
Destructor. | |
void | clearErrorLog () |
Clears the error log. | |
FWRUNTIME_API const std::string | getErrorLog () const |
Retrieves the error log content. More... | |
FWRUNTIME_API bool | validate (const boost::filesystem::path &xmlFile) |
Validates the given file. More... | |
FWRUNTIME_API bool | validate (xmlNodePtr node) |
Validates the given xml node. More... | |
FWRUNTIME_API std::string | getXsdContent () |
Returns the xsd content in string format. More... | |
Implements an XML validator.
Definition at line 37 of file Validator.hpp.
fwRuntime::io::Validator::Validator | ( | const Validator & | validator | ) |
Copy Constructor.
Copy a validator.
validator | to be copied |
Definition at line 31 of file Validator.cpp.
fwRuntime::io::Validator::Validator | ( | const std::string & | schema | ) |
Constructor.
Builds a validator with a string containing a XML shema.
schema | a string containing the XML schema |
Definition at line 40 of file Validator.cpp.
fwRuntime::io::Validator::Validator | ( | const boost::filesystem::path & | path | ) |
Constructor.
Builds a validator with a path to a file containing an XML schema.
path | a path to the xml schema file to load |
Definition at line 47 of file Validator.cpp.
const std::string fwRuntime::io::Validator::getErrorLog | ( | ) | const |
Retrieves the error log content.
Definition at line 73 of file Validator.cpp.
Referenced by fwRuntime::io::BundleDescriptorReader::createBundle(), fwRuntime::io::ProfileReader::createProfile(), and validate().
std::string fwRuntime::io::Validator::getXsdContent | ( | ) |
Returns the xsd content in string format.
Definition at line 196 of file Validator.cpp.
Referenced by validate().
bool fwRuntime::io::Validator::validate | ( | const boost::filesystem::path & | xmlFile | ) |
Validates the given file.
xmlFile | a path to an xml file to validate |
Definition at line 120 of file Validator.cpp.
References getErrorLog(), getXsdContent(), OSLM_ERROR, and OSLM_WARN.
Referenced by fwRuntime::io::BundleDescriptorReader::createBundle(), and fwRuntime::io::ProfileReader::createProfile().
bool fwRuntime::io::Validator::validate | ( | xmlNodePtr | node | ) |
Validates the given xml node.
node | a pointer to an xml node |
Definition at line 159 of file Validator.cpp.
References getErrorLog(), getXsdContent(), OSLM_ERROR, and OSLM_WARN.