26#include <unordered_set>
28#include "util/IdMapping.h"
66 explicit operator bool()
const {
return errors.empty(); }
73 using ValidationResult::ValidationResult;
75 std::unordered_map<std::string, json_pointer>
lyricLines;
Represents an MNX document and provides methods for loading and saving.
Definition Document.h:87
ValidationResult schemaValidate(const Document &document, const std::optional< std::string > &jsonSchema)
Validates a document against a JSON schema.
Definition SchemaValidate.cpp:30
SemanticValidationResult semanticValidate(const Document &document)
Validates the semantics of the input MNX document.
Definition SemanticValidate.cpp:386
object model for MNX format
json::json_pointer json_pointer
JSON pointer class for MNX.
Definition BaseTypes.h:197
nlohmann::ordered_json json
JSON class for MNX.
Definition BaseTypes.h:196
Returns the results of semantic validation.
Definition Validation.h:72
std::unordered_map< std::string, json_pointer > lyricLines
Definition Validation.h:75
All the information about a specific error.
Definition Validation.h:47
json instance
instance containing the error
Definition Validation.h:52
json_pointer pointer
the location of the instance in the top level
Definition Validation.h:53
Error(const json_pointer &ptr, const json &inst, const std::string &msg)
constructor
Definition Validation.h:49
std::string message
a message describing the error
Definition Validation.h:54
std::string to_string(int indent=-1) const
Converts the error to a string. (Matches the schema validator's default message.)
Definition Validation.h:58
Encapsulates a schema validation result.
Definition Validation.h:43
std::vector< Error > errors
errors encountered
Definition Validation.h:63