diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp index 1397e24b9..b00fe8cb1 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta.hpp @@ -27,6 +27,7 @@ namespace ams::ncm { ContentMetaAttribute_None = (0 << 0), ContentMetaAttribute_IncludesExFatDriver = (1 << 0), ContentMetaAttribute_Rebootless = (1 << 1), + ContentMetaAttribute_Compacted = (1 << 2), }; struct ContentMetaInfo { @@ -101,7 +102,7 @@ namespace ams::ncm { u32 required_application_version; u8 content_accessibilities; u8 padding[3]; - u64 data_patch_id; /* TODO: DataPatchId? */ + DataPatchId data_patch_id; }; struct LegacyAddOnContentMetaExtendedHeader { diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_id.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_id.hpp index de8a367b7..35b2d3517 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_id.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_id.hpp @@ -26,6 +26,9 @@ namespace ams::ncm { return { this->value }; } + constexpr inline bool operator==(const ApplicationId &) const = default; + constexpr inline bool operator!=(const ApplicationId &) const = default; + static const ApplicationId Start; static const ApplicationId End; }; @@ -53,6 +56,9 @@ namespace ams::ncm { constexpr operator ProgramId() const { return { this->value }; } + + constexpr inline bool operator==(const PatchId &) const = default; + constexpr inline bool operator!=(const PatchId &) const = default; }; struct PatchGroupId { @@ -65,6 +71,9 @@ namespace ams::ncm { constexpr operator DataId() const { return { this->value }; } + + constexpr inline bool operator==(const AddOnContentId &) const = default; + constexpr inline bool operator!=(const AddOnContentId &) const = default; }; struct DeltaId { @@ -73,6 +82,20 @@ namespace ams::ncm { constexpr operator ProgramId() const { return { this->value }; } + + constexpr inline bool operator==(const DeltaId &) const = default; + constexpr inline bool operator!=(const DeltaId &) const = default; + }; + + struct DataPatchId { + u64 value; + + constexpr operator DataId() const { + return { this->value }; + } + + constexpr inline bool operator==(const DataPatchId &) const = default; + constexpr inline bool operator!=(const DataPatchId &) const = default; }; } diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_type.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_type.hpp index 1bc807e8f..1ae570336 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_type.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_content_meta_type.hpp @@ -29,6 +29,7 @@ namespace ams::ncm { Patch = 0x81, AddOnContent = 0x82, Delta = 0x83, + DataPatch = 0x84, }; const char *GetContentMetaTypeString(ContentMetaType type); diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_data_id.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_data_id.hpp index f59800209..bb9422e1c 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_data_id.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_data_id.hpp @@ -22,32 +22,10 @@ namespace ams::ncm { u64 value; static const DataId Invalid; + + constexpr inline auto operator<=>(const DataId &) const = default; }; - inline constexpr bool operator==(const DataId &lhs, const DataId &rhs) { - return lhs.value == rhs.value; - } - - inline constexpr bool operator!=(const DataId &lhs, const DataId &rhs) { - return lhs.value != rhs.value; - } - - inline constexpr bool operator<(const DataId &lhs, const DataId &rhs) { - return lhs.value < rhs.value; - } - - inline constexpr bool operator<=(const DataId &lhs, const DataId &rhs) { - return lhs.value <= rhs.value; - } - - inline constexpr bool operator>(const DataId &lhs, const DataId &rhs) { - return lhs.value > rhs.value; - } - - inline constexpr bool operator>=(const DataId &lhs, const DataId &rhs) { - return lhs.value >= rhs.value; - } - inline constexpr const DataId DataId::Invalid = {}; inline constexpr const DataId InvalidDataId = DataId::Invalid; diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_program_id.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_program_id.hpp index ec3d22997..83aa4a44d 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_program_id.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_program_id.hpp @@ -27,32 +27,10 @@ namespace ams::ncm { return { this->value }; } #endif + + constexpr inline auto operator<=>(const ProgramId &) const = default; }; - inline constexpr bool operator==(const ProgramId &lhs, const ProgramId &rhs) { - return lhs.value == rhs.value; - } - - inline constexpr bool operator!=(const ProgramId &lhs, const ProgramId &rhs) { - return lhs.value != rhs.value; - } - - inline constexpr bool operator<(const ProgramId &lhs, const ProgramId &rhs) { - return lhs.value < rhs.value; - } - - inline constexpr bool operator<=(const ProgramId &lhs, const ProgramId &rhs) { - return lhs.value <= rhs.value; - } - - inline constexpr bool operator>(const ProgramId &lhs, const ProgramId &rhs) { - return lhs.value > rhs.value; - } - - inline constexpr bool operator>=(const ProgramId &lhs, const ProgramId &rhs) { - return lhs.value >= rhs.value; - } - inline constexpr const ProgramId InvalidProgramId = {}; } diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_system_content_meta_id.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_system_content_meta_id.hpp index cadd5b9a5..9a470b38f 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_system_content_meta_id.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_system_content_meta_id.hpp @@ -228,6 +228,9 @@ namespace ams::ncm { return { this->value }; } + constexpr inline bool operator==(const SystemDataId &) const = default; + constexpr inline bool operator!=(const SystemDataId &) const = default; + static const SystemDataId Start; static const SystemDataId CertStore; @@ -340,6 +343,9 @@ namespace ams::ncm { constexpr operator DataId() const { return { this->value }; } + + constexpr inline bool operator==(const SystemUpdateId &) const = default; + constexpr inline bool operator!=(const SystemUpdateId &) const = default; }; struct SystemAppletId { @@ -349,6 +355,9 @@ namespace ams::ncm { return { this->value }; } + constexpr inline bool operator==(const SystemAppletId &) const = default; + constexpr inline bool operator!=(const SystemAppletId &) const = default; + static const SystemAppletId Start; static const SystemAppletId Qlaunch; @@ -433,6 +442,9 @@ namespace ams::ncm { return { this->value }; } + constexpr inline bool operator==(const SystemDebugAppletId &) const = default; + constexpr inline bool operator!=(const SystemDebugAppletId &) const = default; + static const SystemDebugAppletId Start; static const SystemDebugAppletId SnapShotDumper; @@ -465,6 +477,9 @@ namespace ams::ncm { return static_cast(*this); } + constexpr inline bool operator==(const LibraryAppletId &) const = default; + constexpr inline bool operator!=(const LibraryAppletId &) const = default; + static const LibraryAppletId Auth; static const LibraryAppletId Controller; static const LibraryAppletId Error; @@ -527,6 +542,9 @@ namespace ams::ncm { return static_cast(*this); } + constexpr inline bool operator==(const WebAppletId &) const = default; + constexpr inline bool operator!=(const WebAppletId &) const = default; + static const WebAppletId Web; static const WebAppletId Shop; static const WebAppletId OfflineWeb; @@ -558,6 +576,9 @@ namespace ams::ncm { constexpr operator ProgramId() const { return { this->value }; } + + constexpr inline bool operator==(const SystemApplicationId &) const = default; + constexpr inline bool operator!=(const SystemApplicationId &) const = default; }; } diff --git a/libraries/libstratosphere/source/ncm/ncm_content_meta_type.cpp b/libraries/libstratosphere/source/ncm/ncm_content_meta_type.cpp index 8d003c8e2..6ee07c35c 100644 --- a/libraries/libstratosphere/source/ncm/ncm_content_meta_type.cpp +++ b/libraries/libstratosphere/source/ncm/ncm_content_meta_type.cpp @@ -22,6 +22,7 @@ namespace ams::ncm { case ContentMetaType::Application: return "Application"; case ContentMetaType::Patch: return "Patch"; case ContentMetaType::AddOnContent: return "AddOnContent"; + case ContentMetaType::DataPatch: return "DataPatch"; default: return "(unknown)"; } }