mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 02:20:11 -05:00
Remove fmt::format and replace with std::format
This commit is contained in:
@@ -74,7 +74,7 @@ StateMachine::StateMachine(const ghoul::Dictionary& dictionary) {
|
||||
_transitions.push_back(trans);
|
||||
}
|
||||
else {
|
||||
LERROR(fmt::format(
|
||||
LERROR(std::format(
|
||||
"Invalid transition from '{}' to '{}'. One or both of the states do not "
|
||||
"exist in the state machine", trans.from(), trans.to()
|
||||
));
|
||||
@@ -99,7 +99,7 @@ void StateMachine::setInitialState(const std::string& initialState) {
|
||||
const int stateIndex = findState(initialState);
|
||||
|
||||
if (stateIndex == -1) {
|
||||
LWARNING(fmt::format(
|
||||
LWARNING(std::format(
|
||||
"Attempting to initialize with undefined state '{}'", initialState
|
||||
));
|
||||
return;
|
||||
@@ -127,7 +127,7 @@ void StateMachine::transitionTo(const std::string& newState) {
|
||||
|
||||
const int stateIndex = findState(newState);
|
||||
if (stateIndex == -1) {
|
||||
LWARNING(fmt::format(
|
||||
LWARNING(std::format(
|
||||
"Attempting to transition to undefined state '{}'", newState
|
||||
));
|
||||
return;
|
||||
@@ -135,7 +135,7 @@ void StateMachine::transitionTo(const std::string& newState) {
|
||||
|
||||
const int transitionIndex = findTransitionTo(newState);
|
||||
if (transitionIndex == -1) {
|
||||
LWARNING(fmt::format(
|
||||
LWARNING(std::format(
|
||||
"Transition from '{}' to '{}' is undefined",
|
||||
currentState()->name(), newState
|
||||
));
|
||||
@@ -202,7 +202,7 @@ void StateMachine::saveToDotFile(const std::string& filename) const {
|
||||
|
||||
std::ofstream file(outputFile);
|
||||
if (!file.good()) {
|
||||
LERROR(fmt::format(
|
||||
LERROR(std::format(
|
||||
"Error opening file '{}' for saving state machine dot file", outputFile
|
||||
));
|
||||
return;
|
||||
@@ -210,14 +210,14 @@ void StateMachine::saveToDotFile(const std::string& filename) const {
|
||||
|
||||
file << "digraph statemachine {\n";
|
||||
for (const State& s : _states) {
|
||||
file << fmt::format("\t{};\n", s.name());
|
||||
file << std::format("\t{};\n", s.name());
|
||||
}
|
||||
for (const Transition& t : _transitions) {
|
||||
file << fmt::format("\t{} -> {};\n", t.from(), t.to());
|
||||
file << std::format("\t{} -> {};\n", t.from(), t.to());
|
||||
}
|
||||
file << "}\n";
|
||||
|
||||
LINFO(fmt::format("Saved state machine to file: {}", outputFile));
|
||||
LINFO(std::format("Saved state machine to file: {}", outputFile));
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user