From 84f0004cdf45f6fbad6461676897aa27f03cbb93 Mon Sep 17 00:00:00 2001 From: Andreas Stöckel Date: Tue, 27 Jan 2015 01:39:19 +0100 Subject: Removed dependency between "Project" model class and parser/resources. This reduces coupling and was stupid beforehand. --- src/core/model/Project.cpp | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) (limited to 'src/core/model/Project.cpp') diff --git a/src/core/model/Project.cpp b/src/core/model/Project.cpp index 2833b37..b355969 100644 --- a/src/core/model/Project.cpp +++ b/src/core/model/Project.cpp @@ -17,8 +17,6 @@ */ #include -#include -#include #include "Domain.hpp" #include "Document.hpp" @@ -27,52 +25,22 @@ namespace ousia { -Project::Project(Manager &mgr, Registry ®istry) +Project::Project(Manager &mgr) : Node(mgr), - registry(registry), systemTypesystem(acquire(new SystemTypesystem(mgr))), documents(this) { } -Rooted Project::parse(const std::string &path, const std::string mimetype, - const std::string rel, - const RttiSet &supportedTypes, Logger &logger) -{ - ParserScope scope; - ParserContext context(this, scope, logger); - return resourceManager.link(registry, context, path, mimetype, rel, - supportedTypes); -} - -Rooted Project::link(ParserContext &ctx, const std::string &path, - const std::string mimetype, const std::string rel, - const RttiSet &supportedTypes) -{ - return resourceManager.link(registry, ctx, path, mimetype, rel, - supportedTypes); -} - -Rooted Project::include(ParserContext &ctx, const std::string &path, - const std::string mimetype, const std::string rel, - const RttiSet &supportedTypes) -{ - return resourceManager.include(registry, ctx, path, mimetype, rel, - supportedTypes); -} - -SourceContextCallback Project::getSourceContextCallback() -{ - return [&](const SourceLocation &location) { - return resourceManager.readContext(location); - }; -} - bool Project::doValidate(Logger &logger) const { return continueValidation(documents, logger); } +void Project::doResolve(ResolutionState &state){ + continueResolveComposita(documents, documents.getIndex(), state); +} + Rooted Project::getSystemTypesystem() { return systemTypesystem; -- cgit v1.2.3