MCPcopy Create free account
hub / github.com/GENIVI/CANdevStudio / loadConfigSchema

Method loadConfigSchema

src/gui/projectconfig/projectconfigvalidator.cpp:49–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49bool ProjectConfigValidator::loadConfigSchema(const char* filename)
50{
51 using namespace rapidjson;
52
53 QFile file(filename);
54 if (!file.open(QIODevice::ReadOnly))
55 {
56 cds_error("Could not open configuration schema file");
57 return false;
58 }
59
60 QByteArray data = file.readAll();
61
62 Document sd;
63 if (sd.Parse(data.toStdString()).HasParseError())
64 {
65 cds_error("Could not parse configuration schema file");
66 return false;
67 }
68
69 configSchema = std::make_shared<SchemaDocument>(sd);
70
71
72 return ProjectConfigValidator::schemaInitialized = true;
73}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected