/*
Ousía
Copyright (C) 2014, 2015 Benjamin Paaßen, Andreas Stöckel
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
#include
#include
#include "ParserScope.hpp"
#include "ParserContext.hpp"
namespace ousia {
/* Class ParserContext */
ParserContext::ParserContext(Registry ®istry,
ResourceManager &resourceManager,
ParserScope &scope, Handle project,
Logger &logger, SourceId sourceId)
: registry(registry),
resourceManager(resourceManager),
scope(scope),
project(project),
logger(logger),
sourceId(sourceId)
{
}
Rooted ParserContext::import(const std::string &path,
const std::string mimetype,
const std::string rel,
const RttiSet &supportedTypes)
{
return resourceManager.import(*this, path, mimetype, rel, supportedTypes);
}
NodeVector ParserContext::include(const std::string &path,
const std::string mimetype,
const std::string rel,
const RttiSet &supportedTypes)
{
return resourceManager.include(*this, path, mimetype, rel, supportedTypes);
}
ParserContext ParserContext::clone(ParserScope &scope, SourceId sourceId) const
{
return ParserContext{registry, resourceManager, scope,
project, logger, sourceId};
}
Manager &ParserContext::getManager() const { return project->getManager(); }
}