diff options
author | 2016-06-24 06:54:56 -0400 | |
---|---|---|
committer | 2016-06-24 07:13:18 -0400 | |
commit | cd8b414e6bc14b375dcf2a4eb17eb0353926474f (patch) | |
tree | 56d43f4241b29097822583e00fa938d63fe1f5ac /src/osd/modules/file/winfile.cpp | |
parent | c96215487573733e7250e76524b95de43e8bef8e (diff) |
C++-ified osd_directory (now osd::directory), and added last_modified to osd::directory::entry
Diffstat (limited to 'src/osd/modules/file/winfile.cpp')
-rw-r--r-- | src/osd/modules/file/winfile.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/osd/modules/file/winfile.cpp b/src/osd/modules/file/winfile.cpp index 9b6ecdc0535..dc22d37096c 100644 --- a/src/osd/modules/file/winfile.cpp +++ b/src/osd/modules/file/winfile.cpp @@ -354,7 +354,7 @@ int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UIN // osd_stat //============================================================ -osd_directory_entry *osd_stat(const std::string &path) +osd::directory::entry *osd_stat(const std::string &path) { // convert the path to TCHARs std::unique_ptr<TCHAR, void (*)(void *)> const t_path(tstring_from_utf8(path.c_str()), &osd_free); @@ -379,15 +379,16 @@ osd_directory_entry *osd_stat(const std::string &path) FindClose(find); } - // create an osd_directory_entry; be sure to make sure that the caller can - // free all resources by just freeing the resulting osd_directory_entry - osd_directory_entry *const result = (osd_directory_entry *)osd_malloc_array(sizeof(*result) + path.length() + 1); + // create an osd::directory::entry; be sure to make sure that the caller can + // free all resources by just freeing the resulting osd::directory::entry + osd::directory::entry *const result = (osd::directory::entry *)osd_malloc_array(sizeof(*result) + path.length() + 1); if (!result) return nullptr; strcpy(((char *) result) + sizeof(*result), path.c_str()); result->name = ((char *) result) + sizeof(*result); result->type = win_attributes_to_entry_type(find_data.dwFileAttributes); result->size = find_data.nFileSizeLow | ((UINT64) find_data.nFileSizeHigh << 32); + result->last_modified = win_time_point_from_filetime(&find_data.ftLastWriteTime); return result; } |