Skip to content

Commit

Permalink
win9x dir file
Browse files Browse the repository at this point in the history
  • Loading branch information
MacroModel committed Nov 10, 2024
1 parent eba0a1c commit fc03252
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 12 deletions.
8 changes: 7 additions & 1 deletion include/fast_io_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ Special file type region. They are usually not used for I/O but for other purpos
However, they are still capable of doing I/O.
*/

using dir_file = directory_file_wrapper<basic_native_file<char>>;
using dir_file = directory_file_wrapper<
#if (defined(_WIN32) || defined(__CYGWIN__) && defined(_WIN32_WINDOWS))
win9x_dir
#else
basic_native_file<char>
#endif
>;

/*
template region
Expand Down
3 changes: 1 addition & 2 deletions include/fast_io_hosted.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ freestanding ones.
#endif

#if !defined(__AVR__)
#if defined(__MSDOS__)
#include "fast_io_dsal/string_view.h"
#include "fast_io_dsal/string.h"
#endif
#include "fast_io_hosted/platforms/native.h"
#include "fast_io_hosted/file_loaders/impl.h"
#include "fast_io_hosted/wrapper.h"
Expand Down
1 change: 0 additions & 1 deletion include/fast_io_hosted/filesystem/native.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#if (defined(_WIN32) || defined(__CYGWIN__))
#if defined(_WIN32_WINDOWS)
#include "../../fast_io_dsal/string.h"
#include "win9x.h"
#include "win9x_at.h"
#else
Expand Down
1 change: 1 addition & 0 deletions include/fast_io_hosted/filesystem/win9x.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct win9x_DIR
::fast_io::string path{};
};


namespace win32::details
{
inline ::fast_io::string get_file_full_path_from_path_handle(void *fhandle)
Expand Down
6 changes: 6 additions & 0 deletions include/fast_io_hosted/platforms/native_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ inline constexpr ::std::uint_least32_t win32_stderr_number(static_cast<::std::ui

#include "nt.h"
// #include"win32_iocp_overlapped.h"

#include "win32.h"
#include "win32_network/win32.h"
#endif
Expand All @@ -34,8 +35,13 @@ namespace fast_io
{

#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WINE__) && !defined(__BIONIC__)
#if defined(_WIN32_WINDOWS)
using native_at_entry = win9x_at_entry;
using native_fs_dirent = win9x_fs_dirent;
#else
using native_at_entry = nt_at_entry;
using native_fs_dirent = nt_fs_dirent;
#endif

#if defined(_WIN32_WINDOWS)
template <::std::integral ch_type>
Expand Down
13 changes: 9 additions & 4 deletions include/fast_io_hosted/platforms/posix.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@
#include <sys/stat.h>
#endif

#if defined(__MSDOS__)
#include "../../fast_io_dsal/string_view.h"
#endif

#if (!defined(_WIN32) || defined(__WINE__) || defined(__BIONIC__)) || defined(__CYGWIN__)

#if __has_include(<features.h>)
Expand Down Expand Up @@ -1143,6 +1139,10 @@ class basic_posix_family_file : public basic_posix_family_io_observer<family, ch
: basic_posix_family_file(basic_win32_file<char_type>(fsdirent, om, pm), om)
{
}
basic_posix_family_file(win9x_fs_dirent fsdirent, open_mode om, perms pm = static_cast<perms>(436))
: basic_posix_family_file(basic_win32_file<char_type>(fsdirent, om, pm), om)
{
}
template <::fast_io::constructible_to_os_c_str T>
basic_posix_family_file(T const &file, open_mode om, perms pm = static_cast<perms>(436))
: basic_posix_family_file(basic_win32_file<char_type>(file, om, pm), om)
Expand All @@ -1153,6 +1153,11 @@ class basic_posix_family_file : public basic_posix_family_io_observer<family, ch
: basic_posix_family_file(basic_win32_file<char_type>(nate, file, om, pm), om)
{
}
template <::fast_io::constructible_to_os_c_str T>
basic_posix_family_file(win9x_at_entry nate, T const &file, open_mode om, perms pm = static_cast<perms>(436))
: basic_posix_family_file(basic_win32_file<char_type>(nate, file, om, pm), om)
{
}
template <nt_family fam>
explicit constexpr basic_posix_family_file(io_construct_t, basic_nt_family_io_observer<fam, char_type> hd,
open_mode m) noexcept
Expand Down
Loading

0 comments on commit fc03252

Please sign in to comment.