OSDN Git Service

[Refactor] #3281 fd_open() の引数をstring_view からpath に差し替えた
[hengbandforosx/hengbandosx.git] / src / util / angband-files.h
index 583df76..fb00f3e 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "system/angband.h"
 #include <filesystem>
+#include <string_view>
 
 /* Force definitions -- see fd_seek() */
 #ifndef SEEK_SET
@@ -40,21 +41,19 @@ enum class FileOpenMode {
     APPEND,
 };
 
-errr path_parse(char *buf, int max, concptr file);
-errr path_build(char *buf, int max, concptr path, concptr file);
+std::filesystem::path path_parse(const std::filesystem::path &path);
+std::filesystem::path path_build(const std::filesystem::path &path, std::string_view file);
 FILE *angband_fopen(const std::filesystem::path &path, const FileOpenMode mode, const bool is_binary = false);
 FILE *angband_fopen_temp(char *buf, int max);
 errr angband_fgets(FILE *fff, char *buf, ulong n);
 errr angband_fputs(FILE *fff, concptr buf, ulong n);
 errr angband_fclose(FILE *fff);
-errr fd_kill(concptr file);
-errr fd_move(concptr file, concptr what);
-errr fd_copy(concptr file, concptr what);
-int fd_make(concptr file, BIT_FLAGS mode);
-int fd_open(concptr file, int flags);
+void fd_kill(const std::filesystem::path &path);
+void fd_move(std::string_view from, std::string_view to);
+int fd_make(const std::filesystem::path &path, bool can_write_group = false);
+int fd_open(const std::filesystem::path &path, int mode);
 errr fd_lock(int fd, int what);
 errr fd_seek(int fd, ulong n);
-errr fd_chop(int fd, ulong n);
 errr fd_read(int fd, char *buf, ulong n);
 errr fd_write(int fd, concptr buf, ulong n);
 errr fd_close(int fd);