21#include <wx/filename.h>
30 std::ifstream schema_stream( aSchemaFile.GetFullPath().fn_str() );
31 nlohmann::json schema;
37#if defined(__MINGW32__) && defined(_UCRT)
41 schema_stream >> schema;
44 catch( std::exception& e )
46 if( !aSchemaFile.FileExists() )
48 wxLogError( wxString::Format(
_(
"schema file '%s' not found" ),
49 aSchemaFile.GetFullPath() ) );
53 wxLogError( wxString::Format(
_(
"Error loading schema: %s" ), e.what() ) );
60 nlohmann::json_schema::error_handler& aErrorHandler,
61 const nlohmann::json_uri& aInitialUri )
const
63 return m_validator.validate( aJson, aErrorHandler, aInitialUri );
JSON_SCHEMA_VALIDATOR(const wxFileName &aSchemaFile)
nlohmann::json_schema::json_validator m_validator
nlohmann::json Validate(const nlohmann::json &aJson, nlohmann::json_schema::error_handler &aErrorHandler, const nlohmann::json_uri &aInitialUri=nlohmann::json_uri("#")) const
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
std::vector< FAB_LAYER_COLOR > dummy