mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-04-22 12:34:47 +00:00
More changes
This commit is contained in:
parent
d1d910362d
commit
b000168cfb
24 changed files with 120 additions and 132 deletions
|
@ -14,8 +14,8 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "../lr_contentlocationresolver.hpp"
|
||||
#include "../lr_redirectonlylocationresolver.hpp"
|
||||
#include "../lr_content_location_resolver.hpp"
|
||||
#include "../lr_redirect_only_location_resolver.hpp"
|
||||
#include "lr_location_resolver_manager_impl.hpp"
|
||||
|
||||
namespace ams::lr::impl {
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "../lr_addoncontentlocationresolver.hpp"
|
||||
#include "../lr_ilocationresolver.hpp"
|
||||
#include "../lr_add_on_content_location_resolver.hpp"
|
||||
#include "../lr_i_location_resolver.hpp"
|
||||
#include "../lr_i_location_resolver_manager.hpp"
|
||||
#include "../lr_registeredlocationresolver.hpp"
|
||||
#include "../lr_registered_location_resolver.hpp"
|
||||
#include "ncm_bounded_map.hpp"
|
||||
|
||||
namespace ams::lr::impl {
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
namespace ams::lr::impl {
|
||||
|
||||
enum RedirectionFlags {
|
||||
RedirectionFlags_None = (0 << 0),
|
||||
RedirectionFlags_Application = (1 << 0),
|
||||
RedirectionFlags_None = (0 << 0),
|
||||
RedirectionFlags_Application = (1 << 0),
|
||||
};
|
||||
|
||||
class LocationRedirector {
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
#include <stratosphere/kvdb/kvdb_memory_key_value_store.hpp>
|
||||
#include <optional>
|
||||
|
||||
#include "../ncm_contentmetadatabase.hpp"
|
||||
#include "../ncm_contentstorage.hpp"
|
||||
#include "../ncm_content_meta_database.hpp"
|
||||
#include "../ncm_content_storage.hpp"
|
||||
#include "../ncm_fs.hpp"
|
||||
#include "../ncm_make_path.hpp"
|
||||
#include "../ncm_readonlycontentstorage.hpp"
|
||||
#include "../ncm_read_only_content_storage.hpp"
|
||||
#include "ncm_content_manager.hpp"
|
||||
#include "ncm_rights_cache.hpp"
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "../ncm_icontentmetadatabase.hpp"
|
||||
#include "../ncm_icontentstorage.hpp"
|
||||
#include "../ncm_i_content_meta_database.hpp"
|
||||
#include "../ncm_i_content_storage.hpp"
|
||||
|
||||
namespace ams::ncm::impl {
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "impl/ncm_content_manager.hpp"
|
||||
#include "lr_addoncontentlocationresolver.hpp"
|
||||
#include "lr_add_on_content_location_resolver.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
|
@ -25,12 +25,12 @@ namespace ams::lr {
|
|||
class AddOnContentLocationResolverInterface : public sf::IServiceObject {
|
||||
protected:
|
||||
enum class CommandId {
|
||||
ResolveAddOnContentPath = 0,
|
||||
RegisterAddOnContentStorageDeprecated = 1,
|
||||
RegisterAddOnContentStorage = 1,
|
||||
UnregisterAllAddOnContentPath = 2,
|
||||
RefreshApplicationAddOnContent = 3,
|
||||
UnregisterApplicationAddOnContent = 4,
|
||||
ResolveAddOnContentPath = 0,
|
||||
RegisterAddOnContentStorageDeprecated = 1,
|
||||
RegisterAddOnContentStorage = 1,
|
||||
UnregisterAllAddOnContentPath = 2,
|
||||
RefreshApplicationAddOnContent = 3,
|
||||
UnregisterApplicationAddOnContent = 4,
|
||||
};
|
||||
private:
|
||||
impl::RegisteredStorages<ncm::ProgramId, 0x800> registered_storages;
|
|
@ -15,7 +15,7 @@
|
|||
*/
|
||||
|
||||
#include "impl/ncm_content_manager.hpp"
|
||||
#include "lr_contentlocationresolver.hpp"
|
||||
#include "lr_content_location_resolver.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
|
@ -18,9 +18,9 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "lr_ilocationresolver.hpp"
|
||||
#include "ncm_icontentmetadatabase.hpp"
|
||||
#include "ncm_icontentstorage.hpp"
|
||||
#include "lr_i_location_resolver.hpp"
|
||||
#include "ncm_i_content_meta_database.hpp"
|
||||
#include "ncm_i_content_storage.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
|
@ -25,32 +25,32 @@ namespace ams::lr {
|
|||
class ILocationResolver : public sf::IServiceObject {
|
||||
protected:
|
||||
enum class CommandId {
|
||||
ResolveProgramPath = 0,
|
||||
RedirectProgramPath = 1,
|
||||
ResolveApplicationControlPath = 2,
|
||||
ResolveApplicationHtmlDocumentPath = 3,
|
||||
ResolveDataPath = 4,
|
||||
RedirectApplicationControlPathDeprecated = 5,
|
||||
RedirectApplicationControlPath = 5,
|
||||
RedirectApplicationHtmlDocumentPathDeprecated = 6,
|
||||
RedirectApplicationHtmlDocumentPath = 6,
|
||||
ResolveApplicationLegalInformationPath = 7,
|
||||
RedirectApplicationLegalInformationPathDeprecated = 8,
|
||||
RedirectApplicationLegalInformationPath = 8,
|
||||
Refresh = 9,
|
||||
RedirectApplicationProgramPathDeprecated = 10,
|
||||
RedirectApplicationProgramPath = 10,
|
||||
ClearApplicationRedirectionDeprecated = 11,
|
||||
ClearApplicationRedirection = 11,
|
||||
EraseProgramRedirection = 12,
|
||||
EraseApplicationControlRedirection = 13,
|
||||
EraseApplicationHtmlDocumentRedirection = 14,
|
||||
EraseApplicationLegalInformationRedirection = 15,
|
||||
ResolveProgramPathForDebug = 16,
|
||||
RedirectProgramPathForDebug = 17,
|
||||
RedirectApplicationProgramPathForDebugDeprecated = 18,
|
||||
RedirectApplicationProgramPathForDebug = 18,
|
||||
EraseProgramRedirectionForDebug = 19,
|
||||
ResolveProgramPath = 0,
|
||||
RedirectProgramPath = 1,
|
||||
ResolveApplicationControlPath = 2,
|
||||
ResolveApplicationHtmlDocumentPath = 3,
|
||||
ResolveDataPath = 4,
|
||||
RedirectApplicationControlPathDeprecated = 5,
|
||||
RedirectApplicationControlPath = 5,
|
||||
RedirectApplicationHtmlDocumentPathDeprecated = 6,
|
||||
RedirectApplicationHtmlDocumentPath = 6,
|
||||
ResolveApplicationLegalInformationPath = 7,
|
||||
RedirectApplicationLegalInformationPathDeprecated = 8,
|
||||
RedirectApplicationLegalInformationPath = 8,
|
||||
Refresh = 9,
|
||||
RedirectApplicationProgramPathDeprecated = 10,
|
||||
RedirectApplicationProgramPath = 10,
|
||||
ClearApplicationRedirectionDeprecated = 11,
|
||||
ClearApplicationRedirection = 11,
|
||||
EraseProgramRedirection = 12,
|
||||
EraseApplicationControlRedirection = 13,
|
||||
EraseApplicationHtmlDocumentRedirection = 14,
|
||||
EraseApplicationLegalInformationRedirection = 15,
|
||||
ResolveProgramPathForDebug = 16,
|
||||
RedirectProgramPathForDebug = 17,
|
||||
RedirectApplicationProgramPathForDebugDeprecated = 18,
|
||||
RedirectApplicationProgramPathForDebug = 18,
|
||||
EraseProgramRedirectionForDebug = 19,
|
||||
};
|
||||
protected:
|
||||
impl::LocationRedirector program_redirector;
|
|
@ -18,19 +18,19 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "lr_addoncontentlocationresolver.hpp"
|
||||
#include "lr_ilocationresolver.hpp"
|
||||
#include "lr_registeredlocationresolver.hpp"
|
||||
#include "lr_add_on_content_location_resolver.hpp"
|
||||
#include "lr_i_location_resolver.hpp"
|
||||
#include "lr_registered_location_resolver.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
||||
class ILocationResolverManager : public sf::IServiceObject {
|
||||
protected:
|
||||
enum class CommandId {
|
||||
OpenLocationResolver = 0,
|
||||
OpenRegisteredLocationResolver = 1,
|
||||
RefreshLocationResolver = 2,
|
||||
OpenAddOnContentLocationResolver = 3,
|
||||
OpenLocationResolver = 0,
|
||||
OpenRegisteredLocationResolver = 1,
|
||||
RefreshLocationResolver = 2,
|
||||
OpenAddOnContentLocationResolver = 3,
|
||||
};
|
||||
public:
|
||||
/* Actual commands. */
|
||||
|
|
|
@ -15,16 +15,12 @@
|
|||
*/
|
||||
|
||||
#include "impl/ncm_content_manager.hpp"
|
||||
#include "lr_redirectonlylocationresolver.hpp"
|
||||
#include "lr_redirect_only_location_resolver.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
||||
RedirectOnlyLocationResolverInterface::~RedirectOnlyLocationResolverInterface() {
|
||||
this->program_redirector.ClearRedirections();
|
||||
this->debug_program_redirector.ClearRedirections();
|
||||
this->app_control_redirector.ClearRedirections();
|
||||
this->html_docs_redirector.ClearRedirections();
|
||||
this->legal_info_redirector.ClearRedirections();
|
||||
this->ClearRedirections();
|
||||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ResolveProgramPath(sf::Out<Path> out, ncm::ProgramId id) {
|
||||
|
@ -87,11 +83,7 @@ namespace ams::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::Refresh() {
|
||||
this->program_redirector.ClearRedirections();
|
||||
this->debug_program_redirector.ClearRedirections();
|
||||
this->app_control_redirector.ClearRedirections();
|
||||
this->html_docs_redirector.ClearRedirections();
|
||||
this->legal_info_redirector.ClearRedirections();
|
||||
this->ClearRedirections();
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
|
@ -106,11 +98,7 @@ namespace ams::lr {
|
|||
}
|
||||
|
||||
Result RedirectOnlyLocationResolverInterface::ClearApplicationRedirectionDeprecated() {
|
||||
this->program_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->debug_program_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->app_control_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->html_docs_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->legal_info_redirector.ClearRedirections(impl::RedirectionFlags_Application);
|
||||
this->ClearRedirections(impl::RedirectionFlags_Application);
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "lr_contentlocationresolver.hpp"
|
||||
#include "lr_content_location_resolver.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "lr_registeredlocationresolver.hpp"
|
||||
#include "lr_registered_location_resolver.hpp"
|
||||
|
||||
namespace ams::lr {
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace ams::lr {
|
|||
|
||||
Result RegisteredLocationResolverInterface::RefreshImpl(const ncm::ProgramId* excluding_ids, size_t num_ids) {
|
||||
/* On < 9.0.0, exclusion lists were not supported yet, so simply clear and return. */
|
||||
if (hos::GetVersion < hos::Version_900) {
|
||||
if (hos::GetVersion() < hos::Version_900) {
|
||||
this->ClearRedirections();
|
||||
return ResultSuccess();
|
||||
}
|
|
@ -18,8 +18,8 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "ncm_icontentmetadatabase.hpp"
|
||||
#include "ncm_icontentstorage.hpp"
|
||||
#include "ncm_i_content_meta_database.hpp"
|
||||
#include "ncm_i_content_storage.hpp"
|
||||
|
||||
namespace ams::ncm {
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ncm_contentmetadatabase.hpp"
|
||||
#include "ncm_content_meta_database.hpp"
|
||||
#include "ncm_utils.hpp"
|
||||
|
||||
namespace ams::ncm {
|
|
@ -18,7 +18,7 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "ncm_icontentmetadatabase.hpp"
|
||||
#include "ncm_i_content_meta_database.hpp"
|
||||
|
||||
namespace ams::ncm {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ncm_contentstorage.hpp"
|
||||
#include "ncm_content_storage.hpp"
|
||||
#include "ncm_fs.hpp"
|
||||
#include "ncm_make_path.hpp"
|
||||
#include "ncm_utils.hpp"
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include "impl/ncm_placeholder_accessor.hpp"
|
||||
#include "impl/ncm_rights_cache.hpp"
|
||||
#include "ncm_icontentstorage.hpp"
|
||||
#include "ncm_i_content_storage.hpp"
|
||||
#include "ncm_path_utils.hpp"
|
||||
|
||||
namespace ams::ncm {
|
|
@ -24,27 +24,27 @@ namespace ams::ncm {
|
|||
class IContentMetaDatabase : public sf::IServiceObject {
|
||||
protected:
|
||||
enum class CommandId {
|
||||
Set = 0,
|
||||
Get = 1,
|
||||
Remove = 2,
|
||||
GetContentIdByType = 3,
|
||||
ListContentInfo = 4,
|
||||
List = 5,
|
||||
GetLatestContentMetaKey = 6,
|
||||
ListApplication = 7,
|
||||
Has = 8,
|
||||
HasAll = 9,
|
||||
GetSize = 10,
|
||||
GetRequiredSystemVersion = 11,
|
||||
GetPatchId = 12,
|
||||
DisableForcibly = 13,
|
||||
LookupOrphanContent = 14,
|
||||
Commit = 15,
|
||||
HasContent = 16,
|
||||
ListContentMetaInfo = 17,
|
||||
GetAttributes = 18,
|
||||
GetRequiredApplicationVersion = 19,
|
||||
GetContentIdByTypeAndIdOffset = 20,
|
||||
Set = 0,
|
||||
Get = 1,
|
||||
Remove = 2,
|
||||
GetContentIdByType = 3,
|
||||
ListContentInfo = 4,
|
||||
List = 5,
|
||||
GetLatestContentMetaKey = 6,
|
||||
ListApplication = 7,
|
||||
Has = 8,
|
||||
HasAll = 9,
|
||||
GetSize = 10,
|
||||
GetRequiredSystemVersion = 11,
|
||||
GetPatchId = 12,
|
||||
DisableForcibly = 13,
|
||||
LookupOrphanContent = 14,
|
||||
Commit = 15,
|
||||
HasContent = 16,
|
||||
ListContentMetaInfo = 17,
|
||||
GetAttributes = 18,
|
||||
GetRequiredApplicationVersion = 19,
|
||||
GetContentIdByTypeAndIdOffset = 20,
|
||||
};
|
||||
protected:
|
||||
ams::kvdb::MemoryKeyValueStore<ContentMetaKey>* kvs;
|
|
@ -23,34 +23,34 @@ namespace ams::ncm {
|
|||
class IContentStorage : public sf::IServiceObject {
|
||||
protected:
|
||||
enum class CommandId {
|
||||
GeneratePlaceHolderId = 0,
|
||||
CreatePlaceHolder = 1,
|
||||
DeletePlaceHolder = 2,
|
||||
HasPlaceHolder = 3,
|
||||
WritePlaceHolder = 4,
|
||||
Register = 5,
|
||||
Delete = 6,
|
||||
Has = 7,
|
||||
GetPath = 8,
|
||||
GetPlaceHolderPath = 9,
|
||||
CleanupAllPlaceHolder = 10,
|
||||
ListPlaceHolder = 11,
|
||||
GetContentCount = 12,
|
||||
ListContentId = 13,
|
||||
GetSizeFromContentId = 14,
|
||||
DisableForcibly = 15,
|
||||
RevertToPlaceHolder = 16,
|
||||
SetPlaceHolderSize = 17,
|
||||
ReadContentIdFile = 18,
|
||||
GetRightsIdFromPlaceHolderId = 19,
|
||||
GetRightsIdFromContentId = 20,
|
||||
WriteContentForDebug = 21,
|
||||
GetFreeSpaceSize = 22,
|
||||
GetTotalSpaceSize = 23,
|
||||
FlushPlaceHolder = 24,
|
||||
GetSizeFromPlaceHolderId = 25,
|
||||
RepairInvalidFileAttribute = 26,
|
||||
GetRightsIdFromPlaceHolderIdWithCache = 27,
|
||||
GeneratePlaceHolderId = 0,
|
||||
CreatePlaceHolder = 1,
|
||||
DeletePlaceHolder = 2,
|
||||
HasPlaceHolder = 3,
|
||||
WritePlaceHolder = 4,
|
||||
Register = 5,
|
||||
Delete = 6,
|
||||
Has = 7,
|
||||
GetPath = 8,
|
||||
GetPlaceHolderPath = 9,
|
||||
CleanupAllPlaceHolder = 10,
|
||||
ListPlaceHolder = 11,
|
||||
GetContentCount = 12,
|
||||
ListContentId = 13,
|
||||
GetSizeFromContentId = 14,
|
||||
DisableForcibly = 15,
|
||||
RevertToPlaceHolder = 16,
|
||||
SetPlaceHolderSize = 17,
|
||||
ReadContentIdFile = 18,
|
||||
GetRightsIdFromPlaceHolderId = 19,
|
||||
GetRightsIdFromContentId = 20,
|
||||
WriteContentForDebug = 21,
|
||||
GetFreeSpaceSize = 22,
|
||||
GetTotalSpaceSize = 23,
|
||||
FlushPlaceHolder = 24,
|
||||
GetSizeFromPlaceHolderId = 25,
|
||||
RepairInvalidFileAttribute = 26,
|
||||
GetRightsIdFromPlaceHolderIdWithCache = 27,
|
||||
};
|
||||
protected:
|
||||
char root_path[FS_MAX_PATH-1];
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include "ncm_fs.hpp"
|
||||
#include "ncm_path_utils.hpp"
|
||||
#include "ncm_readonlycontentstorage.hpp"
|
||||
#include "ncm_read_only_content_storage.hpp"
|
||||
|
||||
namespace ams::ncm {
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
#include "ncm_icontentstorage.hpp"
|
||||
#include "ncm_i_content_storage.hpp"
|
||||
|
||||
namespace ams::ncm {
|
||||
|
Loading…
Add table
Reference in a new issue