summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DriveBlob.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-03-15 00:57:56 +0100
committerPierre Bourdon <delroth@gmail.com>2014-03-15 00:57:56 +0100
commit8d679e76d299956a1521bc14502466be8d8b2df8 (patch)
tree97db9ad6a45a8e5d711d7763199579e400a65bc8 /Source/Core/DiscIO/DriveBlob.cpp
parent12c2e345a35a571aadc842e30c38b3b4d8f70dce (diff)
parenta82675b7d581421fa80d5d5c53253cf1d5c1a26d (diff)
Merge pull request #164 from lioncash/cstr-cull
Kill off some usages of c_str.
Diffstat (limited to 'Source/Core/DiscIO/DriveBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DriveBlob.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/DriveBlob.cpp b/Source/Core/DiscIO/DriveBlob.cpp
index 361a74abdd..eb72a143d3 100644
--- a/Source/Core/DiscIO/DriveBlob.cpp
+++ b/Source/Core/DiscIO/DriveBlob.cpp
@@ -4,6 +4,7 @@
#include <cstdio>
#include <cstring>
+#include <string>
#include "Common/Common.h"
#include "Common/FileUtil.h"
@@ -17,7 +18,7 @@
namespace DiscIO
{
-DriveReader::DriveReader(const char *drive)
+DriveReader::DriveReader(const std::string& drive)
{
#ifdef _WIN32
SectorReader::SetSectorSize(2048);
@@ -56,8 +57,10 @@ DriveReader::DriveReader(const char *drive)
#endif
}
else
- NOTICE_LOG(DISCIO, "Load from DVD backup failed or no disc in drive %s", drive);
-} // DriveReader::DriveReader
+ {
+ NOTICE_LOG(DISCIO, "Load from DVD backup failed or no disc in drive %s", drive.c_str());
+ }
+}
DriveReader::~DriveReader()
{
@@ -79,18 +82,20 @@ DriveReader::~DriveReader()
#endif
}
-DriveReader *DriveReader::Create(const char *drive)
+DriveReader* DriveReader::Create(const std::string& drive)
{
- DriveReader *reader = new DriveReader(drive);
+ DriveReader* reader = new DriveReader(drive);
+
if (!reader->IsOK())
{
delete reader;
return nullptr;
}
+
return reader;
}
-void DriveReader::GetBlock(u64 block_num, u8 *out_ptr)
+void DriveReader::GetBlock(u64 block_num, u8* out_ptr)
{
u8* const lpSector = new u8[m_blocksize];
#ifdef _WIN32
@@ -109,7 +114,7 @@ void DriveReader::GetBlock(u64 block_num, u8 *out_ptr)
delete[] lpSector;
}
-bool DriveReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *out_ptr)
+bool DriveReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8* out_ptr)
{
#ifdef _WIN32
u32 NotUsed;