Skip to content

Commit

Permalink
feat!: change Version::(w)string default separator
Browse files Browse the repository at this point in the history
  • Loading branch information
qudix committed May 16, 2024
1 parent d176e9c commit 86956ac
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CommonLibF4/include/REL/Relocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,25 +280,25 @@ namespace REL

[[nodiscard]] constexpr value_type build() const noexcept { return _impl[3]; }

[[nodiscard]] std::string string() const
[[nodiscard]] constexpr std::string string(const std::string_view a_separator = "."sv) const
{
std::string result;
for (auto&& ver : _impl) {
result += std::to_string(ver);
result += '-';
result.append(a_separator.data(), a_separator.size());
}
result.pop_back();
result.erase(result.size() - a_separator.size(), a_separator.size());
return result;
}

[[nodiscard]] std::wstring wstring() const
[[nodiscard]] constexpr std::wstring wstring(const std::wstring_view a_separator = L"."sv) const
{
std::wstring result;
for (auto&& ver : _impl) {
result += std::to_wstring(ver);
result += L'-';
result.append(a_separator.data(), a_separator.size());
}
result.pop_back();
result.erase(result.size() - a_separator.size(), a_separator.size());
return result;
}

Expand Down Expand Up @@ -609,7 +609,7 @@ namespace REL
const auto version = Module::get().version();
const auto path = std::format(
"Data/F4SE/Plugins/version-{}.bin",
version.string());
version.string("-"sv));
if (!_mmap.open(path)) {
stl::report_and_fail(std::format("failed to open: {}", path));
}
Expand Down

0 comments on commit 86956ac

Please sign in to comment.