104 const std::vector<std::filesystem::path>& extensions,
105 const std::vector<std::filesystem::path>& mappings,
127 void readDirectory(const
std::filesystem::path& path);
131 void readExtension(const
std::filesystem::path& path);
135 Document& readDocument(const
std::filesystem::path& path, const
std::
string& package,
bool isExtension);
139 void resolveDependencies();
143 [[nodiscard]]
Document* findDocument(const
std::
string& identification) const;
150 void indexDeclarations();
153 void record(const
std::
string& key, pugi::xml_node node,
Document& document);
167 [[nodiscard]]
std::optional<
Declaration> introducedType(const
std::
string& category,
168 const
std::
string& fomName) const;
172 [[nodiscard]]
std::optional<
Declaration> externallyOwnedType(const
std::
string& category,
173 const
std::
string& fomName,
177 void buildRootTypeSet();
185 void ensureBuilt(
Document& document);
188 void validateImportGraph() const;
191 void populateTypes(
Document& document);
194 template <typename F>
197 template <typename F>
198 void processTypeSource(
Document& document, const pugi::xpath_node_set& nodes, F func);
201 template <typename F>
203 const
std::
string& query,
204 const
std::
string& queryPostFix,
221 void addExtensionImport(
Document& document,
Document& imported, const
std::
string& fomName);
224 [[nodiscard]]
bool importsTransitively(const
Document& from,
234 const
std::
string& qualifiedName) const;
240 const char* container;
247 [[nodiscard]]
static const std::array<Category, 5>& dataTypeCategories();
250 [[nodiscard]]
static std::string categoryQuery(
const Category& category);
261 void applyMappings(ClassSpec& classSpec,
262 std::vector<PropertySpec>& propertySpecs,
269 [[nodiscard]]
PropertySpec propertyFromAttribute(pugi::xml_node attrNode,
272 bool fromExtension =
false);
275 void basicDataRepresentation(pugi::xml_node node,
const Document& document);
278 [[nodiscard]]
ConstTypeHandle<> optionalPropertyType(
const std::string& fomElementTypeName,
280 bool fromExtension =
false);
286 enum class CallableEnum : uint8_t
292 struct FoundInteraction
295 Document* document {};
298 [[nodiscard]] FoundInteraction findInteraction(
const std::string& path, Document& document);
299 [[nodiscard]] FoundInteraction findInteractionAnywhere(
const std::string& path,
const std::string& askedBy);
300 [[nodiscard]] Arg argFromParameter(pugi::xml_node paramNode, Document& document,
bool fromExtension =
false);
301 [[nodiscard]] std::vector<Arg> collectArgs(pugi::xml_node interactionNode,
302 const std::vector<std::string>& ignoredParams,
306 const std::vector<std::string>& ignoredParams);
307 [[nodiscard]] CallableSpec makeCallableSpec(pugi::xml_node interactionNode,
308 const std::vector<std::string>& ignoredParams,
310 CallableEnum callableEnum,
312 [[nodiscard]] EventSpec makeEventSpec(pugi::xml_node interactionNode,
313 const std::vector<std::string>& ignoredParams,
316 [[nodiscard]] MethodSpec makeMethodSpec(pugi::xml_node interactionNode,
317 pugi::xml_node returnNode,
318 const std::vector<std::string>& ignoredParams,
322 const std::string& qualifiedClassName);
328 [[nodiscard]] std::string senName(
const std::string& fomTypeName)
const;
329 [[nodiscard]] std::string senQualifiedName(
const Document& document,
const std::string& fomTypeName)
const;
330 [[nodiscard]] std::string withPackage(
const Document& document,
const std::string& str)
const;
331 [[nodiscard]]
ConstTypeHandle<> representationToType(
const std::string& representation)
const;
334 TypeSettings settings_;
335 std::vector<std::unique_ptr<Document>> documents_;
336 std::vector<MappingDocument> mappings_;
341 std::map<std::string, std::vector<std::string>> argsStructIgnores_;
347 std::vector<std::string> packedWithIgnores_;
350 std::vector<std::filesystem::path> extensionPaths_;
353 std::map<std::string, Declarations> declarations_;
355 std::unordered_map<std::string, ConstTypeHandle<>> representations_;
356 std::unordered_map<std::string, std::string> units_;
357 std::unique_ptr<TypeSet> rootSet_;
358 std::optional<TypeHandle<ClassType>> rootClass_;
362 std::vector<std::pair<std::string, const Document*>> resolving_;
366 size_t extensionResolutionDepth_ {};