summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/file/winfile.cpp
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-10-01 14:53:32 -0400
committer Nathan Woods <npwoods@mess.org>2016-10-01 14:53:32 -0400
commitc0ff37c30da931bd1ea203aba1e8dc8a05ea1bf1 (patch)
tree97265a831a19f4ef76e049886a5771033d25edcc /src/osd/modules/file/winfile.cpp
parent0e2299e424d7da177a57bb530ae740c79a3c92a0 (diff)
Adding new string conversion overloads
[a|w|t|utf8]_from_[a|w|t|utf8_]string(xyz.c_str()) seems to be common enough to justify overloads. Also, I'm explicitly assuming that it is legal to override the NUL pointer within a C++ basic_string (e.g. - s[s.size()] = '\0'). As far as I can tell, this seems to be legal - please don't shoot if I am wrong.
Diffstat (limited to 'src/osd/modules/file/winfile.cpp')
-rw-r--r--src/osd/modules/file/winfile.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp
index f275f605b79..e4e637e4084 100644
--- a/src/osd/modules/file/winfile.cpp
+++ b/src/osd/modules/file/winfile.cpp
@@ -173,7 +173,7 @@ osd_file::error osd_file::open(std::string const &orig_path, UINT32 openflags, p
return win_open_ptty(path, openflags, file, filesize);
// convert path to TCHAR
- auto t_path = tstring_from_utf8(path.c_str());
+ tstring t_path = tstring_from_utf8(path);
// convert the path into something Windows compatible (the actual interesting part appears
// to have been commented out???)
@@ -274,7 +274,7 @@ osd_file::error osd_file::openpty(ptr &file, std::string &name)
osd_file::error osd_file::remove(std::string const &filename)
{
- auto tempstr = tstring_from_utf8(filename.c_str());
+ tstring tempstr = tstring_from_utf8(filename);
error filerr = error::NONE;
if (!DeleteFile(tempstr.c_str()))
@@ -338,7 +338,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN
std::unique_ptr<osd::directory::entry> osd_stat(const std::string &path)
{
// convert the path to TCHARs
- auto t_path = tstring_from_utf8(path.c_str());
+ tstring t_path = tstring_from_utf8(path);
// is this path a root directory (e.g. - C:)?
WIN32_FIND_DATA find_data;
@@ -382,7 +382,7 @@ std::unique_ptr<osd::directory::entry> osd_stat(const std::string &path)
osd_file::error osd_get_full_path(std::string &dst, std::string const &path)
{
// convert the path to TCHARs
- auto t_path = tstring_from_utf8(path.c_str());
+ tstring t_path = tstring_from_utf8(path);
// cannonicalize the path
TCHAR buffer[MAX_PATH];
@@ -402,7 +402,7 @@ osd_file::error osd_get_full_path(std::string &dst, std::string const &path)
bool osd_is_absolute_path(std::string const &path)
{
- auto t_path = tstring_from_utf8(path.c_str());
+ tstring t_path = tstring_from_utf8(path);
return !PathIsRelative(t_path.c_str());
}