/* * Copyright (c) Atmosphère-NX * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope 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 . */ #pragma once #include #include "lr_location_resolver_manager_factory.hpp" #include "lr_remote_location_resolver_impl.hpp" #include "lr_remote_registered_location_resolver_impl.hpp" namespace ams::lr { #if defined(ATMOSPHERE_OS_HORIZON) class RemoteLocationResolverManagerImpl { public: RemoteLocationResolverManagerImpl() { R_ABORT_UNLESS(::lrInitialize()); } ~RemoteLocationResolverManagerImpl() { ::lrExit(); } public: /* Actual commands. */ Result OpenLocationResolver(sf::Out> out, ncm::StorageId storage_id) { LrLocationResolver lr; R_TRY(::lrOpenLocationResolver(static_cast<::NcmStorageId>(storage_id), std::addressof(lr))); *out = LocationResolverManagerFactory::CreateSharedEmplaced(lr); R_SUCCEED(); } Result OpenRegisteredLocationResolver(sf::Out> out) { LrRegisteredLocationResolver lr; R_TRY(::lrOpenRegisteredLocationResolver(std::addressof(lr))); *out = LocationResolverManagerFactory::CreateSharedEmplaced(lr); R_SUCCEED(); } Result RefreshLocationResolver(ncm::StorageId storage_id) { AMS_UNUSED(storage_id); AMS_ABORT("TODO: libnx binding"); } Result OpenAddOnContentLocationResolver(sf::Out> out) { AMS_UNUSED(out); AMS_ABORT("TODO: libnx binding"); } Result SetEnabled(const sf::InMapAliasArray &storages) { AMS_UNUSED(storages); AMS_ABORT("TODO: libnx binding"); } }; static_assert(lr::IsILocationResolverManager); #endif }