ncm: update client code to better reflect latest sysupdate

This commit is contained in:
Michael Scire 2022-03-18 20:11:26 -07:00 committed by SciresM
parent ca142889c4
commit 320a946fc7
28 changed files with 1432 additions and 110 deletions

View file

@ -20,7 +20,7 @@ namespace ams::ncm {
namespace {
void MakeContentName(PathString *out, ContentId id) {
out->SetFormat("%s.nca", GetContentIdString(id).data);
out->AssignFormat("%s.nca", GetContentIdString(id).data);
}
void MakePlaceHolderName(PathString *out, PlaceHolderId id) {
@ -63,7 +63,7 @@ namespace ams::ncm {
MakeContentName(std::addressof(content_name), content_id);
/* Format the output path. */
out->SetFormat("%s/%s", root_path, content_name.Get());
out->AssignFormat("%s/%s", root_path, content_name.Get());
}
void MakeSha256HierarchicalContentFilePath_ForFat4KCluster(PathString *out, ContentId content_id, const char *root_path) {
@ -77,7 +77,7 @@ namespace ams::ncm {
MakeContentName(std::addressof(content_name), content_id);
/* Format the output path. */
out->SetFormat("%s/%08X/%08X/%s", root_path, hash_upper, hash_lower, content_name.Get());
out->AssignFormat("%s/%08X/%08X/%s", root_path, hash_upper, hash_lower, content_name.Get());
}
void MakeSha256HierarchicalContentFilePath_ForFat32KCluster(PathString *out, ContentId content_id, const char *root_path) {
@ -89,7 +89,7 @@ namespace ams::ncm {
MakeContentName(std::addressof(content_name), content_id);
/* Format the output path. */
out->SetFormat("%s/%08X/%s", root_path, hash, content_name.Get());
out->AssignFormat("%s/%08X/%s", root_path, hash, content_name.Get());
}
void MakeSha256HierarchicalContentFilePath_ForFat16KCluster(PathString *out, ContentId content_id, const char *root_path) {
@ -101,7 +101,7 @@ namespace ams::ncm {
MakeContentName(std::addressof(content_name), content_id);
/* Format the output path. */
out->SetFormat("%s/%08X/%s", root_path, hash_byte, content_name.Get());
out->AssignFormat("%s/%08X/%s", root_path, hash_byte, content_name.Get());
}
size_t GetHierarchicalContentDirectoryDepth(MakeContentPathFunction func) {
@ -123,7 +123,7 @@ namespace ams::ncm {
MakePlaceHolderName(std::addressof(placeholder_name), placeholder_id);
/* Format the output path. */
out->SetFormat("%s/%s", root_path, placeholder_name.Get());
out->AssignFormat("%s/%s", root_path, placeholder_name.Get());
}
void MakeSha256HierarchicalPlaceHolderFilePath_ForFat16KCluster(PathString *out, PlaceHolderId placeholder_id, const char *root_path) {
@ -135,7 +135,7 @@ namespace ams::ncm {
MakePlaceHolderName(std::addressof(placeholder_name), placeholder_id);
/* Format the output path. */
out->SetFormat("%s/%08X/%s", root_path, hash_byte, placeholder_name.Get());
out->AssignFormat("%s/%08X/%s", root_path, hash_byte, placeholder_name.Get());
}
size_t GetHierarchicalPlaceHolderDirectoryDepth(MakePlaceHolderPathFunction func) {