summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/FileBlob.cpp
diff options
context:
space:
mode:
authorMarkus Wick <degasus@users.noreply.github.com>2015-12-07 19:12:15 +0100
committerMarkus Wick <degasus@users.noreply.github.com>2015-12-07 19:12:15 +0100
commit9719804cd2f61adf2ab7f0dfc15efda36c5df529 (patch)
tree7c368eff997e8db51cc6af795bf30ccf34f8ae7e /Source/Core/DiscIO/FileBlob.cpp
parent31a40447d8e9d8e4d29aa58d02df20e957d8d24b (diff)
parentedbbf493f807ed94b9b32cfb7463f9b7f8f27852 (diff)
Merge pull request #3320 from lioncash/factory
DiscIO: Make factory methods return unique_ptrs
Diffstat (limited to 'Source/Core/DiscIO/FileBlob.cpp')
-rw-r--r--Source/Core/DiscIO/FileBlob.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/FileBlob.cpp b/Source/Core/DiscIO/FileBlob.cpp
index 3e702d650c..79b66b37bc 100644
--- a/Source/Core/DiscIO/FileBlob.cpp
+++ b/Source/Core/DiscIO/FileBlob.cpp
@@ -2,6 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
+#include <memory>
#include <string>
#include "DiscIO/FileBlob.h"
@@ -14,13 +15,13 @@ PlainFileReader::PlainFileReader(std::FILE* file)
m_size = m_file.GetSize();
}
-PlainFileReader* PlainFileReader::Create(const std::string& filename)
+std::unique_ptr<PlainFileReader> PlainFileReader::Create(const std::string& filename)
{
File::IOFile f(filename, "rb");
if (f)
- return new PlainFileReader(f.ReleaseHandle());
- else
- return nullptr;
+ return std::unique_ptr<PlainFileReader>(new PlainFileReader(f.ReleaseHandle()));
+
+ return nullptr;
}
bool PlainFileReader::Read(u64 offset, u64 nbytes, u8* out_ptr)