KiCad PCB EDA Suite
Loading...
Searching...
No Matches
JSON_SCHEMA_VALIDATOR Class Reference

Code outside of kicommon must validate through this class rather than instantiating nlohmann::json_schema::json_validator, whose static library objects carry nlohmann::json definitions that collide under MSVC with the ones kicommon.dll exports. More...

#include <json_schema_validator.h>

Public Member Functions

 JSON_SCHEMA_VALIDATOR (const wxFileName &aSchemaFile)
 
 JSON_SCHEMA_VALIDATOR (const nlohmann::json &aSchema)
 
 ~JSON_SCHEMA_VALIDATOR ()=default
 
nlohmann::json Validate (const nlohmann::json &aJson, nlohmann::json_schema::error_handler &aErrorHandler, const nlohmann::json_uri &aInitialUri=nlohmann::json_uri("#")) const
 

Private Member Functions

void setRootSchema (const nlohmann::json &aSchema)
 

Private Attributes

nlohmann::json_schema::json_validator m_validator
 

Detailed Description

Code outside of kicommon must validate through this class rather than instantiating nlohmann::json_schema::json_validator, whose static library objects carry nlohmann::json definitions that collide under MSVC with the ones kicommon.dll exports.

Definition at line 33 of file json_schema_validator.h.

Constructor & Destructor Documentation

◆ JSON_SCHEMA_VALIDATOR() [1/2]

JSON_SCHEMA_VALIDATOR::JSON_SCHEMA_VALIDATOR ( const wxFileName & aSchemaFile)

Definition at line 28 of file json_schema_validator.cpp.

References _, and setRootSchema().

◆ JSON_SCHEMA_VALIDATOR() [2/2]

JSON_SCHEMA_VALIDATOR::JSON_SCHEMA_VALIDATOR ( const nlohmann::json & aSchema)

Definition at line 53 of file json_schema_validator.cpp.

References _, and setRootSchema().

◆ ~JSON_SCHEMA_VALIDATOR()

JSON_SCHEMA_VALIDATOR::~JSON_SCHEMA_VALIDATOR ( )
default

References setRootSchema(), and Validate().

Member Function Documentation

◆ setRootSchema()

void JSON_SCHEMA_VALIDATOR::setRootSchema ( const nlohmann::json & aSchema)
private

◆ Validate()

nlohmann::json JSON_SCHEMA_VALIDATOR::Validate ( const nlohmann::json & aJson,
nlohmann::json_schema::error_handler & aErrorHandler,
const nlohmann::json_uri & aInitialUri = nlohmann::json_uri("#") ) const

Member Data Documentation

◆ m_validator

nlohmann::json_schema::json_validator JSON_SCHEMA_VALIDATOR::m_validator
private

Definition at line 49 of file json_schema_validator.h.

Referenced by setRootSchema(), and Validate().


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