2020-03-08 08:06:23 +00:00
|
|
|
/*
|
2021-10-04 19:59:10 +00:00
|
|
|
* Copyright (c) Atmosphère-NX
|
2020-03-08 08:06:23 +00:00
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "lr_location_resolver_impl_base.hpp"
|
|
|
|
|
|
|
|
namespace ams::lr {
|
|
|
|
|
|
|
|
class ContentLocationResolverImpl : public LocationResolverImplBase {
|
|
|
|
private:
|
2021-10-10 07:14:06 +00:00
|
|
|
ncm::StorageId m_storage_id;
|
2020-03-08 08:06:23 +00:00
|
|
|
|
|
|
|
/* Objects for this storage type. */
|
2021-10-10 07:14:06 +00:00
|
|
|
ncm::ContentMetaDatabase m_content_meta_database;
|
|
|
|
ncm::ContentStorage m_content_storage;
|
2020-03-08 08:06:23 +00:00
|
|
|
public:
|
2022-03-22 21:02:14 +00:00
|
|
|
ContentLocationResolverImpl(ncm::StorageId storage_id) : m_storage_id(storage_id), m_content_meta_database(), m_content_storage() { /* ... */ }
|
2020-03-08 08:06:23 +00:00
|
|
|
|
|
|
|
~ContentLocationResolverImpl();
|
|
|
|
private:
|
|
|
|
/* Helper functions. */
|
|
|
|
void GetContentStoragePath(Path *out, ncm::ContentId content_id);
|
|
|
|
public:
|
|
|
|
/* Actual commands. */
|
2020-07-08 00:07:23 +00:00
|
|
|
Result ResolveProgramPath(sf::Out<Path> out, ncm::ProgramId id);
|
|
|
|
Result RedirectProgramPath(const Path &path, ncm::ProgramId id);
|
|
|
|
Result ResolveApplicationControlPath(sf::Out<Path> out, ncm::ProgramId id);
|
|
|
|
Result ResolveApplicationHtmlDocumentPath(sf::Out<Path> out, ncm::ProgramId id);
|
|
|
|
Result ResolveDataPath(sf::Out<Path> out, ncm::DataId id);
|
|
|
|
Result RedirectApplicationControlPathDeprecated(const Path &path, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationControlPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id);
|
|
|
|
Result RedirectApplicationHtmlDocumentPathDeprecated(const Path &path, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationHtmlDocumentPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id);
|
|
|
|
Result ResolveApplicationLegalInformationPath(sf::Out<Path> out, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationLegalInformationPathDeprecated(const Path &path, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationLegalInformationPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id);
|
|
|
|
Result Refresh();
|
|
|
|
Result RedirectApplicationProgramPathDeprecated(const Path &path, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationProgramPath(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id);
|
|
|
|
Result ClearApplicationRedirectionDeprecated();
|
|
|
|
Result ClearApplicationRedirection(const sf::InArray<ncm::ProgramId> &excluding_ids);
|
|
|
|
Result EraseProgramRedirection(ncm::ProgramId id);
|
|
|
|
Result EraseApplicationControlRedirection(ncm::ProgramId id);
|
|
|
|
Result EraseApplicationHtmlDocumentRedirection(ncm::ProgramId id);
|
|
|
|
Result EraseApplicationLegalInformationRedirection(ncm::ProgramId id);
|
|
|
|
Result ResolveProgramPathForDebug(sf::Out<Path> out, ncm::ProgramId id);
|
|
|
|
Result RedirectProgramPathForDebug(const Path &path, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationProgramPathForDebugDeprecated(const Path &path, ncm::ProgramId id);
|
|
|
|
Result RedirectApplicationProgramPathForDebug(const Path &path, ncm::ProgramId id, ncm::ProgramId owner_id);
|
|
|
|
Result EraseProgramRedirectionForDebug(ncm::ProgramId id);
|
2020-03-08 08:06:23 +00:00
|
|
|
};
|
2020-07-08 00:07:23 +00:00
|
|
|
static_assert(lr::IsILocationResolver<ContentLocationResolverImpl>);
|
2020-03-08 08:06:23 +00:00
|
|
|
|
|
|
|
}
|