DataLocation::Ptr OpenLocation(Parameters::Accessor::Ptr coreParams, Binary::Container::Ptr data, const String& subpath) { const ArchivePluginsEnumerator::Ptr usedPlugins = ArchivePluginsEnumerator::Create(); DataLocation::Ptr resolvedLocation = boost::make_shared<UnresolvedLocation>(data); const Analysis::Path::Ptr sourcePath = Analysis::ParsePath(subpath, Text::MODULE_SUBPATH_DELIMITER[0]); for (Analysis::Path::Ptr unresolved = sourcePath; !unresolved->Empty(); unresolved = sourcePath->Extract(resolvedLocation->GetPath()->AsString())) { const String toResolve = unresolved->AsString(); Dbg("Resolving '%1%'", toResolve); if (!(resolvedLocation = TryToOpenLocation(*usedPlugins, *coreParams, resolvedLocation, *unresolved))) { throw MakeFormattedError(THIS_LINE, translate("Failed to resolve subpath '%1%'."), subpath); } } Dbg("Resolved '%1%'", subpath); return resolvedLocation; }