| 47 | } |
| 48 | |
| 49 | bool 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 | } |
no outgoing calls
no test coverage detected