Remove fmt::format and replace with std::format

This commit is contained in:
Alexander Bock
2024-03-24 20:19:14 +01:00
parent 9878bfc8f7
commit 3ba346a227
246 changed files with 1343 additions and 1300 deletions

View File

@@ -378,12 +378,12 @@ TestResult InListVerifier<T>::operator()(const ghoul::Dictionary& dict,
std::string list = std::accumulate(
values.begin() + 1,
values.end(),
fmt::format("{}", values.front()),
std::format("{}", values.front()),
[](std::string lhs, typename T::Type rhs) {
return fmt::format("{}, {}", lhs, rhs);
return std::format("{}, {}", lhs, rhs);
}
);
o.explanation = fmt::format(
o.explanation = std::format(
"'{}' not in list of accepted values '{}'",
key, list
);

View File

@@ -196,7 +196,7 @@ from_string(std::string_view string)
if (string == "Pan Y") { return T::PanY; }
if (string == "Property") { return T::Property; }
throw RuntimeError(fmt::format("Unknown axis type '{}'", string), "Joystick");
throw RuntimeError(std::format("Unknown axis type '{}'", string), "Joystick");
}
template <>
@@ -220,7 +220,7 @@ from_string(std::string_view string)
if (string == "JoystickLike") { return T::JoystickLike; }
if (string == "TriggerLike") { return T::TriggerLike; }
throw RuntimeError(fmt::format("Unknown joystick type '{}'", string), "Joystick");
throw RuntimeError(std::format("Unknown joystick type '{}'", string), "Joystick");
}
} // namespace ghoul

View File

@@ -150,7 +150,7 @@ constexpr openspace::interaction::JoystickAction from_string(std::string_view st
if (string == "Repeat") { return openspace::interaction::JoystickAction::Repeat; }
if (string == "Release") { return openspace::interaction::JoystickAction::Release; }
throw RuntimeError(fmt::format("Unknown action '{}'", string));
throw RuntimeError(std::format("Unknown action '{}'", string));
}
} // namespace ghoul

View File

@@ -407,7 +407,7 @@ struct ScriptMessage {
if (buffer.size() != (sizeof(uint32_t) + len)) {
LERRORC(
"ParallelPeer",
fmt::format(
std::format(
"Received buffer with wrong size. Expected {} got {}",
len, buffer.size()
)

View File

@@ -110,7 +110,7 @@ void NumericalProperty<T>::setExponent(float exponent) {
if (!isValidRange(_minimumValue, _maximumValue)) {
LWARNINGC(
"NumericalProperty: setExponent",
fmt::format(
std::format(
"Setting exponent for properties with negative values in "
"[min, max] range is not yet supported. Property: {}",
this->fullyQualifiedIdentifier()

View File

@@ -76,7 +76,7 @@ std::string formatJson(T value) {
values += std::to_string(value[i]) + ',';
}
values.pop_back();
return fmt::format("[{}]", values);
return std::format("[{}]", values);
}
else if constexpr (internal::isGlmMatrix<T>()) {
std::string values;
@@ -86,7 +86,7 @@ std::string formatJson(T value) {
}
}
values.pop_back();
return fmt::format("[{}]", values);
return std::format("[{}]", values);
}
else {
static_assert(sizeof(T) == 0, "JSON formatting of type T not implemented");

View File

@@ -578,7 +578,7 @@ public:
timout_c(ephemerisTime, format, bufferSize, outBuf);
if (failed_c()) {
throwSpiceError(fmt::format(
throwSpiceError(std::format(
"Error converting ephemeris time '{}' to date with format '{}'",
ephemerisTime, format
));