From 6e6864fcbf8af1c1655b63dee44588a77ff10068 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 4 Aug 2017 20:45:25 +0200 Subject: [PATCH] Revert "DirectoryBlob: Use NonCopyable" This reverts commit a7a8e467b6f0efd9f6236221a346f221edefd059. --- Source/Core/DiscIO/DirectoryBlob.h | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Source/Core/DiscIO/DirectoryBlob.h b/Source/Core/DiscIO/DirectoryBlob.h index cc15db64f9..666694e508 100644 --- a/Source/Core/DiscIO/DirectoryBlob.h +++ b/Source/Core/DiscIO/DirectoryBlob.h @@ -15,7 +15,6 @@ #include "Common/CommonTypes.h" #include "Common/FileUtil.h" -#include "Common/NonCopyable.h" #include "DiscIO/Blob.h" namespace File @@ -59,13 +58,18 @@ private: ContentSource m_content_source; }; -// We do not allow copying, because it might mess up the pointers inside DiscContents -class DirectoryBlobPartition : private NonCopyable +class DirectoryBlobPartition { public: DirectoryBlobPartition() = default; DirectoryBlobPartition(const std::string& root_directory, std::optional is_wii); + // We do not allow copying, because it might mess up the pointers inside DiscContents + DirectoryBlobPartition(const DirectoryBlobPartition&) = delete; + DirectoryBlobPartition& operator=(const DirectoryBlobPartition&) = delete; + DirectoryBlobPartition(DirectoryBlobPartition&&) = default; + DirectoryBlobPartition& operator=(DirectoryBlobPartition&&) = default; + bool IsWii() const { return m_is_wii; } u64 GetDataSize() const { return m_data_size; } const std::string& GetRootDirectory() const { return m_root_directory; } @@ -103,12 +107,17 @@ private: u64 m_data_size; }; -// We do not allow copying, because it might mess up the pointers inside DiscContents -class DirectoryBlobReader : public BlobReader, private NonCopyable +class DirectoryBlobReader : public BlobReader { public: static std::unique_ptr Create(const std::string& dol_path); + // We do not allow copying, because it might mess up the pointers inside DiscContents + DirectoryBlobReader(const DirectoryBlobReader&) = delete; + DirectoryBlobReader& operator=(const DirectoryBlobReader&) = delete; + DirectoryBlobReader(DirectoryBlobReader&&) = default; + DirectoryBlobReader& operator=(DirectoryBlobReader&&) = default; + bool Read(u64 offset, u64 length, u8* buffer) override; bool SupportsReadWiiDecrypted() const override; bool ReadWiiDecrypted(u64 offset, u64 size, u8* buffer, u64 partition_offset) override;