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
+3 -3
View File
@@ -104,7 +104,7 @@ void Handler::onVREvent(const VRDataIndex& eventData) {
else {
LERRORC(
"onVREvent()",
fmt::format("Received an event named {} of unknown type", eventData.getName())
std::format("Received an event named {} of unknown type", eventData.getName())
);
}
@@ -244,7 +244,7 @@ void Handler::onVREvent(const VRDataIndex& eventData) {
global::openSpaceEngine.decode(std::move(synchronizationBuffer));
}
else {
LERRORC("onVREvent()", fmt::format("Received an event of unknown type {}", type));
LERRORC("onVREvent()", std::format("Received an event of unknown type {}", type));
}
}
@@ -372,7 +372,7 @@ int main(int argc, char** argv) {
LFATALC("main", "Could not find configuration: " + configurationFilePath);
exit(EXIT_FAILURE);
}
LINFO(fmt::format("Configuration Path: '{}'", configurationFilePath));
LINFO(std::format("Configuration Path: '{}'", configurationFilePath));
// Loading configuration from disk
LDEBUG("Loading configuration from disk");
@@ -60,7 +60,7 @@ void FileSystemAccess::parseChildDirElements(const QFileInfo& fileInfo,
for (const QFileInfo& fi : fileList) {
std::string res = space + fi.fileName().toStdString();
if (level == 0 && userAssets) {
res = fmt::format("${{USER_ASSETS}}/{}", res);
res = std::format("${{USER_ASSETS}}/{}", res);
}
if (fi.isDir()) {
dirNames.push_back(res);
@@ -102,7 +102,7 @@ namespace {
QMessageBox::critical(
parent,
"Exception",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"Could not open profile file '{}'", filename
))
);
@@ -117,7 +117,7 @@ namespace {
QMessageBox::critical(
parent,
"Exception",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"ParsingError exception in '{}': {}, {}",
filename, e.component, e.message
))
@@ -128,7 +128,7 @@ namespace {
QMessageBox::critical(
parent,
"Exception",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"RuntimeError exception in '{}', component {}: {}",
filename, e.component, e.message
))
@@ -153,7 +153,7 @@ namespace {
QMessageBox::critical(
parent,
"Exception",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"Error writing data to file '{}' as file is marked hidden",
path
))
@@ -165,7 +165,7 @@ namespace {
QMessageBox::critical(
parent,
"Exception",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"Error writing data to file '{}': {}", path, e.what()
))
);
@@ -188,7 +188,7 @@ namespace {
QMessageBox::critical(
parent,
"Exception",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"Error writing data to file '{}': {}", path, e.what()
))
);
@@ -481,7 +481,7 @@ void LauncherWindow::populateProfilesList(const std::string& preset) {
if (!std::filesystem::exists(_profilePath)) {
LINFOC(
"LauncherWindow",
fmt::format("Could not find profile folder '{}'", _profilePath)
std::format("Could not find profile folder '{}'", _profilePath)
);
return;
}
@@ -517,7 +517,7 @@ void LauncherWindow::populateProfilesList(const std::string& preset) {
const std::optional<std::string>& d = p->meta.value().description;
if (d.has_value()) {
// Tooltip has to be 'rich text' to linebreak properly
const QString tooltip = QString::fromStdString(fmt::format(
const QString tooltip = QString::fromStdString(std::format(
"<p>{}</p>", *d
));
_profileBox->setItemData(idx, tooltip, Qt::ToolTipRole);
@@ -555,7 +555,7 @@ void LauncherWindow::populateProfilesList(const std::string& preset) {
const std::optional<std::string>& d = p->meta.value().description;
if (d.has_value()) {
// Tooltip has to be 'rich text' to linebreak properly
const QString tooltip = QString::fromStdString(fmt::format(
const QString tooltip = QString::fromStdString(std::format(
"<p>{}</p>", *d
));
_profileBox->setItemData(idx, tooltip, Qt::ToolTipRole);
@@ -602,7 +602,7 @@ bool handleConfigurationFile(QComboBox& box, const std::filesystem::directory_en
}
if (!tooltipDescription.empty()) {
const QString toolTip = QString::fromStdString(
fmt::format("<p>{}</p>", tooltipDescription)
std::format("<p>{}</p>", tooltipDescription)
);
box.setItemData(box.count() - 1, toolTip, Qt::ToolTipRole);
}
@@ -671,7 +671,7 @@ void LauncherWindow::populateWindowConfigsList(const std::string& preset) {
else {
LINFOC(
"LauncherWindow",
fmt::format("Could not find config folder '{}'", _configPath)
std::format("Could not find config folder '{}'", _configPath)
);
}
@@ -729,7 +729,7 @@ void LauncherWindow::onNewWindowConfigSelection(int newIndex) {
else if (newIndex >= _preDefinedConfigStartingIdx) {
_editWindowButton->setEnabled(false);
_editWindowButton->setToolTip(
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"Cannot edit '{}'\nsince it is one of the configuration "
"files provided in the OpenSpace installation", fileSelected
))
@@ -741,7 +741,7 @@ void LauncherWindow::onNewWindowConfigSelection(int newIndex) {
sgct::readConfigGenerator(fileSelected);
if (!versionCheck(previewGenVersion)) {
_editWindowButton->setEnabled(false);
_editWindowButton->setToolTip(QString::fromStdString(fmt::format(
_editWindowButton->setToolTip(QString::fromStdString(std::format(
"This file does not meet the minimum required version of {}.",
versionMin.versionString()
)));
@@ -851,7 +851,7 @@ void LauncherWindow::openWindowEditor(const std::string& winCfg, bool isUserWinC
}
catch (const std::runtime_error& e) {
//Re-throw an SGCT error exception with the runtime exception message
throw std::runtime_error(fmt::format(
throw std::runtime_error(std::format(
"Importing of this configuration file failed because of a "
"problem detected in the readConfig function:\n\n{}", e.what()
));
@@ -874,7 +874,7 @@ void LauncherWindow::openWindowEditor(const std::string& winCfg, bool isUserWinC
else {
editRefusalDialog(
"File Format Version Error",
fmt::format(
std::format(
"File '{}' does not meet the minimum required version of {}",
winCfg, versionMin.versionString()
),
@@ -885,7 +885,7 @@ void LauncherWindow::openWindowEditor(const std::string& winCfg, bool isUserWinC
catch (const std::runtime_error& e) {
editRefusalDialog(
"Format Validation Error",
fmt::format("Parsing error found in file '{}'", winCfg),
std::format("Parsing error found in file '{}'", winCfg),
e.what()
);
}
@@ -56,7 +56,7 @@ namespace {
void updateListItem(QListWidgetItem* item, const Profile::Keybinding& kb) {
ghoul_assert(item, "Item must exist at this point");
const std::string n = fmt::format("{}\t{}", ghoul::to_string(kb.key), kb.action);
const std::string n = std::format("{}\t{}", ghoul::to_string(kb.key), kb.action);
item->setText(QString::fromStdString(n));
}
} // namespace
@@ -474,7 +474,7 @@ void ActionDialog::actionRemove() {
const QMessageBox::StandardButton button = QMessageBox::information(
this,
"Remove action",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"Action '{}' is used in the keybind '{}' and cannot be removed unless "
"the keybind is removed as well. Do you want to remove the keybind as "
"well?",
@@ -253,8 +253,8 @@ QString AssetsDialog::createTextSummary() {
const bool existsInFilesystem = summaryItems.at(i)->doesExistInFilesystem();
const std::string s = existsInFilesystem ?
fmt::format("{}<br>", summaryPaths.at(i)) :
fmt::format("<font color='red'>{}</font><br>", summaryPaths.at(i));
std::format("{}<br>", summaryPaths.at(i)) :
std::format("<font color='red'>{}</font><br>", summaryPaths.at(i));
summary += QString::fromStdString(s);
}
return summary;
@@ -37,6 +37,7 @@
#include <QPlainTextEdit>
#include <QPushButton>
#include <QTabWidget>
#include <fstream>
namespace {
constexpr int CameraTypeNode = 0;
@@ -60,7 +60,7 @@ namespace {
std::string checkForTimeDescription(int intervalIndex, double value) {
double amount = value / TimeIntervals[intervalIndex].secondsPerInterval;
std::string description = fmt::format("{}", amount);
std::string description = std::format("{}", amount);
description += " " + TimeIntervals[intervalIndex].intervalName + "/sec";
return description;
}
@@ -202,7 +202,7 @@ std::string DeltaTimesDialog::createSummaryForDeltaTime(size_t idx, bool forList
}
if (forListView) {
s += fmt::format(
s += std::format(
"\t{}\t{}", _deltaTimesData.at(idx), timeDescription(_deltaTimesData.at(idx))
);
}
@@ -237,7 +237,7 @@ void DeltaTimesDialog::setLabelForKey(int index, bool editMode, std::string_view
if (editMode) {
labelS += " '" + createSummaryForDeltaTime(index, false) + "':";
}
_adjustLabel->setText(QString::fromStdString(fmt::format(
_adjustLabel->setText(QString::fromStdString(std::format(
"<font color='{}'>{}</font>", color, labelS
)));
}
@@ -164,7 +164,7 @@ void HorizonsDialog::importTimeRange() {
}
_errorMsg->setText("Could not import time range");
const std::string msg = fmt::format(
const std::string msg = std::format(
"Could not import time range '{}' to '{}'",
_validTimeRange.first, _validTimeRange.second
);
@@ -438,7 +438,7 @@ bool HorizonsDialog::isValidInput() {
bool couldConvert = false;
const int32_t step = _stepEdit->text().toInt(&couldConvert);
if (!couldConvert) {
_errorMsg->setText(QString::fromStdString(fmt::format(
_errorMsg->setText(QString::fromStdString(std::format(
"Step size needs to be a number in range 1 to {}",
std::numeric_limits<int32_t>::max()
)));
@@ -458,7 +458,7 @@ bool HorizonsDialog::isValidInput() {
// website as a uint32_t. If step size over 32 bit int is sent, this error message is
// received: Cannot read numeric value -- re-enter
if (step < 1) {
_errorMsg->setText(QString::fromStdString(fmt::format(
_errorMsg->setText(QString::fromStdString(std::format(
"Step size is outside valid range 1 to '{}'",
std::numeric_limits<int32_t>::max()
)));
@@ -503,7 +503,7 @@ nlohmann::json HorizonsDialog::handleReply(QNetworkReply* reply) {
const QVariant statusCode =
reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
if (!checkHttpStatus(statusCode)) {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Connection Error '{}'", reply->errorString().toStdString()
);
appendLog(msg, HorizonsDialog::LogLevel::Error);
@@ -519,7 +519,7 @@ nlohmann::json HorizonsDialog::handleReply(QNetworkReply* reply) {
redirect = reply->url().resolved(redirect);
}
const std::string msg = fmt::format(
const std::string msg = std::format(
"Redirecting request to '{}'", redirect.toString().toStdString()
);
appendLog(msg, HorizonsDialog::LogLevel::Info);
@@ -530,7 +530,7 @@ nlohmann::json HorizonsDialog::handleReply(QNetworkReply* reply) {
reply->deleteLater();
if (answer.isEmpty()) {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Connection Error '{}'", reply->errorString().toStdString()
);
appendLog(msg, HorizonsDialog::LogLevel::Error);
@@ -568,7 +568,7 @@ bool HorizonsDialog::checkHttpStatus(const QVariant& statusCode) {
"later time";
break;
default:
message = fmt::format(
message = std::format(
"HTTP status code '{}' was returned",
statusCode.toString().toStdString()
);
@@ -666,7 +666,7 @@ std::pair<std::string, std::string> HorizonsDialog::readTimeRange() {
}
else {
_errorMsg->setText("Could not parse time range");
const std::string msg = fmt::format(
const std::string msg = std::format(
"Could not read time range '{}' to '{}'",
timeRange.first, timeRange.second
);
@@ -675,7 +675,7 @@ std::pair<std::string, std::string> HorizonsDialog::readTimeRange() {
return std::pair<std::string, std::string>();
}
else {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Could not find all time range information. Latest Horizons "
"mesage: {}", _latestHorizonsError
);
@@ -741,7 +741,7 @@ bool HorizonsDialog::handleRequest() {
std::filesystem::rename(oldFile, newFile);
const std::string msg = fmt::format(
const std::string msg = std::format(
"For more information, see the saved error file '{}'", newFile
);
appendLog(msg, LogLevel::Info);
@@ -794,13 +794,13 @@ std::string HorizonsDialog::constructUrl() {
_observerName = center;
}
_startTime = fmt::format(
_startTime = std::format(
"{} {}",
_startEdit->date().toString("yyyy-MM-dd").toStdString(),
_startEdit->time().toString("hh:mm:ss").toStdString()
);
_endTime = fmt::format(
_endTime = std::format(
"{} {}",
_endEdit->date().toString("yyyy-MM-dd").toStdString(),
_endEdit->time().toString("hh:mm:ss").toStdString()
@@ -872,7 +872,7 @@ openspace::HorizonsFile HorizonsDialog::handleAnswer(nlohmann::json& answer) {
auto result = answer.find("result");
if (result == answer.end()) {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Malformed answer received '{}'", answer.dump()
);
appendLog(msg, HorizonsDialog::LogLevel::Error);
@@ -929,7 +929,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
case HorizonsResultCode::Empty: {
_errorMsg->setText("The horizons file is empty");
if (!_latestHorizonsError.empty()) {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Latest Horizons error: {}", _latestHorizonsError
);
appendLog(msg, LogLevel::Error);
@@ -939,7 +939,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::ErrorSize: {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Time range '{}' to '{}' with step size '{} {}' is too big, try to "
"increase the step size and/or decrease the time range",
_startTime, _endTime, _stepEdit->text().toStdString(),
@@ -963,7 +963,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
std::filesystem::remove(_horizonsFile.file());
break;
case HorizonsResultCode::ErrorTimeRange: {
std::string msg = fmt::format(
std::string msg = std::format(
"Time range is outside the valid range for target '{}'", _targetName
);
appendLog(msg, HorizonsDialog::LogLevel::Error);
@@ -973,13 +973,13 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
_validTimeRange = readTimeRange();
if (_validTimeRange.first.empty() || _validTimeRange.second.empty()) {
if (!_latestHorizonsError.empty()) {
msg = fmt::format("Latest Horizons error: {}", _latestHorizonsError);
msg = std::format("Latest Horizons error: {}", _latestHorizonsError);
appendLog(msg, LogLevel::Error);
}
break;
}
msg = fmt::format(
msg = std::format(
"Valid time range is '{}' to '{}'",
_validTimeRange.first, _validTimeRange.second
);
@@ -990,12 +990,12 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::ErrorNoObserver: {
std::string msg = fmt::format(
std::string msg = std::format(
"No match was found for observer '{}'", _observerName
);
appendLog(msg, HorizonsDialog::LogLevel::Error);
msg = fmt::format(
msg = std::format(
"Try to use '@{}' as observer to search for possible matches",
_observerName
);
@@ -1006,7 +1006,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::ErrorObserverTargetSame: {
const std::string msg = fmt::format(
const std::string msg = std::format(
"The observer '{}' and target '{}' are the same. Please use another "
"observer for the current target", _observerName, _targetName
);
@@ -1018,7 +1018,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::ErrorNoData: {
const std::string msg = fmt::format(
const std::string msg = std::format(
"There is not enough data to compute the state of target '{}' in "
"relation to the observer '{}' for the time range '{}' to '{}'. Try to "
"use another observer for the current target or another time range",
@@ -1030,13 +1030,13 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::MultipleObserverStations: {
std::string msg = fmt::format(
std::string msg = std::format(
"Multiple matching observer stations were found for observer '{}'",
_observerName
);
appendLog(msg, HorizonsDialog::LogLevel::Warning);
msg = fmt::format(
msg = std::format(
"Did not find what you were looking for? Use '@{}' as observer to search "
"for alternatives", _observerName
);
@@ -1054,7 +1054,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
HorizonsDialog::LogLevel::Error
);
if (!_latestHorizonsError.empty()) {
msg = fmt::format("Latest Horizons error: {}", _latestHorizonsError);
msg = std::format("Latest Horizons error: {}", _latestHorizonsError);
appendLog(msg, LogLevel::Error);
}
break;
@@ -1073,7 +1073,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::MultipleObserver: {
std::string msg = fmt::format(
std::string msg = std::format(
"Multiple matches were found for observer '{}'", _observerName
);
appendLog(msg, HorizonsDialog::LogLevel::Warning);
@@ -1087,7 +1087,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
HorizonsDialog::LogLevel::Error
);
if (!_latestHorizonsError.empty()) {
msg = fmt::format("Latest Horizons error: {}", _latestHorizonsError);
msg = std::format("Latest Horizons error: {}", _latestHorizonsError);
appendLog(msg, LogLevel::Error);
}
break;
@@ -1106,12 +1106,12 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
break;
}
case HorizonsResultCode::ErrorNoTarget: {
std::string msg = fmt::format(
std::string msg = std::format(
"No match was found for target '{}'", _targetName
);
appendLog(msg, HorizonsDialog::LogLevel::Error);
msg = fmt::format(
msg = std::format(
"Try to use '{}*' as target to search for possible matches", _targetName
);
appendLog(msg, HorizonsDialog::LogLevel::Info);
@@ -1132,7 +1132,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
// Format: ID#, Name, Designation, IAU/aliases/other
// Line after data: Number of matches = X. Use ID# to make unique selection.
std::string msg = fmt::format(
std::string msg = std::format(
"Multiple matches were found for target '{}'", _targetName
);
appendLog(msg, HorizonsDialog::LogLevel::Warning);
@@ -1146,7 +1146,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
HorizonsDialog::LogLevel::Error
);
if (!_latestHorizonsError.empty()) {
msg = fmt::format("Latest Horizons error: {}", _latestHorizonsError);
msg = std::format("Latest Horizons error: {}", _latestHorizonsError);
appendLog(msg, LogLevel::Error);
}
break;
@@ -1167,7 +1167,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
case HorizonsResultCode::UnknownError: {
appendLog("Unknown error", LogLevel::Error);
if (!_latestHorizonsError.empty()) {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Latest Horizons error: {}", _latestHorizonsError
);
appendLog(msg, LogLevel::Error);
@@ -1177,7 +1177,7 @@ bool HorizonsDialog::handleResult(openspace::HorizonsResultCode& result) {
}
default: {
if (!_latestHorizonsError.empty()) {
const std::string msg = fmt::format(
const std::string msg = std::format(
"Latest Horizons error: {}", _latestHorizonsError
);
appendLog(msg, LogLevel::Error);
@@ -81,7 +81,7 @@ namespace {
);
std::string name = it != actions.end() ? it->name : "Unknown action";
results += fmt::format("{} ({})\n", name, ghoul::to_string(k.key));
results += std::format("{} ({})\n", name, ghoul::to_string(k.key));
}
return results;
}
@@ -89,7 +89,7 @@ namespace {
std::string summarizeProperties(const std::vector<Profile::Property>& properties) {
std::string results;
for (openspace::Profile::Property p : properties) {
results += fmt::format("{} = {}\n", p.name, p.value);
results += std::format("{} = {}\n", p.name, p.value);
}
return results;
}
@@ -489,7 +489,7 @@ void ProfileEdit::approved() {
return;
}
const std::filesystem::path p = fmt::format(
const std::filesystem::path p = std::format(
"{}/{}.profile", _builtInProfilesPath, profileName
);
if (std::filesystem::exists(p)) {
@@ -65,7 +65,7 @@ void ScriptlogDialog::createWidgets() {
QGridLayout* layout = new QGridLayout(this);
{
QLabel* heading = new QLabel(QString::fromStdString(fmt::format(
QLabel* heading = new QLabel(QString::fromStdString(std::format(
"Choose commands from \"{}\"", _scriptLogFile
)));
heading->setObjectName("heading");
@@ -84,7 +84,7 @@ void ScriptlogDialog::createWidgets() {
);
_scriptLogFile = file.toStdString();
heading->setText(QString::fromStdString(fmt::format(
heading->setText(QString::fromStdString(std::format(
"Choose commands from \"{}\"", _scriptLogFile
)));
loadScriptFile();
@@ -33,7 +33,7 @@
#include <QLabel>
#include <QLineEdit>
#include <QVBoxLayout>
#include <fmt/format.h>
#include <format>
#include <algorithm>
using namespace openspace;
@@ -175,7 +175,7 @@ void TimeDialog::approved() {
else {
Profile::Time t;
t.type = Profile::Time::Type::Absolute;
t.value = fmt::format(
t.value = std::format(
"{}T{}",
_absoluteEdit->date().toString("yyyy-MM-dd").toStdString(),
_absoluteEdit->time().toString().toStdString()
@@ -94,7 +94,7 @@ void DisplayWindowUnion::createWidgets(int nMaxWindows,
layoutMonButton->addStretch(1);
_addWindowButton = new QPushButton("Add Window");
_addWindowButton->setToolTip(QString::fromStdString(fmt::format(
_addWindowButton->setToolTip(QString::fromStdString(std::format(
"Add a window to the configuration (up to {} windows allowed)", nMaxWindows
)));
_addWindowButton->setFocusPolicy(Qt::NoFocus);
@@ -76,7 +76,7 @@ namespace {
QList<QString> monitorNames(const std::vector<QRect>& resolutions) {
QList<QString> monitorNames;
for (size_t i = 0; i < resolutions.size(); i++) {
const std::string fullName = fmt::format(
const std::string fullName = std::format(
"{} ({}x{})",
MonitorNames[i], resolutions[i].width(), resolutions[i].height()
);
@@ -122,7 +122,7 @@ void WindowControl::createWidgets(const QColor& windowColor) {
layout->setRowStretch(8, 1);
_windowNumber = new QLabel("Window " + QString::number(_windowIndex + 1));
_windowNumber->setStyleSheet(QString::fromStdString(fmt::format(
_windowNumber->setStyleSheet(QString::fromStdString(std::format(
"QLabel {{ color : #{:02x}{:02x}{:02x}; }}",
windowColor.red(), windowColor.green(), windowColor.blue()
)));
+10 -10
View File
@@ -140,7 +140,7 @@ LONG WINAPI generateMiniDump(EXCEPTION_POINTERS* exceptionPointers) {
LINFO(s);
}
std::string dumpFile = fmt::format(
std::string dumpFile = std::format(
"OpenSpace_{}_{}_{}-{}-{}-{}-{}-{}-{}--{}--{}.dmp",
OPENSPACE_VERSION_MAJOR,
OPENSPACE_VERSION_MINOR,
@@ -155,7 +155,7 @@ LONG WINAPI generateMiniDump(EXCEPTION_POINTERS* exceptionPointers) {
GetCurrentThreadId()
);
LINFO(fmt::format("Creating dump file: {}", dumpFile));
LINFO(std::format("Creating dump file: {}", dumpFile));
HANDLE hDumpFile = CreateFileA(
dumpFile.c_str(),
@@ -826,7 +826,7 @@ void setSgctDelegateFunctions() {
glfwGetWindowContentScale(dpiWindow->windowHandle(), &scale.x, &scale.y);
if (scale.x != scale.y) {
LWARNING(fmt::format(
LWARNING(std::format(
"Non-square window scaling detected ({0}x{1}), using {0}x{0} instead",
scale.x, scale.y
));
@@ -1029,7 +1029,7 @@ std::string setWindowConfigPresetForGui(const std::string& labelFromCfgFile,
std::string preset;
const bool sgctCfgFileSpecifiedByLua = !config.sgctConfigNameInitialized.empty();
if (haveCliSGCTConfig) {
preset = fmt::format("{} (from CLI)", config.windowConfiguration);
preset = std::format("{} (from CLI)", config.windowConfiguration);
}
else if (sgctCfgFileSpecifiedByLua) {
preset = config.sgctConfigNameInitialized + labelFromCfgFile;
@@ -1066,7 +1066,7 @@ std::string selectedSgctProfileFromLauncher(LauncherWindow& lw, bool hasCliSGCTC
config += ".json";
}
else {
throw ghoul::RuntimeError(fmt::format(
throw ghoul::RuntimeError(std::format(
"Error loading configuration file '{}'. File could not be found",
config
));
@@ -1119,7 +1119,7 @@ int main(int argc, char* argv[]) {
std::filesystem::current_path() / std::filesystem::path(argv[0]).parent_path(),
ghoul::filesystem::FileSystem::Override::Yes
);
LDEBUG(fmt::format("Registering ${{BIN}} to '{}'", absPath("${BIN}")));
LDEBUG(std::format("Registering ${{BIN}} to '{}'", absPath("${BIN}")));
//
// Parse commandline arguments
@@ -1203,11 +1203,11 @@ int main(int argc, char* argv[]) {
if (!std::filesystem::is_regular_file(configurationFilePath)) {
LFATALC(
"main",
fmt::format("Could not find configuration '{}'", configurationFilePath)
std::format("Could not find configuration '{}'", configurationFilePath)
);
exit(EXIT_FAILURE);
}
LINFO(fmt::format("Configuration Path '{}'", configurationFilePath));
LINFO(std::format("Configuration Path '{}'", configurationFilePath));
// Register the base path as the directory where the configuration file lives
std::filesystem::path base = configurationFilePath.parent_path();
@@ -1265,7 +1265,7 @@ int main(int argc, char* argv[]) {
properties::Property::Visibility::Developer;
}
else {
throw ghoul::RuntimeError(fmt::format(
throw ghoul::RuntimeError(std::format(
"Unknown property visibility value '{}'",
*commandlineArguments.propertyVisibility
));
@@ -1329,7 +1329,7 @@ int main(int argc, char* argv[]) {
QMessageBox::warning(
nullptr,
"OpenSpace",
QString::fromStdString(fmt::format(
QString::fromStdString(std::format(
"The OpenSpace folder is started must not contain any of \"'\", "
"\"\"\", [, or ]. Path is: {}. Unexpected errors will occur when "
"proceeding to run the software", pwd
+1 -1
View File
@@ -64,7 +64,7 @@ int main(int, char**) {
Task& task = *tasks[i].get();
LINFOC(
"Sync",
fmt::format(
std::format(
"Synchronizing scene {} out of {}: {}",
i + 1, tasks.size(), task.description()
)
+3 -3
View File
@@ -74,12 +74,12 @@ void performTasks(const std::string& path) {
LINFO("Task queue has 1 item");
}
else {
LINFO(fmt::format("Task queue has {} items", tasks.size()));
LINFO(std::format("Task queue has {} items", tasks.size()));
}
for (size_t i = 0; i < tasks.size(); i++) {
Task& task = *tasks[i].get();
LINFO(fmt::format(
LINFO(std::format(
"Performing task {} out of {}: {}", i + 1, tasks.size(), task.description()
));
ProgressBar progressBar(100);
@@ -164,7 +164,7 @@ int main(int argc, char** argv) {
// If no task file was specified in as argument, run in CLI mode.
LINFO(fmt::format("Task root: {}", absPath("${TASKS}")));
LINFO(std::format("Task root: {}", absPath("${TASKS}")));
std::filesystem::current_path(absPath("${TASKS}"));
std::cout << "TASK > ";