mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
JsonCpp to QTJson (Part 4) (#266)
* Update ActiveEffectDefinition.h * Update EffectDefinition.h * Update EffectEngine.h * Update Hyperion.h * Update LedDevice.h * Update QJsonFactory.h * Update QJsonSchemaChecker.h * Update Effect.cpp * Update Effect.h * Update EffectEngine.cpp * Update Hyperion.cpp * Update JsonClientConnection.cpp * Update JsonClientConnection.h * Update schema-config.json * Update LedDevice.cpp * Update QJsonSchemaChecker.cpp * Update hyperion-remote.cpp * Update JsonConnection.cpp * Update JsonConnection.h * Update hyperiond.cpp
This commit is contained in:
committed by
redPanther
parent
0a142b0e7d
commit
d9c2a2d91a
@@ -85,4 +85,16 @@ public:
|
||||
file.close();
|
||||
return doc.object();
|
||||
}
|
||||
|
||||
static void writeJson(const QString& filename, QJsonObject& jsonTree)
|
||||
{
|
||||
QJsonDocument doc;
|
||||
doc.setObject(jsonTree);
|
||||
QByteArray configData = doc.toJson(QJsonDocument::Indented);
|
||||
|
||||
QFile configFile(filename);
|
||||
configFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
|
||||
configFile.write(configData);
|
||||
configFile.close();
|
||||
}
|
||||
};
|
||||
|
@@ -43,7 +43,7 @@ public:
|
||||
/// @param value The JSON value to check
|
||||
/// @return true when the arguments is valid according to the schema
|
||||
///
|
||||
bool validate(const QJsonObject & value);
|
||||
bool validate(const QJsonObject & value, bool ignoreRequired = false);
|
||||
|
||||
///
|
||||
/// @return A list of error messages
|
||||
@@ -180,7 +180,8 @@ private:
|
||||
private:
|
||||
/// The schema of the entire json-configuration
|
||||
QJsonObject _qSchema;
|
||||
|
||||
/// ignore the required value in json schema
|
||||
bool _ignoreRequired;
|
||||
/// The current location into a json-configuration structure being checked
|
||||
std::list<std::string> _currentPath;
|
||||
/// The result messages collected during the schema verification
|
||||
|
Reference in New Issue
Block a user