diff --git a/src/core/file_sys/title_metadata.cpp b/src/core/file_sys/title_metadata.cpp index 1ef8840a0a..fa99da1bee 100644 --- a/src/core/file_sys/title_metadata.cpp +++ b/src/core/file_sys/title_metadata.cpp @@ -153,6 +153,18 @@ u32 TitleMetadata::GetDLPContentID() const { return tmd_chunks[TMDContentIndex::DLP].id; } +u32 TitleMetadata::GetContentIDByIndex(u16 index) const { + return tmd_chunks[index].id; +} + +u16 TitleMetadata::GetContentTypeByIndex(u16 index) const { + return tmd_chunks[index].type; +} + +u64 TitleMetadata::GetContentSizeByIndex(u16 index) const { + return tmd_chunks[index].size; +} + void TitleMetadata::SetTitleID(u64 title_id) { tmd_body.title_id = title_id; } diff --git a/src/core/file_sys/title_metadata.h b/src/core/file_sys/title_metadata.h index 1fc157bf3f..a526412510 100644 --- a/src/core/file_sys/title_metadata.h +++ b/src/core/file_sys/title_metadata.h @@ -35,6 +35,8 @@ enum TMDContentTypeFlag : u16 { Shared = 1 << 15 }; +enum TMDContentIndex { Main = 0, Manual = 1, DLP = 2 }; + /** * Helper which implements an interface to read and write Title Metadata (TMD) files. * If a file path is provided and the file exists, it can be parsed and used, otherwise @@ -102,6 +104,9 @@ public: u32 GetBootContentID() const; u32 GetManualContentID() const; u32 GetDLPContentID() const; + u32 GetContentIDByIndex(u16 index) const; + u16 GetContentTypeByIndex(u16 index) const; + u64 GetContentSizeByIndex(u16 index) const; void SetTitleID(u64 title_id); void SetTitleType(u32 type); @@ -112,8 +117,6 @@ public: void Print() const; private: - enum TMDContentIndex { Main = 0, Manual = 1, DLP = 2 }; - Body tmd_body; u32_be signature_type; std::vector tmd_signature;