#endif
std::stringstream ss;
- ss << _("playrecord-", "playrec-") << savefile_base << ".txt";
+ ss << _("playrecord-", "playrec-") << savefile_base.string() << ".txt";
const auto path = path_build(ANGBAND_DIR_USER, ss.str());
FileDisplayer(player_ptr->name).display(false, path.string(), -1, 0, diary_title);
}
}
std::stringstream ss;
- ss << _("playrecord-", "playrec-") << savefile_base << ".txt";
+ ss << _("playrecord-", "playrec-") << savefile_base.string() << ".txt";
const auto path = path_build(ANGBAND_DIR_USER, ss.str());
fd_kill(path);
std::filesystem::path ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms
std::filesystem::path savefile;
-std::string savefile_base;
+std::filesystem::path savefile_base;
/*!
* @brief プレイヤーステータスをファイルダンプ出力する
auto short_pclass = enum2i(player_ptr->pclass);
#ifdef SAVEFILE_USE_UID
const auto user_id = UnixUserIds::get_instance().get_user_id();
- strnfmt(temp1, sizeof(temp1), "%d.%s.%d%d%d", user_id, savefile_base.data(), short_pclass, player_ptr->ppersonality, player_ptr->age);
+ strnfmt(temp1, sizeof(temp1), "%d.%s.%d%d%d", user_id, savefile_base.string().data(), short_pclass, player_ptr->ppersonality, player_ptr->age);
#else
- strnfmt(temp1, sizeof(temp1), "%s.%d%d%d", savefile_base.data(), short_pclass, player_ptr->ppersonality, player_ptr->age);
+ strnfmt(temp1, sizeof(temp1), "%s.%d%d%d", savefile_base.string().data(), short_pclass, player_ptr->ppersonality, player_ptr->age);
#endif
for (int i = 0; temp1[i]; i++) {
temp1[i] ^= (i + 1) * 63;
#include <string_view>
extern std::filesystem::path savefile; //!< セーブファイルのフルパス
-extern std::string savefile_base; //!< セーブファイル名
+extern std::filesystem::path savefile_base; //!< セーブファイル名
extern std::filesystem::path ANGBAND_DIR;
extern std::filesystem::path ANGBAND_DIR_APEX;
static bool open_diary_file(FILE **fff, bool *disable_diary)
{
std::stringstream ss;
- ss << _("playrecord-", "playrec-") << savefile_base << ".txt";
+ ss << _("playrecord-", "playrec-") << savefile_base.string() << ".txt";
const auto path = path_build(ANGBAND_DIR_USER, ss.str());
*fff = angband_fopen(path, FileOpenMode::APPEND);
if (*fff) {
if (is_modified || savefile_base.empty()) {
#ifdef SAVEFILE_USE_UID
- const auto &savefile_str = savefile.filename().string();
+ const auto savefile_str = savefile.filename().string();
const auto split = str_split(savefile_str, '.');
savefile_base = split[1];
#else
- savefile_base = savefile.filename().string();
+ savefile_base = savefile.filename();
#endif
}