summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/file
diff options
context:
space:
mode:
author Nathan Woods <npwoods@mess.org>2016-10-03 23:20:25 -0400
committer Nathan Woods <npwoods@mess.org>2016-10-03 23:20:25 -0400
commit85ba2fde280fdf9782b2e0ebc358113b75a7bce1 (patch)
tree6a054f26e338b4cc5b4e48c9d9dc8820820c38da /src/osd/modules/file
parent8e67c061b50b2098e713ded110ad360d379678d9 (diff)
Bulk renaming of Windows string conversion functions
utf8_from_[a|w|t]string ==> osd::text::from_[a|w|t]string [a|w|t]string_from_utf8 ==> osd::text::to_[a|w|t]string
Diffstat (limited to 'src/osd/modules/file')
-rw-r--r--src/osd/modules/file/windir.cpp4
-rw-r--r--src/osd/modules/file/winfile.cpp14
-rw-r--r--src/osd/modules/file/winptty.cpp2
3 files changed, 10 insertions, 10 deletions
diff --git a/src/osd/modules/file/windir.cpp b/src/osd/modules/file/windir.cpp
index f50907ff117..a950c12dbe3 100644
--- a/src/osd/modules/file/windir.cpp
+++ b/src/osd/modules/file/windir.cpp
@@ -91,7 +91,7 @@ const directory::entry *win_directory::read()
m_is_first = false;
// extract the data
- utf8_from_tstring(m_name, m_data.cFileName);
+ osd::text::from_tstring(m_name, m_data.cFileName);
m_entry.name = m_name.c_str();
m_entry.type = win_attributes_to_entry_type(m_data.dwFileAttributes);
m_entry.size = m_data.nFileSizeLow | (std::uint64_t(m_data.nFileSizeHigh) << 32);
@@ -112,7 +112,7 @@ bool win_directory::open_impl(std::string const &dirname)
std::string dirfilter = string_format("%s\\*.*", dirname);
// convert the path to TCHARs
- tstring t_dirfilter = tstring_from_utf8(dirfilter);
+ osd::text::tstring t_dirfilter = osd::text::to_tstring(dirfilter);
// attempt to find the first file
m_find = FindFirstFileEx(t_dirfilter.c_str(), FindExInfoStandard, &m_data, FindExSearchNameMatch, nullptr, 0);
diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp
index e4e637e4084..656ce36eadc 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
- tstring t_path = tstring_from_utf8(path);
+ osd::text::tstring t_path = osd::text::to_tstring(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)
{
- tstring tempstr = tstring_from_utf8(filename);
+ osd::text::tstring tempstr = osd::text::to_tstring(filename);
error filerr = error::NONE;
if (!DeleteFile(tempstr.c_str()))
@@ -301,7 +301,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN
return FALSE;
// do a create file on the drive
- auto t_filename = tstring_from_utf8(filename);
+ auto t_filename = osd::text::to_tstring(filename);
file = CreateFile(t_filename.c_str(), GENERIC_READ, FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, nullptr);
if (file == INVALID_HANDLE_VALUE)
return FALSE;
@@ -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
- tstring t_path = tstring_from_utf8(path);
+ osd::text::tstring t_path = osd::text::to_tstring(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
- tstring t_path = tstring_from_utf8(path);
+ osd::text::tstring t_path = osd::text::to_tstring(path);
// cannonicalize the path
TCHAR buffer[MAX_PATH];
@@ -390,7 +390,7 @@ osd_file::error osd_get_full_path(std::string &dst, std::string const &path)
return win_error_to_file_error(GetLastError());
// convert the result back to UTF-8
- utf8_from_tstring(dst, buffer);
+ osd::text::from_tstring(dst, buffer);
return osd_file::error::NONE;
}
@@ -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)
{
- tstring t_path = tstring_from_utf8(path);
+ osd::text::tstring t_path = osd::text::to_tstring(path);
return !PathIsRelative(t_path.c_str());
}
diff --git a/src/osd/modules/file/winptty.cpp b/src/osd/modules/file/winptty.cpp
index b414c60c1f3..b3eef069d22 100644
--- a/src/osd/modules/file/winptty.cpp
+++ b/src/osd/modules/file/winptty.cpp
@@ -87,7 +87,7 @@ bool win_check_ptty_path(std::string const &path)
osd_file::error win_open_ptty(std::string const &path, std::uint32_t openflags, osd_file::ptr &file, std::uint64_t &filesize)
{
- tstring t_name = tstring_from_utf8(path);
+ osd::text::tstring t_name = osd::text::to_tstring(path);
HANDLE pipe = CreateNamedPipe(t_name.c_str(), PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_NOWAIT, 1, 32, 32, 0, nullptr);