NuriaProject Framework
0.1
The NuriaProject Framework
|
JsonMetaObjectReader is a parser for MetaObject data stored in JSON format as generated by Tria. More...
#include <jsonmetaobjectreader.hpp>
Public Types | |
enum | Error { NoError = 0, JsonParseError, RootIsNotAnObject, FileIsNotAnObject, TypeIsNotAnObject, AnnotationsIsNotAnArray, BasesIsNotAnArray, ConstructorsIsNotAnArray, MemberMethodsIsNotAnArray, StaticMethodsIsNotAnArray, EnumsIsNotAnObject, FieldsIsNotAnObject, BasesContainsNonString, AnnotationIsNotAnObject, AnnotationNameIsNotAString, AnnotationValueHasUnknownType, MethodIsNotAnObject, MethodNameIsNotAString, MethodResultTypeIsNotAString, MethodArgumentsHaveDifferentLengths, MethodArgumentNamesIsNotAnArray, MethodArgumentNamesContainsNonString, MethodArgumentTypesIsNotAnArray, MethodArgumentTypesContainsNonString, EnumIsNotAnObject, EnumValuesIsNotAnObject, EnumValueObjectValueIsNotAnInteger, FieldIsNotAnObject, FieldTypeIsNotAString, FieldReadOnlyIsNotABoolean } |
Public Member Functions | |
JsonMetaObjectReader (QObject *parent=0) | |
~JsonMetaObjectReader () | |
MetaObjectMap | metaObjects (const QString &sourceFile) |
Error | parse (const QJsonDocument &jsonDocument) |
Error | parse (const QJsonObject &root) |
Error | parse (const QByteArray &jsonData) |
QStringList | sourceFiles () |
JsonMetaObjectReader is a parser for MetaObject data stored in JSON format as generated by Tria.
Please note that the JSON format can store information about multiple source files at once.
All possible error codes.
|
explicit |
Constructor.
Nuria::JsonMetaObjectReader::~JsonMetaObjectReader | ( | ) |
Destructor.
MetaObjectMap Nuria::JsonMetaObjectReader::metaObjects | ( | const QString & | sourceFile | ) |
Returns the map of all known types in sourceFile.
Error Nuria::JsonMetaObjectReader::parse | ( | const QJsonDocument & | jsonDocument | ) |
Parses jsonDocument. The format is expected to match the one documented in Tria. Returns NoError
on success. If a error occured the corresponding error code is returned.
Error Nuria::JsonMetaObjectReader::parse | ( | const QJsonObject & | root | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Error Nuria::JsonMetaObjectReader::parse | ( | const QByteArray & | jsonData | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QStringList Nuria::JsonMetaObjectReader::sourceFiles | ( | ) |
Returns a list of all known source files.