From 77c684c1140f6bf3fb7d4560d06d2efb1a2ee5e2 Mon Sep 17 00:00:00 2001 From: Zach Hilman Date: Fri, 6 Jul 2018 10:51:32 -0400 Subject: Virtual Filesystem (#597) * Add VfsFile and VfsDirectory classes * Finish abstract Vfs classes * Implement RealVfsFile (computer fs backend) * Finish RealVfsFile and RealVfsDirectory * Finished OffsetVfsFile * More changes * Fix import paths * Major refactor * Remove double const * Use experimental/filesystem or filesystem depending on compiler * Port partition_filesystem * More changes * More Overhaul * FSP_SRV fixes * Fixes and testing * Try to get filesystem to compile * Filesystem on linux * Remove std::filesystem and document/test * Compile fixes * Missing include * Bug fixes * Fixes * Rename v_file and v_dir * clang-format fix * Rename NGLOG_* to LOG_* * Most review changes * Fix TODO * Guess 'main' to be Directory by filename --- src/core/file_sys/program_metadata.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/file_sys/program_metadata.h') diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h index b80a08485..06a7315db 100644 --- a/src/core/file_sys/program_metadata.h +++ b/src/core/file_sys/program_metadata.h @@ -10,6 +10,7 @@ #include "common/bit_field.h" #include "common/common_types.h" #include "common/swap.h" +#include "partition_filesystem.h" namespace Loader { enum class ResultStatus; @@ -37,8 +38,7 @@ enum class ProgramFilePermission : u64 { */ class ProgramMetadata { public: - Loader::ResultStatus Load(const std::string& file_path); - Loader::ResultStatus Load(const std::vector file_data, size_t offset = 0); + Loader::ResultStatus Load(VirtualFile file); bool Is64BitProgram() const; ProgramAddressSpaceType GetAddressSpaceType() const; @@ -51,6 +51,7 @@ public: void Print() const; private: + // TODO(DarkLordZach): BitField is not trivially copyable. struct Header { std::array magic; std::array reserved; @@ -77,6 +78,7 @@ private: static_assert(sizeof(Header) == 0x80, "NPDM header structure size is wrong"); + // TODO(DarkLordZach): BitField is not trivially copyable. struct AcidHeader { std::array signature; std::array nca_modulus; -- cgit v1.2.3