ReXGlue SDK
Loading...
Searching...
No Matches
rex::xam::IContentManager Class Referenceabstract
Inheritance diagram for rex::xam::IContentManager:
[legend]

Public Member Functions

virtual std::vector< kernel::XCONTENT_AGGREGATE_DATA > ListContent (u32 device_id, u64 xuid, rex::kernel::XContentType content_type, u32 title_id=0xFFFFFFFF)=0
virtual bool HasContent (u64 xuid, const kernel::XCONTENT_AGGREGATE_DATA &data)=0
virtual Result< void > CreateContent (std::string_view root_name, u64 xuid, const kernel::XCONTENT_AGGREGATE_DATA &data)=0
virtual Result< u32 > OpenContent (std::string_view root_name, u64 xuid, const kernel::XCONTENT_AGGREGATE_DATA &data)=0
virtual Result< void > CloseContent (std::string_view root_name)=0
virtual Result< std::vector< u8 > > GetContentThumbnail (u64 xuid, const kernel::XCONTENT_AGGREGATE_DATA &data)=0
virtual Result< void > SetContentThumbnail (u64 xuid, const kernel::XCONTENT_AGGREGATE_DATA &data, std::vector< u8 > buffer)=0
virtual Result< void > DeleteContent (u64 xuid, const kernel::XCONTENT_AGGREGATE_DATA &data)=0
virtual Result< void > WriteContentHeaderFile (u64 xuid, kernel::XCONTENT_AGGREGATE_DATA data, u32 license_mask=0)=0
virtual Result< kernel::XCONTENT_AGGREGATE_DATA > ReadContentHeaderFile (std::string_view file_name, u64 xuid, u32 title_id, rex::kernel::XContentType content_type) const =0
virtual std::filesystem::path ResolveGameUserContentPath ()=0
virtual bool IsContentOpen (const kernel::XCONTENT_AGGREGATE_DATA &data) const =0
virtual void CloseOpenedFilesFromContent (std::string_view root_name)=0
virtual Result< PackageInfo > InspectPackage (const std::filesystem::path &package_path) const =0
virtual Result< kernel::XCONTENT_AGGREGATE_DATA > InstallContent (const std::filesystem::path &package_path, const InstallOptions &options={})=0
virtual Result< void > SetContentEnabled (const kernel::XCONTENT_AGGREGATE_DATA &data, bool enabled, std::optional< u64 > xuid=std::nullopt)=0
virtual std::vector< InstalledPackage > ListInstalledPackages (u32 title_id=kernel::kRunningTitleID) const =0
virtual rex::ScopeGuard OnContentChanged (rex::MoveOnlyFunction< void()> callback)=0
virtual Result< u32 > GetContentDeviceID (std::string_view root_name) const =0

Additional Inherited Members

Protected Member Functions inherited from rex::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete

Member Function Documentation

◆ CloseContent()

virtual Result< void > rex::xam::IContentManager::CloseContent ( std::string_view root_name)
nodiscardpure virtual

Unmounts the package under a root name and closes its open files.

Returns
Ok, or X_ERROR_FILE_NOT_FOUND.

◆ CloseOpenedFilesFromContent()

virtual void rex::xam::IContentManager::CloseOpenedFilesFromContent ( std::string_view root_name)
pure virtual

Closes every open file under a root name.

◆ CreateContent()

virtual Result< void > rex::xam::IContentManager::CreateContent ( std::string_view root_name,
u64 xuid,
const kernel::XCONTENT_AGGREGATE_DATA & data )
nodiscardpure virtual

Creates a package and mounts it under a root name.

Returns
Ok, or X_ERROR_ALREADY_EXISTS or X_ERROR_ACCESS_DENIED.

◆ DeleteContent()

virtual Result< void > rex::xam::IContentManager::DeleteContent ( u64 xuid,
const kernel::XCONTENT_AGGREGATE_DATA & data )
nodiscardpure virtual

Deletes a package that is not open.

Returns
Ok, or X_ERROR_ACCESS_DENIED or X_ERROR_FILE_NOT_FOUND.

◆ GetContentDeviceID()

virtual Result< u32 > rex::xam::IContentManager::GetContentDeviceID ( std::string_view root_name) const
nodiscardpure virtual

Returns the device a package is stored on, or X_ERROR_FILE_NOT_FOUND when no package is open under the name.

Parameters
root_nameThe root name of an open package.

◆ GetContentThumbnail()

virtual Result< std::vector< u8 > > rex::xam::IContentManager::GetContentThumbnail ( u64 xuid,
const kernel::XCONTENT_AGGREGATE_DATA & data )
nodiscardpure virtual

Reads the thumbnail of a package.

Returns
The thumbnail bytes, or X_ERROR_FILE_NOT_FOUND.

◆ InspectPackage()

virtual Result< PackageInfo > rex::xam::IContentManager::InspectPackage ( const std::filesystem::path & package_path) const
nodiscardpure virtual

