From f812e01570aedd5033245a76846b5afc0063bc17 Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 11 Feb 2015 17:51:50 +0100 Subject: made isSubtree (fieldType) and primitivity orthogonal concepts: PRIMITIVE is no FieldType anymore. --- src/plugins/xml/XmlParser.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/xml/XmlParser.cpp b/src/plugins/xml/XmlParser.cpp index e8e97e2..22498f4 100644 --- a/src/plugins/xml/XmlParser.cpp +++ b/src/plugins/xml/XmlParser.cpp @@ -575,7 +575,7 @@ public: Rooted parent = scope().selectOrThrow(); Rooted field = parent->createFieldDescriptor( - type, args["name"].asString(), args["optional"].asBool()); + logger(), type, args["name"].asString(), args["optional"].asBool()); field->setLocation(location()); scope().push(field); @@ -624,8 +624,16 @@ public: { Rooted parent = scope().selectOrThrow(); + FieldDescriptor::FieldType fieldType; + if (args["isSubtree"].asBool()) { + fieldType = FieldDescriptor::FieldType::SUBTREE; + } else { + fieldType = FieldDescriptor::FieldType::TREE; + } + Rooted field = parent->createPrimitiveFieldDescriptor( - nullptr, args["name"].asString(), args["optional"].asBool()); + nullptr, logger(), fieldType, args["name"].asString(), + args["optional"].asBool()); field->setLocation(location()); const std::string &type = args["type"].asString(); @@ -742,7 +750,7 @@ public: if (parent != nullptr) { Rooted field = parent.cast()->createFieldDescriptor( - type, name, optional); + logger, type, name, optional); field->addChild(strct.cast()); } }); @@ -978,6 +986,7 @@ static const ParserState DomainStructPrimitive = .createdNodeType(&RttiTypes::FieldDescriptor) .elementHandler(DomainPrimitiveHandler::create) .arguments({Argument::String("name", DEFAULT_FIELD_NAME), + Argument::Bool("isSubtree", false), Argument::Bool("optional", false), Argument::String("type")}); -- cgit v1.2.3