Smithy Qt 0.1.0-pre
Internal development documentation
|
The Model class provides a Qt representation of a Smithy semantic model. More...
Public Types | |
enum class | Error { NoError = 0 , NoData = 1 , InvalidMetadata = 2 , InvalidShapes = 3 , InvalidShapeId = 4 , InvalidShape = 5 , ConflictingMetadata = 6 } |
Public Member Functions | |
Model () | |
Constructs a new, empty Smithy model. | |
Model (Model &&other) | |
Model (const Model &other) | |
Model & | operator= (const Model &model) |
Model & | operator= (const Model &&model) |
~Model () | |
Destroys this Model object. | |
void | clear () |
bool | insert (const QJsonObject &ast) |
Add the logical content of the JSON AST model file given by ast into this semantic model. | |
bool | finish () |
Error | error () const |
bool | isValid () const |
QJsonObject | metadata () const |
Shape | shape (const ShapeId &shapeId) const |
QHash< ShapeId, Shape > | shapes (const Shape::Type &type=Shape::Type::Undefined) const |
Protected Attributes | |
ModelPrivate * | d_ptr |
Private Member Functions | |
Q_DECLARE_TR_FUNCTIONS (Model) | |
The Model class provides a Qt representation of a Smithy semantic model.
|
strong |
Model::Model | ( | ) |
Constructs a new, empty Smithy model.
Definition at line 27 of file model.cpp.
References d_ptr, and Model().
Referenced by finish(), insert(), Model(), shape(), and shapes().
Model::Model | ( | Model && | other | ) |
Model::Model | ( | const Model & | other | ) |
Model::~Model | ( | ) |
void Model::clear | ( | ) |
Model::Error Model::error | ( | ) | const |
bool Model::finish | ( | ) |
Definition at line 186 of file model.cpp.
References Model().
bool Model::insert | ( | const QJsonObject & | ast | ) |
Add the logical content of the JSON AST model file given by ast into this semantic model.
A Smithy semantic model is split into one or more model files. Use this method to add all model files that comprise this semantic model.
Definition at line 102 of file model.cpp.
References ShapeId::hasNameSpace(), ShapeId::isValid(), Model(), shape(), shapes(), and ShapeId::toString().
bool Model::isValid | ( | ) | const |
QJsonObject Model::metadata | ( | ) | const |
Definition at line 65 of file model.cpp.
Definition at line 223 of file model.cpp.
References Model().
Referenced by insert().
QHash< ShapeId, Shape > Model::shapes | ( | const Shape::Type & | type = Shape::Type::Undefined | ) | const |
Definition at line 230 of file model.cpp.
References Model(), shapes(), and Shape::Undefined.
Referenced by insert(), and shapes().
|
protected |