Reads the header of a package. Nothing is extracted or written.

Parameters
package_pathThe package file.
Returns
The header facts, kNotFound when the file does not open, or kCorrupt when it is not a content package, a disc image included.

◆ InstallContent()

virtual Result< kernel::XCONTENT_AGGREGATE_DATA > rex::xam::IContentManager::InstallContent ( const std::filesystem::path & package_path,
const InstallOptions & options = {} )
nodiscardpure virtual

Installs a package into the content tree and writes its header file and package manifest. The content type and title ID come from the package metadata. An in place install leaves the original file where it is and mounts it each time the title opens the package.

Parameters
package_pathThe package file.
optionsWhere the package may come from and whether it is extracted.
Returns
The content data written to the header file, kExists when the package is open, kCorrupt for a bad image, kUnsupported for an in place SVOD package, a validation error for a package of another title, or the Container::Open or Extract error.

◆ ListContent()

virtual std::vector< kernel::XCONTENT_AGGREGATE_DATA > rex::xam::IContentManager::ListContent ( u32 device_id,
u64 xuid,
rex::kernel::XContentType content_type,
u32 title_id = 0xFFFFFFFF )
nodiscardpure virtual

Lists the content packages of a type.

Parameters
xuidThe owner, 0 for shared content.
title_idThe title, 0xFFFFFFFF for the running title.
Returns
The content data of every package found.

◆ ListInstalledPackages()

virtual std::vector< InstalledPackage > rex::xam::IContentManager::ListInstalledPackages ( u32 title_id = kernel::kRunningTitleID) const
nodiscardpure virtual

Lists the packages installed through InstallContent, disabled ones included.

Parameters
title_idThe title, 0xFFFFFFFF for the running title.

◆ OnContentChanged()

virtual rex::ScopeGuard rex::xam::IContentManager::OnContentChanged ( rex::MoveOnlyFunction< void()> callback)
nodiscardpure virtual

Registers a function that runs after an install, a delete or an enable change, on the thread that made the change.

Parameters
callbackThe function. It may call the content manager.
Returns
The guard that removes the function. It must not outlive the content manager.

◆ OpenContent()

virtual Result< u32 > rex::xam::IContentManager::OpenContent ( std::string_view root_name,
u64 xuid,
const kernel::XCONTENT_AGGREGATE_DATA & data )
nodiscardpure virtual

Opens an existing package and mounts it under a root name.

Returns
The license mask, or X_ERROR_ALREADY_EXISTS or X_ERROR_FILE_NOT_FOUND.

◆ ReadContentHeaderFile()

virtual Result< kernel::XCONTENT_AGGREGATE_DATA > rex::xam::IContentManager::ReadContentHeaderFile ( std::string_view file_name,
u64 xuid,
u32 title_id,
rex::kernel::XContentType content_type ) const
nodiscardpure virtual
Returns
The content data, or X_ERROR_FILE_NOT_FOUND.

◆ ResolveGameUserContentPath()

virtual std::filesystem::path rex::xam::IContentManager::ResolveGameUserContentPath ( )
nodiscardpure virtual

Returns the folder of the running title's user content for the signed in profile.

◆ SetContentEnabled()

virtual Result< void > rex::xam::IContentManager::SetContentEnabled ( const kernel::XCONTENT_AGGREGATE_DATA & data,
bool enabled,
std::optional< u64 > xuid = std::nullopt )
nodiscardpure virtual

Enables or disables an installed package. A disabled package is absent from ListContent, HasContent and OpenContent. The change applies when the title next lists or opens content. A profile flag wins over the all profiles flag, and an installed package with neither is enabled.

Parameters
dataThe content data, title 0xFFFFFFFF for the running title.
enabledThe new flag.
xuidThe profile the flag is for, empty for all profiles.
Returns
Ok, or X_ERROR_FILE_NOT_FOUND when the package is not installed.

◆ SetContentThumbnail()

virtual Result< void > rex::xam::IContentManager::SetContentThumbnail ( u64 xuid,
const kernel::XCONTENT_AGGREGATE_DATA & data,
std::vector< u8 > buffer )
nodiscardpure virtual

Writes the thumbnail of a package.

Parameters
bufferThe thumbnail bytes.
Returns
Ok, or X_ERROR_FILE_NOT_FOUND.

◆ WriteContentHeaderFile()

virtual Result< void > rex::xam::IContentManager::WriteContentHeaderFile ( u64 xuid,
kernel::XCONTENT_AGGREGATE_DATA data,
u32 license_mask = 0 )
nodiscardpure virtual

Writes the header file of a package.

Parameters
dataThe content data, title 0xFFFFFFFF for the running title.
Returns
Ok, or X_ERROR_ACCESS_DENIED or X_ERROR_FILE_NOT_FOUND.

The documentation for this class was generated from the following file: