From fce5cce5fdc7bd265eb023dfc0fc1accbe5a796e Mon Sep 17 00:00:00 2001 From: Benjamin Paassen Date: Wed, 4 Feb 2015 20:20:02 +0100 Subject: set non-empty default field name. --- src/core/model/Domain.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/core/model/Domain.hpp') diff --git a/src/core/model/Domain.hpp b/src/core/model/Domain.hpp index 6648551..bef7919 100644 --- a/src/core/model/Domain.hpp +++ b/src/core/model/Domain.hpp @@ -217,6 +217,9 @@ class Descriptor; class StructuredClass; class Domain; + +static const std::string DEFAULT_FIELD_NAME = "$default"; + /** * As mentioned in the description above a FieldDescriptor specifies the * StructuredClasses that are allowed as children of a StructuredClass or @@ -289,7 +292,7 @@ public: * Descriptor to be valid. */ FieldDescriptor(Manager &mgr, Handle parent, - Handle primitiveType, std::string name = "", + Handle primitiveType, std::string name = DEFAULT_FIELD_NAME, bool optional = false); /** @@ -309,7 +312,7 @@ public: */ FieldDescriptor(Manager &mgr, Handle parent = nullptr, FieldType fieldType = FieldType::TREE, - std::string name = "", bool optional = false); + std::string name = DEFAULT_FIELD_NAME, bool optional = false); /** * Returns a const reference to the NodeVector of StructuredClasses whose @@ -559,7 +562,7 @@ public: * @return the newly created FieldDescriptor. */ Rooted createPrimitiveFieldDescriptor( - Handle primitiveType, std::string name = "", + Handle primitiveType, std::string name = DEFAULT_FIELD_NAME, bool optional = false); /** @@ -578,7 +581,8 @@ public: */ Rooted createFieldDescriptor( FieldDescriptor::FieldType fieldType = FieldDescriptor::FieldType::TREE, - std::string name = "", bool optional = false); + std::string name = DEFAULT_FIELD_NAME, + bool optional = false); /** * This tries to construct the shortest possible path of this Descriptor @@ -739,7 +743,7 @@ public: * @param root specifies whether this StructuredClass is * allowed to be at the root of a Document. */ - StructuredClass(Manager &mgr, std::string name = "", + StructuredClass(Manager &mgr, std::string name, Handle domain = nullptr, Variant cardinality = AnyCardinality, Handle attributesDescriptor = nullptr, -- cgit v1.2.3