Browse Source
Merge pull request #701 from lioncash/moving
content_archive: Minor changes
pull/15/merge
bunnei
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
10 additions and
2 deletions
-
src/core/file_sys/content_archive.cpp
-
src/core/file_sys/content_archive.h
|
|
|
@ -2,6 +2,9 @@ |
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
#include <utility>
|
|
|
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
#include "core/file_sys/content_archive.h"
|
|
|
|
#include "core/file_sys/vfs_offset.h"
|
|
|
|
@ -61,7 +64,7 @@ struct RomFSSuperblock { |
|
|
|
}; |
|
|
|
static_assert(sizeof(RomFSSuperblock) == 0xE8, "RomFSSuperblock has incorrect size."); |
|
|
|
|
|
|
|
NCA::NCA(VirtualFile file_) : file(file_) { |
|
|
|
NCA::NCA(VirtualFile file_) : file(std::move(file_)) { |
|
|
|
if (sizeof(NCAHeader) != file->ReadObject(&header)) |
|
|
|
LOG_CRITICAL(Loader, "File reader errored out during header read."); |
|
|
|
|
|
|
|
|
|
|
|
@ -4,6 +4,11 @@ |
|
|
|
|
|
|
|
#pragma once |
|
|
|
|
|
|
|
#include <array> |
|
|
|
#include <memory> |
|
|
|
#include <string> |
|
|
|
#include <vector> |
|
|
|
|
|
|
|
#include "common/common_funcs.h" |
|
|
|
#include "common/common_types.h" |
|
|
|
#include "common/swap.h" |
|
|
|
@ -48,7 +53,7 @@ struct NCAHeader { |
|
|
|
}; |
|
|
|
static_assert(sizeof(NCAHeader) == 0x400, "NCAHeader has incorrect size."); |
|
|
|
|
|
|
|
inline bool IsDirectoryExeFS(std::shared_ptr<FileSys::VfsDirectory> pfs) { |
|
|
|
inline bool IsDirectoryExeFS(const std::shared_ptr<VfsDirectory>& pfs) { |
|
|
|
// According to switchbrew, an exefs must only contain these two files: |
|
|
|
return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr; |
|
|
|
} |
|
|
|
|