return SpoilerOutputResultType::FILE_OPEN_FAILED;
}
- spoiler_underline(std::string("Artifact Spoilers for Hengband Version ").append(get_version()).data());
+ std::stringstream ss;
+ ss << "Artifact Spoilers for Hengband Version " << get_version();
+ spoiler_underline(ss.str());
for (const auto &[tval_list, name] : group_artifact_list) {
spoiler_blanklines(2);
spoiler_underline(name);
* Write a line to the spoiler file and then "underline" it with hypens
* @param str 出力したい文字列
*/
-void spoiler_underline(concptr str)
+void spoiler_underline(std::string_view str)
{
- fprintf(spoiler_file, "%s\n", str);
- spoiler_out_n_chars(strlen(str), '-');
+ fprintf(spoiler_file, "%s\n", str.data());
+ spoiler_out_n_chars(str.length(), '-');
fprintf(spoiler_file, "\n");
}
struct flag_desc;
std::vector<std::string> extract_spoiler_flags(const TrFlags &art_flags, const std::vector<flag_desc> &definitions);
void spoiler_blanklines(int n);
-void spoiler_underline(concptr str);
+void spoiler_underline(std::string_view str);
void spoil_out(std::string_view sv, bool flush_buffer = false);