From 3895f7e4562a02ee07cac6908787802bddf2c092 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 22 Sep 2019 21:44:36 -0400 Subject: pfs: Provide accessors for file sizes and offsets --- src/core/file_sys/partition_filesystem.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/core/file_sys/partition_filesystem.cpp') diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp index a5259a593..932409d79 100644 --- a/src/core/file_sys/partition_filesystem.cpp +++ b/src/core/file_sys/partition_filesystem.cpp @@ -65,6 +65,9 @@ PartitionFilesystem::PartitionFilesystem(std::shared_ptr file) { std::string name( reinterpret_cast(&file_data[strtab_offset + entry.strtab_offset])); + offsets[name] = content_offset + entry.offset; + sizes[name] = entry.size; + pfs_files.emplace_back(std::make_shared( file, entry.size, content_offset + entry.offset, std::move(name))); } @@ -78,6 +81,14 @@ Loader::ResultStatus PartitionFilesystem::GetStatus() const { return status; } +std::map PartitionFilesystem::GetFileOffsets() const { + return offsets; +} + +std::map PartitionFilesystem::GetFileSizes() const { + return sizes; +} + std::vector> PartitionFilesystem::GetFiles() const { return pfs_files; } -- cgit v1.2.3 From e0b9ee9b941f3fb47a5b219d27c37081f379d05a Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Sun, 13 Oct 2019 14:18:09 -0400 Subject: card_image: Implement system update commands in XCI --- src/core/file_sys/partition_filesystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys/partition_filesystem.cpp') diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp index 932409d79..846986736 100644 --- a/src/core/file_sys/partition_filesystem.cpp +++ b/src/core/file_sys/partition_filesystem.cpp @@ -65,8 +65,8 @@ PartitionFilesystem::PartitionFilesystem(std::shared_ptr file) { std::string name( reinterpret_cast(&file_data[strtab_offset + entry.strtab_offset])); - offsets[name] = content_offset + entry.offset; - sizes[name] = entry.size; + offsets.insert_or_assign(name, content_offset + entry.offset); + sizes.insert_or_assign(name, entry.size); pfs_files.emplace_back(std::make_shared( file, entry.size, content_offset + entry.offset, std::move(name))); -- cgit v1.2.3