diff options
| author | Lioncash <mathew1800@gmail.com> | 2016-10-14 20:12:16 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2016-10-14 20:27:22 -0400 |
| commit | d9eb7c4e803ecc277cb7456db7627a5b761ea7bf (patch) | |
| tree | 005154f2325c016b307511cf30e9500226dcd2d3 /Source/Core/DiscIO | |
| parent | 183f3c375971233213bbc4a222a76c8f3940ebe5 (diff) | |
NANDContentLoader: Add IOFile forward declaration
This would previously fail to compile when included in files that do not
include FileUtil.h due to lack of a type declaration.
This moves the constructor and destructor into the cpp file in order to
satisfy the requirements of unique_ptr construction and deletion. That is,
unique_ptr requires a concrete type at the point of construction and
destruction. If the constructor or destructor is left in the header, then
at the point of construction or destruction, IOFile will still be
considered an incomplete type, as unique_ptr's deleter will still only be
able to see the forward declaration, which it can't use.
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/NANDContentLoader.cpp | 6 | ||||
| -rw-r--r-- | Source/Core/DiscIO/NANDContentLoader.h | 10 |
2 files changed, 13 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/NANDContentLoader.cpp b/Source/Core/DiscIO/NANDContentLoader.cpp index 3f2c746bd6..4a67f09405 100644 --- a/Source/Core/DiscIO/NANDContentLoader.cpp +++ b/Source/Core/DiscIO/NANDContentLoader.cpp @@ -96,6 +96,12 @@ std::string CSharedContent::AddSharedContent(const u8* hash) return filename; } +CNANDContentDataFile::CNANDContentDataFile(const std::string& filename) : m_filename{filename} +{ +} + +CNANDContentDataFile::~CNANDContentDataFile() = default; + void CNANDContentDataFile::EnsureOpen() { if (!m_file) diff --git a/Source/Core/DiscIO/NANDContentLoader.h b/Source/Core/DiscIO/NANDContentLoader.h index 6c9df0d545..6643e2789c 100644 --- a/Source/Core/DiscIO/NANDContentLoader.h +++ b/Source/Core/DiscIO/NANDContentLoader.h @@ -13,13 +13,15 @@ #include "Common/CommonTypes.h" #include "Common/NandPaths.h" -namespace DiscIO +namespace File { -enum class Country; +class IOFile; } namespace DiscIO { +enum class Country; + bool AddTicket(u64 title_id, const std::vector<u8>& ticket); class CNANDContentData @@ -35,7 +37,9 @@ public: class CNANDContentDataFile final : public CNANDContentData { public: - explicit CNANDContentDataFile(const std::string& filename) : m_filename(filename) {} + explicit CNANDContentDataFile(const std::string& filename); + ~CNANDContentDataFile(); + void Open() override; std::vector<u8> Get() override; bool GetRange(u32 start, u32 size, u8* buffer) override; |
