Skip to content

Commit

Permalink
added support for using type substitutions for replacing simple types…
Browse files Browse the repository at this point in the history
… with unsupported restrictions
  • Loading branch information
RlanderRISCSW committed May 24, 2022
1 parent 359f2c2 commit a1cadb8
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/lib/TypeSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@ namespace tigl {
}

auto resolveType(const xsd::SchemaTypes& types, const std::string& name, const Tables& tables) -> std::string {
// apply type substitution
if (const auto p = tables.m_typeSubstitutions.find(name))
return *p;

// search simple and complex types
const auto cit = types.types.find(name);
if (cit != std::end(types.types)) {
// apply type substitution
if (const auto p = tables.m_typeSubstitutions.find(name))
return *p;
else
return makeClassName(name);
}
if (cit != std::end(types.types))
return makeClassName(name);

// search predefined xml schema types and replace them
if (const auto p = tables.m_xsdTypes.find(name))
Expand Down

0 comments on commit a1cadb8

Please sign in to comment.