NCM client implementation (#858)
* ncm: Implement InstallTaskDataBase and FileInstallTaskData * ncm: minor bugfixes * ncm: Implemented MemoryInstallTaskData * ncm: more std * ncm: begin implementing install task base * ncm: move protected funcs * ncm: fix recursive include * ncm: more install task progress * ncm install task: implement IncrementProgress and update UpdateThroughputMeasurement * ncm: more work * ncm client: more progress * ncm client: more progress * ncm client: finish implementing GetContentMetaInfoList * ncm client: more progress * ncm client: finished InstallTaskBase * ncm client: implement PackageInstallTaskBase * ncm client: fixes * ncm: improve accuracy * ncm client: implement PackageInstallTask * ncm client: implement PackageSystemUpdateTask * ncm client: minor name tweaks * ncm client: implement SubmissionPackageInstallTask * ncm client: add missing this to SubmissionPackageInstallTask * ncm client: add missing nullptr check to SubmissionPackageInstallTask destructor * ncm client: SubmissionPackageInstallTask fixes * ncm: fix forward declarations * ncm client: added simplified funcs * ncm: cleanup client code * ncm: fix bug introduced by cleanup * ncm: fix typo * ncm: implement correct ReadVariationContentMetaInfoList behavior * ncm: correct InstallContentMetaWriter ctor * ncm: correct conversion of content meta header types Co-authored-by: Michael Scire <SciresM@gmail.com>
This commit is contained in:
@@ -48,7 +48,6 @@ namespace ams::ncm {
|
||||
|
||||
}
|
||||
|
||||
|
||||
ContentIdString GetContentIdString(ContentId id) {
|
||||
ContentIdString str;
|
||||
GetStringFromContentId(str.data, sizeof(str), id);
|
||||
@@ -60,6 +59,25 @@ namespace ams::ncm {
|
||||
GetStringFromBytes(dst, std::addressof(id), sizeof(id));
|
||||
}
|
||||
|
||||
void GetStringFromRightsId(char *dst, size_t dst_size, fs::RightsId id) {
|
||||
AMS_ABORT_UNLESS(dst_size > RightsIdStringLength);
|
||||
GetStringFromBytes(dst, std::addressof(id), sizeof(id));
|
||||
}
|
||||
|
||||
void GetTicketFileStringFromRightsId(char *dst, size_t dst_size, fs::RightsId id) {
|
||||
AMS_ABORT_UNLESS(dst_size > TicketFileStringLength);
|
||||
ContentIdString str;
|
||||
GetStringFromRightsId(str.data, sizeof(str), id);
|
||||
std::snprintf(dst, dst_size, "%s.tik", str.data);
|
||||
}
|
||||
|
||||
void GetCertificateFileStringFromRightsId(char *dst, size_t dst_size, fs::RightsId id) {
|
||||
AMS_ABORT_UNLESS(dst_size > CertFileStringLength);
|
||||
ContentIdString str;
|
||||
GetStringFromRightsId(str.data, sizeof(str), id);
|
||||
std::snprintf(dst, dst_size, "%s.cert", str.data);
|
||||
}
|
||||
|
||||
std::optional<ContentId> GetContentIdFromString(const char *str, size_t len) {
|
||||
if (len < ContentIdStringLength) {
|
||||
return std::nullopt;
|
||||
|
||||
Reference in New Issue
Block a user