diff --git a/apps/OpenSpace-MinVR/main.cpp b/apps/OpenSpace-MinVR/main.cpp index 382d23499e..46357781ca 100644 --- a/apps/OpenSpace-MinVR/main.cpp +++ b/apps/OpenSpace-MinVR/main.cpp @@ -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"); diff --git a/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp b/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp index 208b04a30c..075280fee9 100644 --- a/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp +++ b/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp @@ -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); diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index 065e1dbf67..6f4dfce048 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -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& 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( "

{}

", *d )); _profileBox->setItemData(idx, tooltip, Qt::ToolTipRole); @@ -555,7 +555,7 @@ void LauncherWindow::populateProfilesList(const std::string& preset) { const std::optional& 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( "

{}

", *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("

{}

", tooltipDescription) + std::format("

{}

", 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() ); } diff --git a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp index 1a6f59ebcb..f9b7b8d9bd 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp @@ -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?", diff --git a/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp index cb7800ddb7..07d36c74b1 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp @@ -253,8 +253,8 @@ QString AssetsDialog::createTextSummary() { const bool existsInFilesystem = summaryItems.at(i)->doesExistInFilesystem(); const std::string s = existsInFilesystem ? - fmt::format("{}
", summaryPaths.at(i)) : - fmt::format("{}
", summaryPaths.at(i)); + std::format("{}
", summaryPaths.at(i)) : + std::format("{}
", summaryPaths.at(i)); summary += QString::fromStdString(s); } return summary; diff --git a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp index 7d941ccfe6..82e4360098 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp @@ -37,6 +37,7 @@ #include #include #include +#include namespace { constexpr int CameraTypeNode = 0; diff --git a/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp index 5c208e9e0e..f564dc9257 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp @@ -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( "{}", color, labelS ))); } diff --git a/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp index 1ed5f5d636..e340b5ff50 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp @@ -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::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::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 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 HorizonsDialog::readTimeRange() { return std::pair(); } 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); diff --git a/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp b/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp index 233de812ff..6d9abae5e5 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp @@ -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& 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)) { diff --git a/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp index 191c2006b7..2287f48423 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp @@ -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(); diff --git a/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp index ca81de16e2..6aa1998b04 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include 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() diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp index b411b8979d..88961d3c9f 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp @@ -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); diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp index ba7a7358cd..40500298f0 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp @@ -76,7 +76,7 @@ namespace { QList monitorNames(const std::vector& resolutions) { QList 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() ))); diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 5c5ffb9d2d..9bcd52ac18 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 5c5ffb9d2d6039a7a40c668625188aaed45cb451 +Subproject commit 9bcd52ac187bc6ecff7af069b106d07dfc22a9be diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index bd7199198e..f999623859 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -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 diff --git a/apps/Sync/main.cpp b/apps/Sync/main.cpp index 3a4255997e..d40c84b4ba 100644 --- a/apps/Sync/main.cpp +++ b/apps/Sync/main.cpp @@ -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() ) diff --git a/apps/TaskRunner/main.cpp b/apps/TaskRunner/main.cpp index 81316a9d04..a3593ea4a9 100644 --- a/apps/TaskRunner/main.cpp +++ b/apps/TaskRunner/main.cpp @@ -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 > "; diff --git a/ext/ghoul b/ext/ghoul index 580fe25d6c..c5164de300 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 580fe25d6ce12842f397b451601e815d03d95bec +Subproject commit c5164de300f56b5034ec94fcefe7e6a6c03e4bfe diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 8ed86be2b3..39ebc08663 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -378,12 +378,12 @@ TestResult InListVerifier::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 ); diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index 5b2a993d04..46cc3f6d7b 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -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 diff --git a/include/openspace/interaction/joystickinputstate.h b/include/openspace/interaction/joystickinputstate.h index 0370470589..9c7a182c3f 100644 --- a/include/openspace/interaction/joystickinputstate.h +++ b/include/openspace/interaction/joystickinputstate.h @@ -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 diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index f959ddc9b1..0cbc6281b0 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -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() ) diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index ce87cd47b0..284b821e35 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -110,7 +110,7 @@ void NumericalProperty::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() diff --git a/include/openspace/util/json_helper.inl b/include/openspace/util/json_helper.inl index 33e8e827c9..62a4c96f9b 100644 --- a/include/openspace/util/json_helper.inl +++ b/include/openspace/util/json_helper.inl @@ -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()) { 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"); diff --git a/include/openspace/util/spicemanager.h b/include/openspace/util/spicemanager.h index 7cf10f7b9d..bd01734f9d 100644 --- a/include/openspace/util/spicemanager.h +++ b/include/openspace/util/spicemanager.h @@ -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 )); diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp index 5bdee24199..0bcf5b29e5 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -488,7 +488,7 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& data, const Deferred unsigned int counter = 0; for (const ShadowRenderingStruct& sd : _shadowDataArrayCache) { // Add the counter - char* bf = fmt::format_to(_uniformNameBuffer + 16, "{}", counter); + char* bf = std::format_to(_uniformNameBuffer + 16, "{}", counter); std::strcpy(bf, "].isShadowing\0"); program.setUniform(_uniformNameBuffer, sd.isShadowing); @@ -842,7 +842,7 @@ void AtmosphereDeferredcaster::calculateDeltaJ(int scatteringOrder, } if (_saveCalculationTextures) { saveTextureFile( - fmt::format("deltaJ_texture-scattering_order-{}.ppm", scatteringOrder), + std::format("deltaJ_texture-scattering_order-{}.ppm", scatteringOrder), glm::ivec2(_textureSize) ); } @@ -882,7 +882,7 @@ void AtmosphereDeferredcaster::calculateDeltaE(int scatteringOrder, glDrawArrays(GL_TRIANGLES, 0, 6); if (_saveCalculationTextures) { saveTextureFile( - fmt::format("deltaE_texture-scattering_order-{}.ppm", scatteringOrder), + std::format("deltaE_texture-scattering_order-{}.ppm", scatteringOrder), _deltaETableSize ); } @@ -922,7 +922,7 @@ void AtmosphereDeferredcaster::calculateDeltaS(int scatteringOrder, } if (_saveCalculationTextures) { saveTextureFile( - fmt::format("deltaS_texture-scattering_order-{}.ppm", scatteringOrder), + std::format("deltaS_texture-scattering_order-{}.ppm", scatteringOrder), glm::ivec2(_textureSize) ); } @@ -953,7 +953,7 @@ void AtmosphereDeferredcaster::calculateIrradiance(int scatteringOrder, glDrawArrays(GL_TRIANGLES, 0, 6); if (_saveCalculationTextures) { saveTextureFile( - fmt::format("irradianceTable_order-{}.ppm", scatteringOrder), + std::format("irradianceTable_order-{}.ppm", scatteringOrder), _deltaETableSize ); } @@ -990,7 +990,7 @@ void AtmosphereDeferredcaster::calculateInscattering(int scatteringOrder, } if (_saveCalculationTextures) { saveTextureFile( - fmt::format("inscatteringTable_order-{}.ppm", scatteringOrder), + std::format("inscatteringTable_order-{}.ppm", scatteringOrder), glm::ivec2(_textureSize) ); } diff --git a/modules/base/dashboard/dashboarditemangle.cpp b/modules/base/dashboard/dashboarditemangle.cpp index 7a8857d8e0..4a59cbdd66 100644 --- a/modules/base/dashboard/dashboarditemangle.cpp +++ b/modules/base/dashboard/dashboarditemangle.cpp @@ -269,7 +269,7 @@ void DashboardItemAngle::render(glm::vec2& penPosition) { std::fill(_buffer.begin(), _buffer.end(), char(0)); if (glm::length(a) == 0.0 || glm::length(b) == 0) { - char* end = fmt::format_to( + char* end = std::format_to( _buffer.data(), "Could not compute angle at {} between {} and {}", sourceInfo.second, destinationInfo.second, referenceInfo.second @@ -286,7 +286,7 @@ void DashboardItemAngle::render(glm::vec2& penPosition) { glm::acos(glm::dot(a, b) / (glm::length(a) * glm::length(b))) ); - char* end = fmt::format_to( + char* end = std::format_to( _buffer.data(), "Angle at {} between {} and {}: {} degrees", sourceInfo.second, destinationInfo.second, referenceInfo.second, angle diff --git a/modules/base/dashboard/dashboarditemdate.cpp b/modules/base/dashboard/dashboarditemdate.cpp index 2a9d6574b9..f2fe23b3a3 100644 --- a/modules/base/dashboard/dashboarditemdate.cpp +++ b/modules/base/dashboard/dashboarditemdate.cpp @@ -97,10 +97,11 @@ void DashboardItemDate::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_formatString.value()), time) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_formatString.value(), std::make_format_args(time)) ); } - catch (const fmt::format_error&) { + catch (const std::format_error&) { LERRORC("DashboardItemDate", "Illegal format string"); } penPosition.y -= _font->height(); @@ -110,7 +111,10 @@ glm::vec2 DashboardItemDate::size() const { ZoneScoped; std::string_view time = global::timeManager->time().UTC(); - return _font->boundingBox(fmt::format(fmt::runtime(_formatString.value()), time)); + // @CPP26(abock): This can be replaced with std::runtime_format + return _font->boundingBox( + std::vformat(_formatString.value(), std::make_format_args(time)) + ); } } // namespace openspace diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index 241024118f..b3dcf73d25 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -369,16 +369,22 @@ void DashboardItemDistance::render(glm::vec2& penPosition) { std::fill(_buffer.begin(), _buffer.end(), char(0)); try { - char* end = fmt::format_to( + // @CPP26(abock): This can be replaced with std::runtime_format + char* end = std::vformat_to( _buffer.data(), - fmt::runtime(_formatString.value()), - sourceInfo.second, destinationInfo.second, dist.first, dist.second + _formatString.value(), + std::make_format_args( + sourceInfo.second, + destinationInfo.second, + dist.first, + dist.second + ) ); const std::string_view t = std::string_view(_buffer.data(), end - _buffer.data()); RenderFont(*_font, penPosition, t); } - catch (const fmt::format_error&) { + catch (const std::format_error&) { LERRORC("DashboardItemDate", "Illegal format string"); } penPosition.y -= _font->height(); @@ -399,7 +405,7 @@ glm::vec2 DashboardItemDistance::size() const { } return _font->boundingBox( - fmt::format("Distance from focus: {} {}", dist.first, dist.second) + std::format("Distance from focus: {} {}", dist.first, dist.second) ); } diff --git a/modules/base/dashboard/dashboarditemelapsedtime.cpp b/modules/base/dashboard/dashboarditemelapsedtime.cpp index b1b623bd8c..9e231f8840 100644 --- a/modules/base/dashboard/dashboarditemelapsedtime.cpp +++ b/modules/base/dashboard/dashboarditemelapsedtime.cpp @@ -153,7 +153,7 @@ void DashboardItemElapsedTime::render(glm::vec2& penPosition) { const std::vector> ts = splitTime(delta); std::string time; for (const std::pair& t : ts) { - time += fmt::format("{} {} ", t.first, t.second); + time += std::format("{} {} ", t.first, t.second); if (t.second == lowestUnitS || t.second == lowestUnitP) { // We have reached the lowest unit the user was interested in break; @@ -166,15 +166,17 @@ void DashboardItemElapsedTime::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_formatString.value()), time) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_formatString.value(), std::make_format_args(time)) ); } else { - std::string time = fmt::format("{} s", delta); + std::string time = std::format("{} s", delta); RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_formatString.value()), time) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_formatString.value(), std::make_format_args(time)) ); } @@ -185,7 +187,10 @@ glm::vec2 DashboardItemElapsedTime::size() const { ZoneScoped; const double delta = global::timeManager->time().j2000Seconds() - _referenceJ2000; - return _font->boundingBox(fmt::format(fmt::runtime(_formatString.value()), delta)); + // @CPP26(abock): This can be replaced with std::runtime_format + return _font->boundingBox( + std::vformat(_formatString.value(), std::make_format_args(delta)) + ); } } // namespace openspace diff --git a/modules/base/dashboard/dashboarditemframerate.cpp b/modules/base/dashboard/dashboarditemframerate.cpp index 51fa1aad01..279c9e200b 100644 --- a/modules/base/dashboard/dashboarditemframerate.cpp +++ b/modules/base/dashboard/dashboarditemframerate.cpp @@ -62,7 +62,7 @@ namespace { }; [[ nodiscard ]] char* formatDt(std::vector& buffer) { - return fmt::format_to( + return std::format_to( buffer.data(), "Avg. Frametime: {:.2f} ms\0", openspace::global::windowDelegate->averageDeltaTime() * 1000.0 @@ -73,7 +73,7 @@ namespace { double minFrametimeCache, double maxFrametimeCache) { - return fmt::format_to( + return std::format_to( buffer.data(), "Last frametimes between: {:.2f} and {:.2f} ms\n" "Overall between: {:.2f} and {:.2f} ms\0", @@ -85,7 +85,7 @@ namespace { } [[ nodiscard ]] char* formatDtStandardDeviation(std::vector& buffer) { - return fmt::format_to( + return std::format_to( buffer.data(), "Frametime standard deviation : {:.2f} ms\0", openspace::global::windowDelegate->deltaTimeStandardDeviation() * 1000.0 @@ -93,7 +93,7 @@ namespace { } [[ nodiscard ]] char* formatDtCoefficientOfVariation(std::vector& buffer) { - return fmt::format_to( + return std::format_to( buffer.data(), "Frametime coefficient of variation : {:.2f} %\0", openspace::global::windowDelegate->deltaTimeStandardDeviation() / @@ -102,7 +102,7 @@ namespace { } [[ nodiscard ]] char* formatFps(std::vector& buffer) { - return fmt::format_to( + return std::format_to( buffer.data(), "FPS: {:3.2f}\0", 1.0 / openspace::global::windowDelegate->deltaTime() @@ -110,7 +110,7 @@ namespace { } [[ nodiscard ]] char* formatAverageFps(std::vector& buffer) { - return fmt::format_to( + return std::format_to( buffer.data(), "Avg. FPS: {:3.2f}\0", 1.0 / openspace::global::windowDelegate->averageDeltaTime() diff --git a/modules/base/dashboard/dashboarditemmission.cpp b/modules/base/dashboard/dashboarditemmission.cpp index 8fb771448c..bd6c589e5d 100644 --- a/modules/base/dashboard/dashboarditemmission.cpp +++ b/modules/base/dashboard/dashboarditemmission.cpp @@ -107,7 +107,7 @@ void DashboardItemMission::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format("{:.0f} s {:s} {:.1f} %", remaining, progress, t * 100), + std::format("{:.0f} s {:s} {:.1f} %", remaining, progress, t * 100), missionProgressColor ); } @@ -119,7 +119,7 @@ void DashboardItemMission::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format("{:.0f} s", remaining), + std::format("{:.0f} s", remaining), nextMissionColor ); } @@ -148,7 +148,7 @@ void DashboardItemMission::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format( + std::format( "{:s} {:s} {:.1f} %", phase->name(),progress,t * 100 ), diff --git a/modules/base/dashboard/dashboarditemparallelconnection.cpp b/modules/base/dashboard/dashboarditemparallelconnection.cpp index 22d3b6f4ce..7e475b2e14 100644 --- a/modules/base/dashboard/dashboarditemparallelconnection.cpp +++ b/modules/base/dashboard/dashboarditemparallelconnection.cpp @@ -68,8 +68,8 @@ void DashboardItemParallelConnection::render(glm::vec2& penPosition) { connectionInfo = (nClients == 1) ? - fmt::format(Singular, nClients) : - fmt::format(Plural, nClients); + std::format(Singular, nClients) : + std::format(Plural, nClients); } else if (status == ParallelConnection::Status::ClientWithHost) { nClients--; @@ -86,11 +86,11 @@ void DashboardItemParallelConnection::render(glm::vec2& penPosition) { if (nClients > 2) { constexpr std::string_view Plural = "You and {} more clients are tuned in"; - connectionInfo += fmt::format(Plural, nClients - 1); + connectionInfo += std::format(Plural, nClients - 1); } else if (nClients == 2) { constexpr std::string_view Singular = "You and {} more client are tuned in"; - connectionInfo += fmt::format(Singular, nClients - 1); + connectionInfo += std::format(Singular, nClients - 1); } else if (nClients == 1) { connectionInfo += "You are the only client"; @@ -120,7 +120,7 @@ glm::vec2 DashboardItemParallelConnection::size() const { connectionInfo = "Hosting session with 1 client"; } else { - connectionInfo = fmt::format("Hosting session with {} clients", nClients); + connectionInfo = std::format("Hosting session with {} clients", nClients); } } else if (status == ParallelConnection::Status::ClientWithHost) { @@ -137,11 +137,11 @@ glm::vec2 DashboardItemParallelConnection::size() const { connectionInfo += "\n"; if (nClients > 2) { constexpr std::string_view Plural = "You and {} more clients are tuned in"; - connectionInfo += fmt::format(Plural, nClients); + connectionInfo += std::format(Plural, nClients); } else if (nClients == 2) { constexpr std::string_view Singular = "You and {} more client are tuned in"; - connectionInfo += fmt::format(Singular, nClients - 1); + connectionInfo += std::format(Singular, nClients - 1); } else if (nClients == 1) { connectionInfo += "You are the only client"; diff --git a/modules/base/dashboard/dashboarditempropertyvalue.cpp b/modules/base/dashboard/dashboarditempropertyvalue.cpp index 0846e8c680..49f48920a5 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.cpp +++ b/modules/base/dashboard/dashboarditempropertyvalue.cpp @@ -124,7 +124,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), value) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(value)) ); } else if (type == "FloatProperty") { @@ -132,7 +133,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), value) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(value)) ); } else if (type == "IntProperty") { @@ -140,7 +142,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), value) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(value)) ); } else if (type == "LongProperty") { @@ -148,7 +151,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), value) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(value)) ); } else if (type == "ShortProperty") { @@ -156,7 +160,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), value) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(value)) ); } else if (type == "UIntProperty") { @@ -164,7 +169,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v)) ); } else if (type == "ULongProperty") { @@ -172,7 +178,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v)) ); } else if (type == "UShortProperty") { @@ -181,7 +188,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v)) ); } else if (type == "DVec2Property") { @@ -189,7 +197,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y)) ); } else if (type == "DVec3Property") { @@ -197,7 +206,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y, v.z)) ); } else if (type == "DVec4Property") { @@ -205,7 +215,11 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z, v.w) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat( + _displayString.value(), + std::make_format_args(v.x, v.y, v.z, v.w) + ) ); } else if (type == "IVec2Property") { @@ -213,7 +227,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y)) ); } else if (type == "IVec3Property") { @@ -221,7 +236,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y, v.z)) ); } else if (type == "IVec4Property") { @@ -229,7 +245,11 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z, v.w) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat( + _displayString.value(), + std::make_format_args(v.x, v.y, v.z, v.w) + ) ); } else if (type == "UVec2Property") { @@ -237,7 +257,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y)) ); } else if (type == "UVec3Property") { @@ -245,7 +266,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y, v.z)) ); } else if (type == "UVec4Property") { @@ -253,7 +275,11 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z, v.w) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat( + _displayString.value(), + std::make_format_args(v.x, v.y, v.z, v.w) + ) ); } else if (type == "Vec2Property") { @@ -261,7 +287,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y)) ); } else if (type == "Vec3Property") { @@ -269,7 +296,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(v.x, v.y, v.z)) ); } else if (type == "Vec4Property") { @@ -277,7 +305,11 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), v.x, v.y, v.z, v.w) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat( + _displayString.value(), + std::make_format_args(v.x, v.y, v.z, v.w) + ) ); } else { @@ -287,7 +319,8 @@ void DashboardItemPropertyValue::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(fmt::runtime(_displayString.value()), value) + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat(_displayString.value(), std::make_format_args(value)) ); } diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index c8193215ab..3707c7ce08 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -195,11 +195,14 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format( - fmt::runtime(_transitionFormat.value()), - targetDeltaTime.first, targetDeltaTime.second, - pauseText, - currentDeltaTime.first, currentDeltaTime.second + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat( + _transitionFormat.value(), + std::make_format_args( + targetDeltaTime.first, targetDeltaTime.second, + pauseText, + currentDeltaTime.first, currentDeltaTime.second + ) ) ); } @@ -207,14 +210,19 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format( - fmt::runtime(_regularFormat.value()), - targetDeltaTime.first, targetDeltaTime.second, pauseText + // @CPP26(abock): This can be replaced with std::runtime_format + std::vformat( + _regularFormat.value(), + std::make_format_args( + targetDeltaTime.first, + targetDeltaTime.second, + pauseText + ) ) ); } } - catch (const fmt::format_error&) { + catch (const std::format_error&) { LERRORC("DashboardItemDate", "Illegal format string"); } penPosition.y -= _font->height(); @@ -238,7 +246,7 @@ glm::vec2 DashboardItemSimulationIncrement::size() const { } return _font->boundingBox( - fmt::format( + std::format( "Simulation increment: {:.1f} {:s} / second", deltaTime.first, deltaTime.second ) diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index fdf99a67c5..bea74ca374 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -145,9 +145,7 @@ void DashboardItemVelocity::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format( - "Camera velocity: {:.4f} {}/s", dist.first, dist.second - ) + std::format("Camera velocity: {:.4f} {}/s", dist.first, dist.second) ); penPosition.y -= _font->height(); @@ -169,7 +167,7 @@ glm::vec2 DashboardItemVelocity::size() const { } return _font->boundingBox( - fmt::format("Camera velocity: {} {}/s", dist.first, dist.second) + std::format("Camera velocity: {} {}/s", dist.first, dist.second) ); } diff --git a/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp b/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp index e7ed5c5d39..138bc24391 100644 --- a/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp +++ b/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp @@ -181,7 +181,7 @@ RenderableInterpolatedPoints::Interpolation::Interpolation() addProperty(value); auto triggerInterpolation = [](std::string_view identifier, float v, float d) { - std::string script = fmt::format( + std::string script = std::format( "openspace.setPropertyValueSingle(\"{}\", {}, {})", identifier, v, d ); @@ -275,7 +275,7 @@ RenderableInterpolatedPoints::RenderableInterpolatedPoints( // corresponded to if (_nDataPoints % nObjects != 0) { - LERROR(fmt::format( + LERROR(std::format( "Mismatch between provided number of data entries and the specified number " "of points. Expected the number of entries in the data file '{}' to be " "evenly divisible by the number of points", _dataFile @@ -445,11 +445,11 @@ void RenderableInterpolatedPoints::addColorAndSizeDataForPoint(unsigned int inde void RenderableInterpolatedPoints::initializeBufferData() { if (_vao == 0) { glGenVertexArrays(1, &_vao); - LDEBUG(fmt::format("Generating Vertex Array id '{}'", _vao)); + LDEBUG(std::format("Generating Vertex Array id '{}'", _vao)); } if (_vbo == 0) { glGenBuffers(1, &_vbo); - LDEBUG(fmt::format("Generating Vertex Buffer Object id '{}'", _vbo)); + LDEBUG(std::format("Generating Vertex Buffer Object id '{}'", _vbo)); } const int attibutesPerPoint = nAttributesPerPoint(); diff --git a/modules/base/rendering/pointcloud/renderablepointcloud.cpp b/modules/base/rendering/pointcloud/renderablepointcloud.cpp index 3d03a94a56..f2ab0ff57c 100644 --- a/modules/base/rendering/pointcloud/renderablepointcloud.cpp +++ b/modules/base/rendering/pointcloud/renderablepointcloud.cpp @@ -635,7 +635,7 @@ RenderablePointCloud::RenderablePointCloud(const ghoul::Dictionary& dictionary) _texturesDirectory = absPath(*t.folder).string(); if (t.file.has_value()) { - LWARNING(fmt::format( + LWARNING(std::format( "Both a single texture File and multi-texture Folder was provided. " "The folder '{}' has priority and the single texture with the " "following path will be ignored: '{}'", *t.folder, *t.file @@ -842,7 +842,7 @@ void RenderablePointCloud::initializeSingleTexture() { std::filesystem::path p = absPath(_texture.spriteTexturePath); if (!std::filesystem::is_regular_file(p)) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find image file '{}'", p )); } @@ -856,7 +856,7 @@ void RenderablePointCloud::initializeMultiTextures() { std::filesystem::path path = _texturesDirectory / tex.file; if (!std::filesystem::is_regular_file(path)) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find image file '{}'", path )); } @@ -899,14 +899,14 @@ void RenderablePointCloud::loadTexture(const std::filesystem::path& path, int in bool useAlpha = (t->numberOfChannels() > 3) && _texture.useAlphaChannel; if (t) { - LINFOC("RenderablePlanesCloud", fmt::format("Loaded texture {}", path)); + LINFOC("RenderablePlanesCloud", std::format("Loaded texture {}", path)); // Do not upload the loaded texture to the GPU, we just want it to hold the data. // However, convert textures make sure they all use the same format ghoul::opengl::Texture::Format targetFormat = glFormat(useAlpha); convertTextureFormat(*t, targetFormat); } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find image file {}", path )); } @@ -1024,7 +1024,7 @@ void RenderablePointCloud::generateArrayTextures() { int nMaxTextureLayers = 0; glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &nMaxTextureLayers); if (static_cast(layer) > nMaxTextureLayers) { - LERROR(fmt::format( + LERROR(std::format( "Too many layers bound in the same texture array. Found {} textures with " "resolution {}x{} pixels. Max supported is {}.", layer, res.x, res.y, nMaxTextureLayers @@ -1333,11 +1333,11 @@ void RenderablePointCloud::updateBufferData() { if (_vao == 0) { glGenVertexArrays(1, &_vao); - LDEBUG(fmt::format("Generating Vertex Array id '{}'", _vao)); + LDEBUG(std::format("Generating Vertex Array id '{}'", _vao)); } if (_vbo == 0) { glGenBuffers(1, &_vbo); - LDEBUG(fmt::format("Generating Vertex Buffer Object id '{}'", _vbo)); + LDEBUG(std::format("Generating Vertex Buffer Object id '{}'", _vbo)); } glBindVertexArray(_vao); diff --git a/modules/base/rendering/pointcloud/sizemappingcomponent.cpp b/modules/base/rendering/pointcloud/sizemappingcomponent.cpp index a69d580d3e..df57fc143c 100644 --- a/modules/base/rendering/pointcloud/sizemappingcomponent.cpp +++ b/modules/base/rendering/pointcloud/sizemappingcomponent.cpp @@ -119,7 +119,7 @@ SizeMappingComponent::SizeMappingComponent(const ghoul::Dictionary& dictionary) parameterOption = indexOfProvidedOption; } else if (p.parameter.has_value()) { - LERROR(fmt::format( + LERROR(std::format( "Error when reading Parameter. Could not find provided parameter '{}' in " "list of parameter options. Using default.", *p.parameter )); diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 6f7a1fa0f7..8ef6682a6b 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -357,7 +357,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) _file = absPath(p.geometryFile.string()); if (!std::filesystem::exists(_file)) { - throw ghoul::RuntimeError(fmt::format("Cannot find model file '{}'", _file)); + throw ghoul::RuntimeError(std::format("Cannot find model file '{}'", _file)); } _invertModelScale = p.invertModelScale.value_or(_invertModelScale); @@ -469,7 +469,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) _modelScale.onChange([this]() { if (!_geometry) { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot set scale for model '{}': not loaded yet", _file )); return; @@ -487,12 +487,12 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) _enableAnimation.onChange([this]() { if (!_modelHasAnimation) { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot enable animation for model '{}': it does not have any", _file )); } else if (_enableAnimation && _animationStart.empty()) { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot enable animation for model '{}': it does not have a start time", _file )); @@ -500,7 +500,7 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) } else { if (!_geometry) { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot enable animation for model '{}': not loaded yet", _file )); return; @@ -560,13 +560,13 @@ void RenderableModel::initializeGL() { if (!_modelHasAnimation) { if (!_animationStart.empty()) { - LWARNING(fmt::format( + LWARNING(std::format( "Animation start time given to model '{}' without animation", _file )); } if (_enableAnimation) { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot enable animation for model '{}': it does not have any", _file )); _enableAnimation = false; @@ -576,13 +576,13 @@ void RenderableModel::initializeGL() { } else { if (_enableAnimation && _animationStart.empty()) { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot enable animation for model '{}': it does not have a start time", _file )); } else if (!_enableAnimation) { - LINFO(fmt::format( + LINFO(std::format( "Model '{}' with deactivated animation was found. The animation can be " "activated by entering a start time in the asset file", _file )); diff --git a/modules/base/rendering/renderablenodearrow.cpp b/modules/base/rendering/renderablenodearrow.cpp index 6b4ff18b9e..43a37c69fd 100644 --- a/modules/base/rendering/renderablenodearrow.cpp +++ b/modules/base/rendering/renderablenodearrow.cpp @@ -228,7 +228,7 @@ namespace { SceneGraphNode* startNode = sceneGraphNode(nodeName); if (!startNode) { - LERROR(fmt::format("Could not find start node '{}'", nodeName)); + LERROR(std::format("Could not find start node '{}'", nodeName)); return; } const double boundingSphere = startNode->boundingSphere(); @@ -242,7 +242,7 @@ namespace { else { // Recompute distance (previous value was in meters) if (boundingSphere < std::numeric_limits::epsilon()) { - LERROR(fmt::format( + LERROR(std::format( "Start node '{}' has invalid bounding sphere", nodeName )); return; @@ -383,12 +383,12 @@ void RenderableNodeArrow::updateShapeTransforms(const RenderData& data) { SceneGraphNode* endNode = sceneGraphNode(_end); if (!startNode) { - LERROR(fmt::format("Could not find start node '{}'", _start.value())); + LERROR(std::format("Could not find start node '{}'", _start.value())); return; } if (!endNode) { - LERROR(fmt::format("Could not find end node '{}'", _end.value())); + LERROR(std::format("Could not find end node '{}'", _end.value())); return; } @@ -397,7 +397,7 @@ void RenderableNodeArrow::updateShapeTransforms(const RenderData& data) { boundingSphere < std::numeric_limits::epsilon(); if (hasNoBoundingSphere && (_useRelativeLength || _useRelativeOffset)) { - LERROR(fmt::format( + LERROR(std::format( "Node '{}' has no valid bounding sphere. Can not use relative values", _end.value() )); diff --git a/modules/base/rendering/renderablenodeline.cpp b/modules/base/rendering/renderablenodeline.cpp index 68a39ed79e..b48f8b04d1 100644 --- a/modules/base/rendering/renderablenodeline.cpp +++ b/modules/base/rendering/renderablenodeline.cpp @@ -181,7 +181,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary) if (!node || node->boundingSphere() > 0.0) { return; } - LWARNING(fmt::format( + LWARNING(std::format( "Setting StartOffset for node line '{}': Trying to use relative offsets " "for start node '{}' that has no bounding sphere. This will result in no " "offset. Use direct values by setting UseRelativeOffsets to false", @@ -198,7 +198,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary) if (!node || node->boundingSphere() > 0.0) { return; } - LWARNING(fmt::format( + LWARNING(std::format( "Setting EndOffset for node line '{}': Trying to use relative offsets " "for end node '{}' that has no bounding sphere. This will result in no " "offset. Use direct values by setting UseRelativeOffsets to false", @@ -213,7 +213,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary) SceneGraphNode* endNode = global::renderEngine->scene()->sceneGraphNode(_end); if (!startNode) { - LERROR(fmt::format( + LERROR(std::format( "Error when recomputing node line offsets for scene graph node '{}'. " "Could not find start node '{}'", parent()->identifier(), _start.value() )); @@ -221,7 +221,7 @@ RenderableNodeLine::RenderableNodeLine(const ghoul::Dictionary& dictionary) } if (!endNode) { - LERROR(fmt::format( + LERROR(std::format( "Error when recomputing node line offsets for scene graph node '{}'. " "Could not find end node '{}'", parent()->identifier(), _end.value() )); @@ -310,12 +310,12 @@ void RenderableNodeLine::updateVertexData() { SceneGraphNode* endNode = global::renderEngine->scene()->sceneGraphNode(_end); if (!startNode) { - LERROR(fmt::format("Could not find start node '{}'", _start.value())); + LERROR(std::format("Could not find start node '{}'", _start.value())); return; } if (!endNode) { - LERROR(fmt::format("Could not find end node '{}'", _end.value())); + LERROR(std::format("Could not find end node '{}'", _end.value())); return; } diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index 122c232e7d..9066e74764 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -175,7 +175,7 @@ void RenderablePlaneImageLocal::loadTexture() { LDEBUGC( "RenderablePlaneImageLocal", - fmt::format("Loaded texture from '{}'", absPath(path)) + std::format("Loaded texture from '{}'", absPath(path)) ); texture->uploadTexture(); texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap); diff --git a/modules/base/rendering/renderableplaneimageonline.cpp b/modules/base/rendering/renderableplaneimageonline.cpp index 88d2d89db3..142542c671 100644 --- a/modules/base/rendering/renderableplaneimageonline.cpp +++ b/modules/base/rendering/renderableplaneimageonline.cpp @@ -133,7 +133,7 @@ void RenderablePlaneImageOnline::update(const UpdateData& data) { if (imageFile.corrupted) { LERRORC( "ScreenSpaceImageOnline", - fmt::format("Error loading image from URL '{}'", _texturePath.value()) + std::format("Error loading image from URL '{}'", _texturePath.value()) ); return; } diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index c41ebb4b7a..ed6dc0e92a 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -96,7 +96,7 @@ RenderablePlaneTimeVaryingImage::RenderablePlaneTimeVaryingImage( _sourceFolder = p.sourceFolder; if (!std::filesystem::is_directory(absPath(_sourceFolder))) { - LERROR(fmt::format( + LERROR(std::format( "Time varying image, '{}' is not a valid directory", _sourceFolder.value() )); @@ -174,7 +174,7 @@ bool RenderablePlaneTimeVaryingImage::extractMandatoryInfoFromDictionary() { std::sort(_sourceFiles.begin(), _sourceFiles.end()); // Ensure that there are available and valid source files left if (_sourceFiles.empty()) { - LERROR(fmt::format( + LERROR(std::format( "{}: Plane sequence filepath '{}' was empty", _identifier, _sourceFolder.value() )); diff --git a/modules/base/rendering/renderablesphereimagelocal.cpp b/modules/base/rendering/renderablesphereimagelocal.cpp index e68de2767a..7740aa4ab0 100644 --- a/modules/base/rendering/renderablesphereimagelocal.cpp +++ b/modules/base/rendering/renderablesphereimagelocal.cpp @@ -117,14 +117,14 @@ void RenderableSphereImageLocal::loadTexture() { if (!texture) { LWARNINGC( "RenderableSphereImageLocal", - fmt::format("Could not load texture from '{}'", absPath(_texturePath)) + std::format("Could not load texture from '{}'", absPath(_texturePath)) ); return; } LDEBUGC( "RenderableSphereImageLocal", - fmt::format("Loaded texture from '{}'", absPath(_texturePath)) + std::format("Loaded texture from '{}'", absPath(_texturePath)) ); texture->uploadTexture(); texture->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap); diff --git a/modules/base/rendering/renderablesphereimageonline.cpp b/modules/base/rendering/renderablesphereimageonline.cpp index a4b5c64397..bf2757bdc1 100644 --- a/modules/base/rendering/renderablesphereimageonline.cpp +++ b/modules/base/rendering/renderablesphereimageonline.cpp @@ -53,13 +53,13 @@ namespace { [url](const DownloadManager::MemoryFile&) { LDEBUGC( "RenderableSphereImageOnline", - fmt::format("Download to memory finished for image '{}'", url) + std::format("Download to memory finished for image '{}'", url) ); }, [url](const std::string& err) { LDEBUGC( "RenderableSphereImageOnline", - fmt::format("Download to memory failed for image '{}': {}", url, err) + std::format("Download to memory failed for image '{}': {}", url, err) ); } ); @@ -120,7 +120,7 @@ void RenderableSphereImageOnline::update(const UpdateData& data) { if (imageFile.corrupted) { LERRORC( "RenderableSphereImageOnline", - fmt::format("Error loading image from URL '{}'", _textureUrl.value()) + std::format("Error loading image from URL '{}'", _textureUrl.value()) ); return; } diff --git a/modules/base/rendering/screenspaceimagelocal.cpp b/modules/base/rendering/screenspaceimagelocal.cpp index e9e361ece7..504f6db33f 100644 --- a/modules/base/rendering/screenspaceimagelocal.cpp +++ b/modules/base/rendering/screenspaceimagelocal.cpp @@ -85,7 +85,7 @@ ScreenSpaceImageLocal::ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary if (!std::filesystem::is_regular_file(absPath(_texturePath))) { LWARNINGC( "ScreenSpaceImageLocal", - fmt::format( + std::format( "Image '{}' did not exist for '{}'", _texturePath.value(), _identifier ) ); @@ -103,7 +103,7 @@ ScreenSpaceImageLocal::ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary else { LWARNINGC( "ScreenSpaceImageLocal", - fmt::format( + std::format( "Image '{}' did not exist for '{}'", *p.texturePath, _identifier ) ); diff --git a/modules/base/rendering/screenspaceimageonline.cpp b/modules/base/rendering/screenspaceimageonline.cpp index c804a8fed0..a7b6ac55dc 100644 --- a/modules/base/rendering/screenspaceimageonline.cpp +++ b/modules/base/rendering/screenspaceimageonline.cpp @@ -110,7 +110,7 @@ void ScreenSpaceImageOnline::update() { if (imageFile.corrupted) { LERRORC( "ScreenSpaceImageOnline", - fmt::format("Error loading image from URL '{}'", _texturePath.value()) + std::format("Error loading image from URL '{}'", _texturePath.value()) ); return; } diff --git a/modules/base/rotation/fixedrotation.cpp b/modules/base/rotation/fixedrotation.cpp index d546486fa2..a176e16cca 100644 --- a/modules/base/rotation/fixedrotation.cpp +++ b/modules/base/rotation/fixedrotation.cpp @@ -530,7 +530,7 @@ glm::dmat3 FixedRotation::matrix(const UpdateData&) const { { LWARNINGC( "FixedRotation", - fmt::format( + std::format( "Near-collinear vectors detected: " "x ({}, {}, {}) y ({}, {}, {}) z ({}, {}, {})", x.x, x.y, x.z, y.x, y.y, y.z, z.x, z.y, z.z diff --git a/modules/base/rotation/luarotation.cpp b/modules/base/rotation/luarotation.cpp index cfcad65f20..b7937c1eac 100644 --- a/modules/base/rotation/luarotation.cpp +++ b/modules/base/rotation/luarotation.cpp @@ -89,7 +89,7 @@ glm::dmat3 LuaRotation::matrix(const UpdateData& data) const { if (!isFunction) { LERRORC( "LuaRotation", - fmt::format( + std::format( "Script '{}' does not have a function 'rotation'", _luaScriptFile.value() ) ); @@ -112,7 +112,7 @@ glm::dmat3 LuaRotation::matrix(const UpdateData& data) const { if (success != 0) { LERRORC( "LuaScale", - fmt::format("Error executing 'rotation': {}", lua_tostring(_state, -1)) + std::format("Error executing 'rotation': {}", lua_tostring(_state, -1)) ); } diff --git a/modules/base/scale/luascale.cpp b/modules/base/scale/luascale.cpp index 466467db4d..5a0e994fd6 100644 --- a/modules/base/scale/luascale.cpp +++ b/modules/base/scale/luascale.cpp @@ -87,7 +87,7 @@ glm::dvec3 LuaScale::scaleValue(const UpdateData& data) const { if (!isFunction) { LERRORC( "LuaScale", - fmt::format( + std::format( "Script '{}' does not have a function 'scale'", _luaScriptFile.value() ) ); @@ -110,7 +110,7 @@ glm::dvec3 LuaScale::scaleValue(const UpdateData& data) const { if (success != 0) { LERRORC( "LuaScale", - fmt::format("Error executing 'scale': {}", lua_tostring(_state, -1)) + std::format("Error executing 'scale': {}", lua_tostring(_state, -1)) ); } diff --git a/modules/base/translation/luatranslation.cpp b/modules/base/translation/luatranslation.cpp index 7a790c4a03..986135f156 100644 --- a/modules/base/translation/luatranslation.cpp +++ b/modules/base/translation/luatranslation.cpp @@ -91,7 +91,7 @@ glm::dvec3 LuaTranslation::position(const UpdateData& data) const { if (!isFunction) { LERRORC( "LuaScale", - fmt::format( + std::format( "Script '{}' does not have a function 'translation'", _luaScriptFile.value() ) @@ -115,7 +115,7 @@ glm::dvec3 LuaTranslation::position(const UpdateData& data) const { if (success != 0) { LERRORC( "LuaScale", - fmt::format("Error executing 'translation': {}", lua_tostring(_state, -1)) + std::format("Error executing 'translation': {}", lua_tostring(_state, -1)) ); } diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 30c9023f79..944bde0782 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -102,7 +102,7 @@ void CefWebGuiModule::startOrStopGui() { const bool isMaster = global::windowDelegate->isMaster(); if (_enabled && isMaster) { - LDEBUGC("WebBrowser", fmt::format("Loading GUI from '{}'", _url.value())); + LDEBUGC("WebBrowser", std::format("Loading GUI from '{}'", _url.value())); if (!_instance) { _instance = std::make_unique( diff --git a/modules/debugging/debuggingmodule_lua.inl b/modules/debugging/debuggingmodule_lua.inl index ac83715d8a..06d543cc1e 100644 --- a/modules/debugging/debuggingmodule_lua.inl +++ b/modules/debugging/debuggingmodule_lua.inl @@ -56,7 +56,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); // Parent node. Note that we only render one path at a time, so remove the previously // rendered one, if any - std::string addParentScript = fmt::format( + std::string addParentScript = std::format( "if openspace.hasSceneGraphNode('{0}') then " "openspace.removeSceneGraphNode('{0}') " "end " @@ -82,7 +82,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); // Create node lines between the positions auto pointIdentifier = [](int i) { - return fmt::format("Point_{}", i); + return std::format("Point_{}", i); }; auto addPoint = [](const std::string& id, glm::dvec3 p) { @@ -98,7 +98,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); "}"; global::scriptEngine->queueScript( - fmt::format("openspace.addSceneGraphNode({})", pointNode), + std::format("openspace.addSceneGraphNode({})", pointNode), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); @@ -108,7 +108,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); const glm::vec3& color, float lineWidth) { const std::string lineNode = "{" - "Identifier = '" + fmt::format("Line{}", id1) + "'," + "Identifier = '" + std::format("Line{}", id1) + "'," "Parent = '" + RenderedPathIdentifier + "'," "Renderable = {" "Enabled = true," @@ -121,7 +121,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); "}"; global::scriptEngine->queueScript( - fmt::format("openspace.addSceneGraphNode({})", lineNode), + std::format("openspace.addSceneGraphNode({})", lineNode), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); @@ -133,7 +133,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); { const glm::dvec3 dir = glm::normalize(p.rotation * glm::dvec3(0.0, 0.0, -1.0)); const glm::dvec3 pointPosition = p.position + lineLength * dir; - const std::string id = fmt::format("{}_orientation", pointId); + const std::string id = std::format("{}_orientation", pointId); addPoint(id, pointPosition); addLineBetweenPoints(id, pointId, OrientationLineColor, 2.f); @@ -159,7 +159,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); [[codegen::luawrap]] void removeRenderedCameraPath() { using namespace openspace; global::scriptEngine->queueScript( - fmt::format("openspace.removeSceneGraphNode('{}');", RenderedPathIdentifier), + std::format("openspace.removeSceneGraphNode('{}');", RenderedPathIdentifier), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); @@ -183,7 +183,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); // Parent node. Note that we only render one set of points at a time, so remove any // previously rendered ones - std::string addParentScript = fmt::format( + std::string addParentScript = std::format( "if openspace.hasSceneGraphNode('{0}') then " "openspace.removeSceneGraphNode('{0}') " "end " @@ -200,7 +200,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); const std::vector points = currentPath->controlPoints(); const std::string guiPath = - fmt::format("{}/Camera Path Control Points", DebuggingGuiPath); + std::format("{}/Camera Path Control Points", DebuggingGuiPath); const char* colorTexturePath = "openspace.absPath(" "openspace.createSingleColorImage('point_color', { 0.0, 1.0, 0.0 })" @@ -230,7 +230,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); "}"; global::scriptEngine->queueScript( - fmt::format("openspace.addSceneGraphNode({})", node), + std::format("openspace.addSceneGraphNode({})", node), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); @@ -241,7 +241,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); [[codegen::luawrap]] void removePathControlPoints() { using namespace openspace; global::scriptEngine->queueScript( - fmt::format("openspace.removeSceneGraphNode('{}');", RenderedPointsIdentifier), + std::format("openspace.removeSceneGraphNode('{}');", RenderedPointsIdentifier), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); @@ -297,7 +297,7 @@ constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); "}"; global::scriptEngine->queueScript( - fmt::format("openspace.addSceneGraphNode({});", axes), + std::format("openspace.addSceneGraphNode({});", axes), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 13e99aa896..4a81521c28 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -448,7 +448,7 @@ void RenderableDUMeshes::update(const UpdateData&) { bool RenderableDUMeshes::loadData() { bool success = false; if (_hasSpeckFile) { - LINFO(fmt::format("Loading Speck file '{}'", _speckFile)); + LINFO(std::format("Loading Speck file '{}'", _speckFile)); success = readSpeckFile(); if (!success) { return false; @@ -466,7 +466,7 @@ bool RenderableDUMeshes::loadData() { bool RenderableDUMeshes::readSpeckFile() { std::ifstream file(_speckFile); if (!file.good()) { - LERROR(fmt::format("Failed to open Speck file '{}'", _speckFile)); + LERROR(std::format("Failed to open Speck file '{}'", _speckFile)); return false; } @@ -576,7 +576,7 @@ bool RenderableDUMeshes::readSpeckFile() { } if (!success) { - LERROR(fmt::format( + LERROR(std::format( "Failed reading position on line {} of mesh {} in file '{}'. " "Stopped reading mesh data", l, meshIndex, _speckFile )); diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index fb5006e7fa..4316e1876d 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -507,7 +507,7 @@ void RenderablePlanesCloud::loadTextures() { } else { // We can't really recover from this as it would crash during rendering anyway - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find image file '{}'", tex.file )); } @@ -516,14 +516,14 @@ void RenderablePlanesCloud::loadTextures() { ghoul::io::TextureReader::ref().loadTexture(path.string(), 2); if (t) { - LINFOC("RenderablePlanesCloud", fmt::format("Loaded texture '{}'", path)); + LINFOC("RenderablePlanesCloud", std::format("Loaded texture '{}'", path)); t->uploadTexture(); t->setFilter(ghoul::opengl::Texture::FilterMode::LinearMipMap); t->purgeFromRAM(); } else { // Same here, we won't be able to recover from this nullptr - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find image file '{}'", tex.file )); } diff --git a/modules/exoplanets/exoplanetshelper.cpp b/modules/exoplanets/exoplanetshelper.cpp index 120c9571b4..c4c3ebc9d4 100644 --- a/modules/exoplanets/exoplanetshelper.cpp +++ b/modules/exoplanets/exoplanetshelper.cpp @@ -64,7 +64,7 @@ glm::vec3 computeStarColor(float bv) { std::ifstream colorMap(absPath(bvColormapPath), std::ios::in); if (!colorMap.good()) { - LERROR(fmt::format( + LERROR(std::format( "Failed to open colormap data file '{}'", absPath(bvColormapPath) )); return glm::vec3(0.f); diff --git a/modules/exoplanets/exoplanetsmodule.cpp b/modules/exoplanets/exoplanetsmodule.cpp index e713c95154..d26ad79e7a 100644 --- a/modules/exoplanets/exoplanetsmodule.cpp +++ b/modules/exoplanets/exoplanetsmodule.cpp @@ -268,7 +268,7 @@ std::string ExoplanetsModule::exoplanetsDataPath() const { ghoul_assert(hasDataFiles(), "Data files not loaded"); return absPath( - fmt::format("{}/{}", _exoplanetsDataFolder.value(), ExoplanetsDataFileName) + std::format("{}/{}", _exoplanetsDataFolder.value(), ExoplanetsDataFileName) ).string(); } @@ -276,14 +276,14 @@ std::string ExoplanetsModule::lookUpTablePath() const { ghoul_assert(hasDataFiles(), "Data files not loaded"); return absPath( - fmt::format("{}/{}", _exoplanetsDataFolder.value(), LookupTableFileName) + std::format("{}/{}", _exoplanetsDataFolder.value(), LookupTableFileName) ).string(); } std::string ExoplanetsModule::teffToBvConversionFilePath() const { ghoul_assert(hasDataFiles(), "Data files not loaded"); - return absPath(fmt::format( + return absPath(std::format( "{}/{}", _exoplanetsDataFolder.value(), TeffToBvConversionFileName )).string(); } diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index 091c790076..7ae1e275ee 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -53,14 +53,14 @@ openspace::exoplanets::ExoplanetSystem findExoplanetSystemInData( const std::string binPath = module->exoplanetsDataPath(); std::ifstream data(absPath(binPath), std::ios::in | std::ios::binary); if (!data.good()) { - LERROR(fmt::format("Failed to open exoplanets data file '{}'", binPath)); + LERROR(std::format("Failed to open exoplanets data file '{}'", binPath)); return ExoplanetSystem(); } const std::string lutPath = module->lookUpTablePath(); std::ifstream lut(absPath(lutPath)); if (!lut.good()) { - LERROR(fmt::format("Failed to open exoplanets look-up table '{}'", lutPath)); + LERROR(std::format("Failed to open exoplanets look-up table '{}'", lutPath)); return ExoplanetSystem(); } @@ -90,7 +90,7 @@ openspace::exoplanets::ExoplanetSystem findExoplanetSystemInData( sanitizeNameString(name); if (!hasSufficientData(p)) { - LWARNING(fmt::format("Insufficient data for exoplanet '{}'", name)); + LWARNING(std::format("Insufficient data for exoplanet '{}'", name)); continue; } @@ -115,11 +115,11 @@ void createExoplanetSystem(const std::string& starName, std::string sanitizedStarName = starName; sanitizeNameString(sanitizedStarName); - const std::string guiPath = fmt::format("{}{}", ExoplanetsGuiPath, sanitizedStarName); + const std::string guiPath = std::format("{}{}", ExoplanetsGuiPath, sanitizedStarName); SceneGraphNode* existingStarNode = sceneGraphNode(starIdentifier); if (existingStarNode) { - LERROR(fmt::format( + LERROR(std::format( "Adding of exoplanet system '{}' failed. The system has already been added", starName )); @@ -128,7 +128,7 @@ void createExoplanetSystem(const std::string& starName, const glm::vec3 starPosInParsec = system.starData.position; if (!isValidPosition(starPosInParsec)) { - LERROR(fmt::format( + LERROR(std::format( "Insufficient data available for exoplanet system '{}'. Could not determine " "star position", starName )); @@ -560,14 +560,14 @@ std::vector hostStarsWithSufficientData() { const std::string lutPath = module->lookUpTablePath(); std::ifstream lookupTableFile(absPath(lutPath)); if (!lookupTableFile.good()) { - LERROR(fmt::format("Failed to open lookup table file '{}'", lutPath)); + LERROR(std::format("Failed to open lookup table file '{}'", lutPath)); return {}; } const std::string binPath = module->exoplanetsDataPath(); std::ifstream data(absPath(binPath), std::ios::in | std::ios::binary); if (!data.good()) { - LERROR(fmt::format("Failed to open data file '{}'", binPath)); + LERROR(std::format("Failed to open data file '{}'", binPath)); return {}; } @@ -634,7 +634,7 @@ std::vector hostStarsWithSufficientData() { findExoplanetSystemInData(starName); if (systemData.planetsData.empty()) { - LERROR(fmt::format("Exoplanet system '{}' could not be found", starName)); + LERROR(std::format("Exoplanet system '{}' could not be found", starName)); return; } @@ -691,7 +691,7 @@ listOfExoplanetsDeprecated() output.pop_back(); output.pop_back(); - LINFO(fmt::format( + LINFO(std::format( "There is data available for the following {} exoplanet systems: {}", names.size(), output )); @@ -724,7 +724,7 @@ listOfExoplanetsDeprecated() std::ifstream inputDataFile(csvFile); if (!inputDataFile.good()) { - LERROR(fmt::format("Failed to open input file '{}'", csvFile)); + LERROR(std::format("Failed to open input file '{}'", csvFile)); return; } @@ -746,10 +746,10 @@ listOfExoplanetsDeprecated() module->teffToBvConversionFilePath() ); - LINFO(fmt::format("Reading data for planet '{}'", planetData.name)); + LINFO(std::format("Reading data for planet '{}'", planetData.name)); if (!hasSufficientData(planetData.dataEntry)) { - LWARNING(fmt::format( + LWARNING(std::format( "Insufficient data for exoplanet '{}'", planetData.name )); continue; @@ -785,7 +785,7 @@ listOfExoplanetsDeprecated() createExoplanetSystem(hostName, data); } - LINFO(fmt::format( + LINFO(std::format( "Read data for {} exoplanet systems from CSV file: {}. Please wait until " "they are all finished initializing. You may have to reload the user interface.", hostNameToSystemDataMap.size(), csvFile diff --git a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp index d43faba2da..a6b13e56d1 100644 --- a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp +++ b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp @@ -100,7 +100,7 @@ ExoplanetsDataPreparationTask::ExoplanetsDataPreparationTask( } std::string ExoplanetsDataPreparationTask::description() { - return fmt::format( + return std::format( "Extract data about exoplanets from file '{}' and write as bin to '{}'. The data " "file should be a csv version of the Planetary Systems Composite Data from the " "NASA exoplanets archive (https://exoplanetarchive.ipac.caltech.edu/)", @@ -113,7 +113,7 @@ void ExoplanetsDataPreparationTask::perform( { std::ifstream inputDataFile(_inputDataPath); if (!inputDataFile.good()) { - LERROR(fmt::format("Failed to open input file '{}'", _inputDataPath)); + LERROR(std::format("Failed to open input file '{}'", _inputDataPath)); return; } @@ -121,7 +121,7 @@ void ExoplanetsDataPreparationTask::perform( std::ofstream lutFile(_outputLutPath); if (!binFile.good()) { - LERROR(fmt::format("Error when writing to '{}'",_outputBinPath)); + LERROR(std::format("Error when writing to '{}'",_outputBinPath)); if (!std::filesystem::is_directory(_outputBinPath.parent_path())) { LERROR("Output directory does not exist"); } @@ -129,7 +129,7 @@ void ExoplanetsDataPreparationTask::perform( } if (!lutFile.good()) { - LERROR(fmt::format("Error when writing to '{}'", _outputLutPath)); + LERROR(std::format("Error when writing to '{}'", _outputLutPath)); if (!std::filesystem::is_directory(_outputLutPath.parent_path())) { LERROR("Output directory does not exist"); } @@ -156,7 +156,7 @@ void ExoplanetsDataPreparationTask::perform( // containing the data names, again readFirstDataRow(inputDataFile); - LINFO(fmt::format("Loading {} exoplanets", total)); + LINFO(std::format("Loading {} exoplanets", total)); int exoplanetCount = 0; while (std::getline(inputDataFile, row)) { @@ -453,7 +453,7 @@ glm::vec3 ExoplanetsDataPreparationTask::starPosition(const std::string& starNam std::ifstream exoplanetsFile(sourceFile); if (!exoplanetsFile) { - LERROR(fmt::format("Error opening file '{}'", sourceFile)); + LERROR(std::format("Error opening file '{}'", sourceFile)); } std::string line; @@ -499,7 +499,7 @@ float ExoplanetsDataPreparationTask::bvFromTeff(float teff, std::ifstream teffToBvFile(conversionFile); if (!teffToBvFile.good()) { - LERROR(fmt::format("Failed to open file '{}'", conversionFile)); + LERROR(std::format("Failed to open file '{}'", conversionFile)); return std::numeric_limits::quiet_NaN(); } diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index 7f616485b4..f9a019110f 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -125,21 +125,21 @@ RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) setIdentifier(identifier); if (!dictionary.hasValue(KeyVectorField)) { - LERROR(fmt::format("Renderable does not contain a key for '{}'", KeyVectorField)); + LERROR(std::format("Renderable does not contain a key for '{}'", KeyVectorField)); } else { _vectorFieldInfo = dictionary.value(KeyVectorField); } if (!dictionary.hasValue(KeyFieldlines)) { - LERROR(fmt::format("Renderable does not contain a key for '{}'", KeyFieldlines)); + LERROR(std::format("Renderable does not contain a key for '{}'", KeyFieldlines)); } else { _fieldlineInfo = dictionary.value(KeyFieldlines); } if (!dictionary.hasValue(KeySeedPoints)) { - LERROR(fmt::format("Renderable does not contain a key for '{}'", KeySeedPoints)); + LERROR(std::format("Renderable does not contain a key for '{}'", KeySeedPoints)); } else { _seedPointsInfo = dictionary.value(KeySeedPoints); @@ -302,7 +302,7 @@ void RenderableFieldlines::update(const UpdateData&) { fieldlines[j].end() ); } - LDEBUG(fmt::format("Number of vertices: {}", vertexData.size())); + LDEBUG(std::format("Number of vertices: {}", vertexData.size())); if (_fieldlineVAO == 0) { glGenVertexArrays(1, &_fieldlineVAO); @@ -363,11 +363,11 @@ void RenderableFieldlines::loadSeedPoints() { } void RenderableFieldlines::loadSeedPointsFromFile() { - LINFO(fmt::format("Reading seed points from '{}'", _seedPointSourceFile.value())); + LINFO(std::format("Reading seed points from '{}'", _seedPointSourceFile.value())); std::ifstream seedFile(_seedPointSourceFile); if (!seedFile.good()) - LERROR(fmt::format( + LERROR(std::format( "Could not open seed points file '{}'", _seedPointSourceFile.value() )); else { @@ -393,7 +393,7 @@ void RenderableFieldlines::loadSeedPointsFromTable() { ghoul::Dictionary seedpointsDictionary = _seedPointsInfo.value(KeySeedPointsType); for (std::string_view index : seedpointsDictionary.keys()) { - std::string key = fmt::format("{}.{}", KeySeedPointsTable, index); + std::string key = std::format("{}.{}", KeySeedPointsTable, index); // (2020-12-31, abock) Looks to me as if this should be seedpointsDictionary if (_fieldlineInfo.hasValue(key)) { glm::dvec3 seedPos = _fieldlineInfo.value(key); @@ -404,7 +404,7 @@ void RenderableFieldlines::loadSeedPointsFromTable() { std::vector RenderableFieldlines::generateFieldlines() { if (!_vectorFieldInfo.hasValue(KeyVectorFieldType)) { - LERROR(fmt::format( + LERROR(std::format( "'{}' does not contain a '{}' key", KeyVectorField, KeyVectorFieldType )); return {}; @@ -415,7 +415,7 @@ std::vector RenderableFieldlines::generateFieldlines return generateFieldlinesVolumeKameleon(); } else { - LERROR(fmt::format( + LERROR(std::format( "{}.{} does not name a valid type", KeyVectorField, KeyVectorFieldType )); return {}; @@ -426,14 +426,14 @@ std::vector RenderableFieldlines::generateFieldlinesVolumeKameleon() { if (!_vectorFieldInfo.hasValue(KeyVectorFieldVolumeModel)) { - LERROR(fmt::format("'{}' does not name a model", KeyVectorField)); + LERROR(std::format("'{}' does not name a model", KeyVectorField)); return {}; } std::string model = _vectorFieldInfo.value(KeyVectorFieldVolumeModel); if (!_vectorFieldInfo.hasValue(KeyVectorFieldFile)) { - LERROR(fmt::format("'{}' does not name a file", KeyVectorField)); + LERROR(std::format("'{}' does not name a file", KeyVectorField)); return {}; } std::string fileName = _vectorFieldInfo.value(KeyVectorFieldFile); @@ -443,7 +443,7 @@ RenderableFieldlines::generateFieldlinesVolumeKameleon() if (model != VectorFieldKameleonModelBATSRUS) { //modelType = KameleonWrapper::Model::BATSRUS; //else { - LERROR(fmt::format( + LERROR(std::format( "{}.{} model '{}' not supported", KeyVectorField, KeyVectorFieldVolumeModel, model )); @@ -463,7 +463,7 @@ RenderableFieldlines::generateFieldlinesVolumeKameleon() (_vectorFieldInfo.value(v1) == VectorFieldKameleonVariableLorentz); if (!threeVariables && !lorentzForce) { - LERROR(fmt::format("'{}' does not name variables", KeyVectorField)); + LERROR(std::format("'{}' does not name variables", KeyVectorField)); return {}; } diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index 69d5652e8b..f24d90322c 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -369,7 +369,7 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence( } else { _tracingVariable = "b"; // Magnetic field variable as default - LWARNING(fmt::format( + LWARNING(std::format( "No tracing variable, using default '{}'", _tracingVariable )); } @@ -388,7 +388,7 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence( // the files with the same extension as fileTypeString std::filesystem::path sourcePath = p.sourceFolder; if (!std::filesystem::is_directory(sourcePath)) { - LERROR(fmt::format( + LERROR(std::format( "FieldlinesSequence '{}' is not a valid directory", sourcePath )); } @@ -420,7 +420,7 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence( // Ensure that there are available and valid source files left if (_sourceFiles.empty()) { - LERROR(fmt::format( + LERROR(std::format( "'{}' contains no {} files", sourcePath.string(), fileTypeString )); } @@ -490,7 +490,7 @@ RenderableFieldlinesSequence::RenderableFieldlinesSequence( _outputFolderPath = p.outputFolder.value_or(_outputFolderPath); if (!_outputFolderPath.empty() && !std::filesystem::is_directory(_outputFolderPath)) { _outputFolderPath.clear(); - LERROR(fmt::format( + LERROR(std::format( "The specified output path '{}' does not exist", _outputFolderPath )); } @@ -617,7 +617,7 @@ void RenderableFieldlinesSequence::loadOsflsStatesIntoRAM() { } } else { - LWARNING(fmt::format("Failed to load state from '{}'", filePath)); + LWARNING(std::format("Failed to load state from '{}'", filePath)); } } } @@ -851,7 +851,7 @@ std::unordered_map> std::unordered_map> outMap; if (!std::filesystem::is_directory(filePath)) { - LERROR(fmt::format( + LERROR(std::format( "The specified seed point directory '{}' does not exist", filePath )); return outMap; @@ -868,12 +868,12 @@ std::unordered_map> std::ifstream seedFile(seedFilePath); if (!seedFile.good()) { - LERROR(fmt::format("Could not open seed points file '{}'", seedFilePath)); + LERROR(std::format("Could not open seed points file '{}'", seedFilePath)); outMap.clear(); return {}; } - LDEBUG(fmt::format("Reading seed points from file '{}'", seedFilePath)); + LDEBUG(std::format("Reading seed points from file '{}'", seedFilePath)); std::string line; std::vector outVec; while (std::getline(seedFile, line)) { @@ -886,7 +886,7 @@ std::unordered_map> } if (outVec.empty()) { - LERROR(fmt::format("Found no seed points in '{}'", seedFilePath)); + LERROR(std::format("Found no seed points in '{}'", seedFilePath)); outMap.clear(); return {}; } diff --git a/modules/fieldlinessequence/util/fieldlinesstate.cpp b/modules/fieldlinessequence/util/fieldlinesstate.cpp index 571088c3c7..e4e746b62b 100644 --- a/modules/fieldlinessequence/util/fieldlinesstate.cpp +++ b/modules/fieldlinessequence/util/fieldlinesstate.cpp @@ -140,7 +140,7 @@ bool FieldlinesState::loadStateFromJson(const std::string& pathToJsonFile, std::ifstream ifs(pathToJsonFile); if (!ifs.is_open()) { - LERROR(fmt::format("Failed to open file '{}'", pathToJsonFile)); + LERROR(std::format("Failed to open file '{}'", pathToJsonFile)); return false; } @@ -252,7 +252,7 @@ void FieldlinesState::saveStateToOsfls(const std::string& absPath) { std::ofstream ofs(absPath + fileName, std::ofstream::binary | std::ofstream::trunc); if (!ofs.is_open()) { - LERROR(fmt::format( + LERROR(std::format( "Failed to save state to binary file: {}{}", absPath, fileName )); return; @@ -326,12 +326,12 @@ void FieldlinesState::saveStateToJson(const std::string& absPath) { const char* ext = ".json"; std::ofstream ofs(absPath + ext, std::ofstream::trunc); if (!ofs.is_open()) { - LERROR(fmt::format( + LERROR(std::format( "Failed to save state to json file at location: {}{}", absPath, ext )); return; } - LINFO(fmt::format("Saving fieldline state to: {}{}", absPath, ext)); + LINFO(std::format("Saving fieldline state to: {}{}", absPath, ext)); json jColumns = { "x", "y", "z" }; for (const std::string& s : _extraQuantityNames) { @@ -371,7 +371,7 @@ void FieldlinesState::saveStateToJson(const std::string& absPath) { const int indentationSpaces = 2; ofs << std::setw(indentationSpaces) << jFile << std::endl; - LINFO(fmt::format("Saved fieldline state to: {}{}", absPath, ext)); + LINFO(std::format("Saved fieldline state to: {}{}", absPath, ext)); } void FieldlinesState::setModel(fls::Model m) { diff --git a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp index 266fa2a554..86741017dd 100644 --- a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp +++ b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp @@ -311,7 +311,7 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, str = TAsPOverRho; } if (!success) { - LWARNING(fmt::format("Failed to load extra variable '{}'. Ignoring", str)); + LWARNING(std::format("Failed to load extra variable '{}'. Ignoring", str)); extraScalarVars.erase(extraScalarVars.begin() + i); --i; } @@ -349,7 +349,7 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, name = JParallelB; } if (!success) { - LWARNING(fmt::format( + LWARNING(std::format( "Failed to load at least one of the magnitude variables: '{}', '{}', " "'{}'. Removing ability to store corresponding magnitude", s1, s2, s3 @@ -368,7 +368,7 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, else { // WRONG NUMBER OF MAGNITUDE VARIABLES.. REMOVE ALL! extraMagVars.clear(); - LWARNING(fmt::format( + LWARNING(std::format( "Wrong number of variables provided for storing magnitudes. Expects multiple " "of 3 but {} are provided", extraMagVars.size() diff --git a/modules/fitsfilereader/src/fitsfilereader.cpp b/modules/fitsfilereader/src/fitsfilereader.cpp index ec5260afd3..ae905c3940 100644 --- a/modules/fitsfilereader/src/fitsfilereader.cpp +++ b/modules/fitsfilereader/src/fitsfilereader.cpp @@ -185,7 +185,7 @@ std::shared_ptr> FitsFileReader::readTable(const std::filesystem::p } } catch (FitsException& e) { - LERROR(fmt::format( + LERROR(std::format( "Could not read FITS table from file '{}'. Make sure it's not an image file", e.message() )); @@ -248,7 +248,7 @@ std::vector FitsFileReader::readFitsFile(std::filesystem::path filePath, ); if (!table) { - throw ghoul::RuntimeError(fmt::format("Failed to open Fits file '{}'", filePath)); + throw ghoul::RuntimeError(std::format("Failed to open Fits file '{}'", filePath)); } int nStars = table->readRows - firstRow + 1; @@ -385,7 +385,7 @@ std::vector FitsFileReader::readFitsFile(std::filesystem::path filePath, auto table = readTable(filePath, allColumnNames, firstRow, lastRow); if (!table) { - throw ghoul::RuntimeError(fmt::format("Failed to open Fits file '{}'", filePath)); + throw ghoul::RuntimeError(std::format("Failed to open Fits file '{}'", filePath)); } int nStars = table->readRows - firstRow + 1; @@ -517,8 +517,8 @@ std::vector FitsFileReader::readFitsFile(std::filesystem::path filePath, fullData.insert(fullData.end(), values.begin(), values.end()); }*/ - LINFO(fmt::format("{} out of {} read stars were null arrays", nNullArr, nStars)); - LINFO(fmt::format("Multiplier: {}", multiplier)); + LINFO(std::format("{} out of {} read stars were null arrays", nNullArr, nStars)); + LINFO(std::format("Multiplier: {}", multiplier)); return fullData; } @@ -531,7 +531,7 @@ std::vector FitsFileReader::readSpeckFile(const std::filesystem::path& fi std::ifstream fileStream(filePath); if (!fileStream.good()) { - LERROR(fmt::format("Failed to open Speck file '{}'", filePath)); + LERROR(std::format("Failed to open Speck file '{}'", filePath)); return fullData; } @@ -649,7 +649,7 @@ std::vector FitsFileReader::readSpeckFile(const std::filesystem::path& fi } while (!fileStream.eof()); - LINFO(fmt::format("{} out of {} read stars were null arrays", nNullArr, nStars)); + LINFO(std::format("{} out of {} read stars were null arrays", nNullArr, nStars)); return fullData; } diff --git a/modules/gaia/rendering/octreemanager.cpp b/modules/gaia/rendering/octreemanager.cpp index aeca54ea8e..b8c8ea8e8b 100644 --- a/modules/gaia/rendering/octreemanager.cpp +++ b/modules/gaia/rendering/octreemanager.cpp @@ -159,10 +159,10 @@ void OctreeManager::printStarsPerNode() const { const std::string prefix = "{" + std::to_string(i); accumulatedString += printStarsPerNode(*_root->children[i], prefix); } - LINFO(fmt::format("Number of stars per node: \n{}", accumulatedString)); - LINFO(fmt::format("Number of leaf nodes: {}", std::to_string(_numLeafNodes))); - LINFO(fmt::format("Number of inner nodes: {}", std::to_string(_numInnerNodes))); - LINFO(fmt::format("Depth of tree: {}", std::to_string(_totalDepth))); + LINFO(std::format("Number of stars per node: \n{}", accumulatedString)); + LINFO(std::format("Number of leaf nodes: {}", std::to_string(_numLeafNodes))); + LINFO(std::format("Number of inner nodes: {}", std::to_string(_numInnerNodes))); + LINFO(std::format("Depth of tree: {}", std::to_string(_totalDepth))); } void OctreeManager::fetchSurroundingNodes(const glm::dvec3& cameraPos, @@ -426,7 +426,7 @@ std::map> OctreeManager::traverseData(const glm::dmat4& // Uses a reverse loop to try to decrease the biggest chunk if (*removedKey == static_cast(_biggestChunkIndexInUse) - 1) { _biggestChunkIndexInUse = *removedKey; - LDEBUG(fmt::format( + LDEBUG(std::format( "Decreased size to: {} Free Spots in VBO: {}", _biggestChunkIndexInUse, _freeSpotsInBuffer.size() )); @@ -442,7 +442,7 @@ std::map> OctreeManager::traverseData(const glm::dmat4& if ((_biggestChunkIndexInUse > _maxStackSize * 4 / 5) && (_freeSpotsInBuffer.size() > _maxStackSize * 5 / 6)) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Rebuilding VBO. Biggest Chunk: {} 4/5: {} FreeSpotsInVBO: {} 5/6: {}", _biggestChunkIndexInUse, _maxStackSize * 4 / 5, _freeSpotsInBuffer.size(), _maxStackSize * 5 / 6 @@ -521,7 +521,7 @@ std::map> OctreeManager::traverseData(const glm::dmat4& // Clear potential removed keys for both VBO and SSBO _removedKeysInPrevCall.clear(); - LDEBUG(fmt::format( + LDEBUG(std::format( "After rebuilding branch {} - Biggest chunk: {} Free spots in buffer: {}", _traversedBranchesInRenderCall, _biggestChunkIndexInUse, _freeSpotsInBuffer.size() @@ -620,7 +620,7 @@ int OctreeManager::readFromFile(std::ifstream& inFileStream, bool readData, inFileStream.read(reinterpret_cast(&MAX_STARS_PER_NODE), sizeof(int32_t)); inFileStream.read(reinterpret_cast(&MAX_DIST), sizeof(int32_t)); - LDEBUG(fmt::format( + LDEBUG(std::format( "Max stars per node in read Octree: {} - Radius of root layer: {}", MAX_STARS_PER_NODE, MAX_DIST )); @@ -708,7 +708,7 @@ void OctreeManager::writeToMultipleFiles(const std::string& outFolderPath, writeNodeToMultipleFiles(outFilePrefix, *_root->children[branchIndex], false); // Clear all data in branch. - LINFO(fmt::format("Clear all data from branch {} in octree", branchIndex)); + LINFO(std::format("Clear all data from branch {} in octree", branchIndex)); clearNodeData(*_root->children[branchIndex]); } @@ -738,7 +738,7 @@ void OctreeManager::writeNodeToMultipleFiles(const std::string& outFilePrefix, outFileStream.close(); } else { - LERROR(fmt::format("Error opening file '{}' as output data file", outPath)); + LERROR(std::format("Error opening file '{}' as output data file", outPath)); } } @@ -1088,7 +1088,7 @@ std::string OctreeManager::printStarsPerNode(const OctreeNode& node, return str + " - [Leaf] \n"; } else { - str += fmt::format("LOD: {} - [Parent]\n", node.posData.size() / POS_SIZE); + str += std::format("LOD: {} - [Parent]\n", node.posData.size() / POS_SIZE); for (int i = 0; i < 8; i++) { auto pref = prefix + "->" + std::to_string(i); str += printStarsPerNode(*node.children[i], pref); diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index a6d943d28f..c345b1f5f0 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -511,7 +511,7 @@ RenderableGaiaStars::RenderableGaiaStars(const ghoul::Dictionary& dictionary) _dataIsDirty = true; } else { - LWARNING(fmt::format("File not found: {}", _filePath.value())); + LWARNING(std::format("File not found: {}", _filePath.value())); } }); addProperty(_filePath); @@ -597,7 +597,7 @@ RenderableGaiaStars::RenderableGaiaStars(const ghoul::Dictionary& dictionary) if (_ssboData != 0) { glDeleteBuffers(1, &_ssboData); glGenBuffers(1, &_ssboData); - LDEBUG(fmt::format( + LDEBUG(std::format( "Re-generating Data Shader Storage Buffer Object id '{}'", _ssboData )); } @@ -876,7 +876,7 @@ void RenderableGaiaStars::initializeGL() { &nCurrentAvailMemoryInKB ); - LDEBUG(fmt::format( + LDEBUG(std::format( "nDedicatedVidMemoryKB: {} - nTotalMemoryKB: {} - nCurrentAvailMemoryKB: {}", nDedicatedVidMemoryInKB, nTotalMemoryInKB, nCurrentAvailMemoryInKB )); @@ -899,7 +899,7 @@ void RenderableGaiaStars::initializeGL() { 4294967296; _cpuRamBudgetProperty.setMaxValue(static_cast(_cpuRamBudgetInBytes)); - LDEBUG(fmt::format( + LDEBUG(std::format( "GPU Memory Budget (bytes): {} - CPU RAM Budget (bytes): {}", _gpuMemoryBudgetInBytes, _cpuRamBudgetInBytes )); @@ -1755,7 +1755,7 @@ void RenderableGaiaStars::update(const UpdateData&) { removeProperty(_additionalNodes); } - LDEBUG(fmt::format( + LDEBUG(std::format( "Chunk size: {} - Max streaming budget (bytes): {} - Max nodes in stream: {}", _chunkSize, _maxStreamingBudgetInBytes, maxNodesInStream )); @@ -1780,17 +1780,17 @@ void RenderableGaiaStars::update(const UpdateData&) { // Generate SSBO Buffers and bind them. if (_vaoEmpty == 0) { glGenVertexArrays(1, &_vaoEmpty); - LDEBUG(fmt::format("Generating Empty Vertex Array id '{}'", _vaoEmpty)); + LDEBUG(std::format("Generating Empty Vertex Array id '{}'", _vaoEmpty)); } if (_ssboIdx == 0) { glGenBuffers(1, &_ssboIdx); - LDEBUG(fmt::format( + LDEBUG(std::format( "Generating Index Shader Storage Buffer Object id '{}'", _ssboIdx )); } if (_ssboData == 0) { glGenBuffers(1, &_ssboData); - LDEBUG(fmt::format( + LDEBUG(std::format( "Generating Data Shader Storage Buffer Object id '{}'", _ssboData )); } @@ -1870,23 +1870,23 @@ void RenderableGaiaStars::update(const UpdateData&) { // Generate VAO and VBOs if (_vao == 0) { glGenVertexArrays(1, &_vao); - LDEBUG(fmt::format("Generating Vertex Array id '{}'", _vao)); + LDEBUG(std::format("Generating Vertex Array id '{}'", _vao)); } if (_vboPos == 0) { glGenBuffers(1, &_vboPos); - LDEBUG(fmt::format( + LDEBUG(std::format( "Generating Position Vertex Buffer Object id '{}'", _vboPos )); } if (_vboCol == 0) { glGenBuffers(1, &_vboCol); - LDEBUG(fmt::format( + LDEBUG(std::format( "Generating Color Vertex Buffer Object id '{}'", _vboCol )); } if (_vboVel == 0) { glGenBuffers(1, &_vboVel); - LDEBUG(fmt::format( + LDEBUG(std::format( "Generating Velocity Vertex Buffer Object id '{}'", _vboVel )); } @@ -2012,11 +2012,11 @@ void RenderableGaiaStars::update(const UpdateData&) { // Generate VAO and VBO for Quad. if (_vaoQuad == 0) { glGenVertexArrays(1, &_vaoQuad); - LDEBUG(fmt::format("Generating Quad Vertex Array id '{}'", _vaoQuad)); + LDEBUG(std::format("Generating Quad Vertex Array id '{}'", _vaoQuad)); } if (_vboQuad == 0) { glGenBuffers(1, &_vboQuad); - LDEBUG(fmt::format("Generating Quad Vertex Buffer Object id '{}'", _vboQuad)); + LDEBUG(std::format("Generating Quad Vertex Buffer Object id '{}'", _vboQuad)); } // Bind VBO and VAO for Quad rendering. @@ -2058,7 +2058,7 @@ void RenderableGaiaStars::update(const UpdateData&) { // Generate Framebuffer Object and Texture. if (_fbo == 0) { glGenFramebuffers(1, &_fbo); - LDEBUG(fmt::format("Generating Framebuffer Object id '{}'", _fbo)); + LDEBUG(std::format("Generating Framebuffer Object id '{}'", _fbo)); } if (!_fboTexture) { // Generate a new texture and attach it to our FBO. @@ -2106,7 +2106,7 @@ void RenderableGaiaStars::update(const UpdateData&) { ); if (_pointSpreadFunctionTexture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from '{}'", absPath(_pointSpreadFunctionTexturePath) )); _pointSpreadFunctionTexture->uploadTexture(); @@ -2134,7 +2134,7 @@ void RenderableGaiaStars::update(const UpdateData&) { 1 ); if (_colorTexture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from '{}'", absPath(_colorTexturePath) )); _colorTexture->uploadTexture(); @@ -2195,7 +2195,7 @@ bool RenderableGaiaStars::readDataFile() { _octreeManager.initOctree(_cpuRamBudgetInBytes); std::filesystem::path file = absPath(_filePath.value()); - LINFO(fmt::format("Loading data file '{}'", file)); + LINFO(std::format("Loading data file '{}'", file)); switch (fileReaderOption) { case gaia::FileReaderOption::Fits: @@ -2225,7 +2225,7 @@ bool RenderableGaiaStars::readDataFile() { //_octreeManager->printStarsPerNode(); _nRenderedStars.setMaxValue(nReadStars); - LINFO(fmt::format("Dataset contains a total of {} stars", nReadStars)); + LINFO(std::format("Dataset contains a total of {} stars", nReadStars)); _totalDatasetSizeInBytes = nReadStars * (PositionSize + ColorSize + VelocitySize) * 4; return nReadStars > 0; @@ -2303,7 +2303,7 @@ int RenderableGaiaStars::readBinaryRawFile(const std::filesystem::path& filePath fileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' for loading raw binary file", filePath )); return nReadStars; @@ -2321,7 +2321,7 @@ int RenderableGaiaStars::readBinaryOctreeFile(const std::filesystem::path& fileP fileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' for loading binary Octree file", filePath )); return nReadStars; @@ -2342,7 +2342,7 @@ int RenderableGaiaStars::readBinaryOctreeStructureFile( fileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' for loading binary Octree file", indexFile )); return nReadStars; diff --git a/modules/gaia/tasks/constructoctreetask.cpp b/modules/gaia/tasks/constructoctreetask.cpp index 7b5de63695..338d788617 100644 --- a/modules/gaia/tasks/constructoctreetask.cpp +++ b/modules/gaia/tasks/constructoctreetask.cpp @@ -295,7 +295,7 @@ ConstructOctreeTask::ConstructOctreeTask(const ghoul::Dictionary& dictionary) { } std::string ConstructOctreeTask::description() { - return fmt::format( + return std::format( "Read bin file (or files in folder) '{}' and write octree data file (or files) " "into '{}'", _inFileOrFolderPath, _outFileOrFolderPath ); @@ -325,9 +325,9 @@ void ConstructOctreeTask::constructOctreeFromSingleFile( _octreeManager->initOctree(0, _maxDist, _maxStarsPerNode); - LINFO(fmt::format("Reading data file '{}'", _inFileOrFolderPath)); + LINFO(std::format("Reading data file '{}'", _inFileOrFolderPath)); - LINFO(fmt::format( + LINFO(std::format( "MAX DIST: {} - MAX STARS PER NODE: {}", _octreeManager->maxDist(), _octreeManager->maxStarsPerNode() )); @@ -405,16 +405,16 @@ void ConstructOctreeTask::constructOctreeFromSingleFile( inFileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' for loading preprocessed file", _inFileOrFolderPath )); } - LINFO(fmt::format("{} of {} read stars were filtered", nFilteredStars, nTotalStars)); + LINFO(std::format("{} of {} read stars were filtered", nFilteredStars, nTotalStars)); // Slice LOD data before writing to files. _octreeManager->sliceLodData(); - LINFO(fmt::format("Writing octree to '{}'", _outFileOrFolderPath)); + LINFO(std::format("Writing octree to '{}'", _outFileOrFolderPath)); std::ofstream outFileStream(_outFileOrFolderPath, std::ofstream::binary); if (outFileStream.good()) { if (nValues == 0) { @@ -425,7 +425,7 @@ void ConstructOctreeTask::constructOctreeFromSingleFile( outFileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' as output data file", _outFileOrFolderPath )); } @@ -470,7 +470,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( const float processOneFile = 1.f / allInputFiles.size(); - LINFO(fmt::format( + LINFO(std::format( "MAX DIST: {} - MAX STARS PER NODE: {}", _indexOctreeManager->maxDist(), _indexOctreeManager->maxStarsPerNode() )); @@ -479,7 +479,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( std::filesystem::path inFilePath = allInputFiles[idx]; int nStarsInfile = 0; - LINFO(fmt::format("Reading data file '{}'", inFilePath)); + LINFO(std::format("Reading data file '{}'", inFilePath)); std::ifstream inFileStream(inFilePath, std::ifstream::binary); if (inFileStream.good()) { @@ -536,7 +536,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( inFileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' for loading preprocessed file", inFilePath )); } @@ -548,8 +548,8 @@ void ConstructOctreeTask::constructOctreeFromFolder( progressCallback((idx + 1) * processOneFile); nStars += nStarsInfile; - LINFO(fmt::format("Writing {} stars to octree files", nStarsInfile)); - LINFO(fmt::format( + LINFO(std::format("Writing {} stars to octree files", nStarsInfile)); + LINFO(std::format( "Number leaf nodes: {}\n Number inner nodes: {}\n Total depth of tree: {}", _indexOctreeManager->numLeafNodes(), _indexOctreeManager->numInnerNodes(), @@ -567,7 +567,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( writeThreads[idx] = std::move(t); } - LINFO(fmt::format( + LINFO(std::format( "A total of {} stars were read from files and distributed into {} total nodes", nStars, _indexOctreeManager->totalNodes() )); @@ -591,7 +591,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( // " - 5000kPc is " + std::to_string(starsOutside5000)); // Write index file of Octree structure. - std::filesystem::path indexFileOutPath = fmt::format( + std::filesystem::path indexFileOutPath = std::format( "{}/index.bin", _outFileOrFolderPath.string() ); std::ofstream outFileStream(indexFileOutPath, std::ofstream::binary); @@ -602,7 +602,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( outFileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' as index output file", indexFileOutPath )); } diff --git a/modules/gaia/tasks/readfilejob.cpp b/modules/gaia/tasks/readfilejob.cpp index c3f98af875..34e4760bd9 100644 --- a/modules/gaia/tasks/readfilejob.cpp +++ b/modules/gaia/tasks/readfilejob.cpp @@ -59,7 +59,7 @@ void ReadFileJob::execute() { if (!table) { throw ghoul::RuntimeError( - fmt::format("Failed to open Fits file '{}'", _inFilePath + std::format("Failed to open Fits file '{}'", _inFilePath )); } diff --git a/modules/gaia/tasks/readfitstask.cpp b/modules/gaia/tasks/readfitstask.cpp index c13e64014b..dcad2ef70c 100644 --- a/modules/gaia/tasks/readfitstask.cpp +++ b/modules/gaia/tasks/readfitstask.cpp @@ -106,7 +106,7 @@ ReadFitsTask::ReadFitsTask(const ghoul::Dictionary& dictionary) { } std::string ReadFitsTask::description() { - return fmt::format( + return std::format( "Read the specified fits file (or all fits files in specified folder): '{}'\n " "and write raw star data into: '{}'\nAll columns required for default rendering " "and filtering parameters will always be read but user can define additional " @@ -144,7 +144,7 @@ void ReadFitsTask::readSingleFitsFile(const Task::ProgressCallback& progressCall std::ofstream outFileStream(_outFileOrFolderPath, std::ofstream::binary); if (outFileStream.good()) { int32_t nValues = static_cast(fullData.size()); - LINFO(fmt::format( + LINFO(std::format( "Writing {} values to file '{}'", nValues, _outFileOrFolderPath )); LINFO("Number of values per star: " + std::to_string(nValuesPerStar)); @@ -167,7 +167,7 @@ void ReadFitsTask::readSingleFitsFile(const Task::ProgressCallback& progressCall outFileStream.close(); } else { - LERROR(fmt::format( + LERROR(std::format( "Error opening file '{}' as output data file", _outFileOrFolderPath )); } @@ -300,24 +300,24 @@ void ReadFitsTask::readAllFitsFilesFromFolder(const Task::ProgressCallback&) { } } } - LINFO(fmt::format("A total of {} stars were written to binary files", totalStars)); + LINFO(std::format("A total of {} stars were written to binary files", totalStars)); } int ReadFitsTask::writeOctantToFile(const std::vector& octantData, int index, std::vector& isFirstWrite, int nValuesPerStar) { - std::string outPath = fmt::format("{}octant_{}.bin", _outFileOrFolderPath, index); + std::string outPath = std::format("{}octant_{}.bin", _outFileOrFolderPath, index); std::ofstream fileStream(outPath, std::ofstream::binary | std::ofstream::app); if (fileStream.good()) { int32_t nValues = static_cast(octantData.size()); - LINFO(fmt::format("Write {} values to {}", nValues, outPath)); + LINFO(std::format("Write {} values to {}", nValues, outPath)); if (nValues == 0) { LERROR("Error writing file - No values were read from file"); } // If this is the first write then write number of values per star! if (isFirstWrite[index]) { - LINFO(fmt::format("First write for Octant_{}", index)); + LINFO(std::format("First write for Octant_{}", index)); fileStream.write( reinterpret_cast(&nValuesPerStar), sizeof(int32_t) @@ -334,7 +334,7 @@ int ReadFitsTask::writeOctantToFile(const std::vector& octantData, int in return nValues / nValuesPerStar; } else { - LERROR(fmt::format("Error opening file '{}' as output data file", outPath)); + LERROR(std::format("Error opening file '{}' as output data file", outPath)); return 0; } } diff --git a/modules/gaia/tasks/readspecktask.cpp b/modules/gaia/tasks/readspecktask.cpp index f20ecab5b6..915368c986 100644 --- a/modules/gaia/tasks/readspecktask.cpp +++ b/modules/gaia/tasks/readspecktask.cpp @@ -59,7 +59,7 @@ ReadSpeckTask::ReadSpeckTask(const ghoul::Dictionary& dictionary) { } std::string ReadSpeckTask::description() { - return fmt::format( + return std::format( "Read speck file '{}' and write raw star data into '{}'", _inFilePath, _outFilePath ); @@ -95,7 +95,7 @@ void ReadSpeckTask::perform(const Task::ProgressCallback& onProgress) { fileStream.close(); } else { - LERROR(fmt::format("Error opening file '{}' as output data file", _outFilePath)); + LERROR(std::format("Error opening file '{}' as output data file", _outFilePath)); } onProgress(1.f); diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index ddbd8eb497..32ab56f184 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -222,7 +222,7 @@ namespace { std::ofstream fileStream(file, std::ofstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Error opening file '{}' for save cache file", file)); + LERROR(std::format("Error opening file '{}' for save cache file", file)); return; } @@ -361,7 +361,7 @@ void RenderableGalaxy::initialize() { ); const bool hasCachedFile = std::filesystem::is_regular_file(cachedPointsFile); if (hasCachedFile) { - LINFO(fmt::format("Cached file '{}' used for galaxy point file '{}'", + LINFO(std::format("Cached file '{}' used for galaxy point file '{}'", cachedPointsFile, _pointsFilename )); @@ -459,7 +459,7 @@ void RenderableGalaxy::initializeGL() { ); if (_pointSpreadFunctionTexture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from '{}'", absPath(_pointSpreadFunctionTexturePath) )); _pointSpreadFunctionTexture->uploadTexture(); @@ -783,14 +783,14 @@ RenderableGalaxy::Result RenderableGalaxy::loadCachedFile( { std::ifstream fileStream = std::ifstream(file, std::ifstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Error opening file '{}' for loading cache file", file)); + LERROR(std::format("Error opening file '{}' for loading cache file", file)); return { false, {}, {} }; } int8_t cacheVersion = 0; fileStream.read(reinterpret_cast(&cacheVersion), sizeof(int8_t)); if (cacheVersion != CurrentCacheVersion) { - LINFO(fmt::format("Removing cache file '{}' as the version changed", file)); + LINFO(std::format("Removing cache file '{}' as the version changed", file)); return { false, {}, {} }; } diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index bdf082d5c5..1a63f355b2 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -232,7 +232,7 @@ void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary& dict) { else { LWARNINGC( "GlobeBrowsingModule", - fmt::format( + std::format( "The provided texture file '{}' for the default geo point texture " "does not exist", path ) diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 2efab28eb2..fbf03fff1a 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -191,7 +191,7 @@ namespace { SceneGraphNode* n = sceneGraphNode(globeIdentifier); if (!n) { - throw ghoul::lua::LuaError(fmt::format("Unknown globe '{}'", globeIdentifier)); + throw ghoul::lua::LuaError(std::format("Unknown globe '{}'", globeIdentifier)); } RenderableGlobe* globe = dynamic_cast(n->renderable()); @@ -201,7 +201,7 @@ namespace { layers::Group::ID group = ghoul::from_string(layerGroup); if (group == layers::Group::ID::Unknown) { - throw ghoul::lua::LuaError(fmt::format("Unknown layer group '{}'", layerGroup)); + throw ghoul::lua::LuaError(std::format("Unknown layer group '{}'", layerGroup)); } LayerGroup& lg = globe->layerManager().layerGroup(group); @@ -225,7 +225,7 @@ namespace { } ); if (it == layers.cend()) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Could not find source layer '{}'", std::get(source) )); } @@ -245,7 +245,7 @@ namespace { } ); if (it == layers.cend()) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Could not find destination layer '{}'", std::get(source) )); } @@ -668,7 +668,7 @@ geoPositionForCameraDeprecated(bool useEyePosition = false) std::filesystem::path path = absPath(filename); if (!std::filesystem::is_regular_file(path)) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Could not find the provided file '{}'", filename )); } @@ -677,7 +677,7 @@ geoPositionForCameraDeprecated(bool useEyePosition = false) extension = ghoul::toLowerCase(extension); if (extension != ".geojson" && extension != ".json") { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Unexpected file type '{}'. Expected '.geojson' or '.json' file", filename )); } diff --git a/modules/globebrowsing/src/asynctiledataprovider.cpp b/modules/globebrowsing/src/asynctiledataprovider.cpp index 15b58653ce..39df0e623e 100644 --- a/modules/globebrowsing/src/asynctiledataprovider.cpp +++ b/modules/globebrowsing/src/asynctiledataprovider.cpp @@ -141,7 +141,7 @@ void AsyncTileDataProvider::update() { // Only allow resetting if there are no jobs currently running if (_enqueuedTileRequests.empty()) { performReset(ResetRawTileDataReader::Yes); - LINFO(fmt::format("Tile data reader '{}' reset successfully", _name)); + LINFO(std::format("Tile data reader '{}' reset successfully", _name)); } break; case ResetMode::ShouldResetAllButRawTileDataReader: @@ -150,7 +150,7 @@ void AsyncTileDataProvider::update() { // Only allow resetting if there are no jobs currently running if (_enqueuedTileRequests.empty()) { performReset(ResetRawTileDataReader::No); - LINFO(fmt::format("Tile data reader '{}' reset successfully", _name)); + LINFO(std::format("Tile data reader '{}' reset successfully", _name)); } break; case ResetMode::ShouldBeDeleted: @@ -172,7 +172,7 @@ void AsyncTileDataProvider::reset() { // we need to wait until _enqueuedTileRequests is empty before finishing up. _resetMode = ResetMode::ShouldResetAll; endEnqueuedJobs(); - LINFO(fmt::format("Prepairing for resetting of tile reader '{}'", _name)); + LINFO(std::format("Prepairing for resetting of tile reader '{}'", _name)); } void AsyncTileDataProvider::prepareToBeDeleted() { diff --git a/modules/globebrowsing/src/dashboarditemglobelocation.cpp b/modules/globebrowsing/src/dashboarditemglobelocation.cpp index 1fc998c0b8..740e15d10f 100644 --- a/modules/globebrowsing/src/dashboarditemglobelocation.cpp +++ b/modules/globebrowsing/src/dashboarditemglobelocation.cpp @@ -92,14 +92,14 @@ DashboardItemGlobeLocation::DashboardItemGlobeLocation( auto updateFormatString = [this]() { switch (_displayFormat.value()) { case static_cast(DisplayFormat::DecimalDegrees): - _formatString = fmt::format( + _formatString = std::format( "Position: {{:03.{0}f}}, {{:03.{0}f}} " "Altitude: {{:03.{0}f}} {{}}", _significantDigits.value() ); break; case static_cast(DisplayFormat::DegreeMinuteSeconds): - _formatString = fmt::format( + _formatString = std::format( "Position: {{}}d {{}}' {{:03.{0}f}}\" {{}}, " "{{}}d {{}}' {{:03.{0}f}}\" {{}} " "Altitude: {{:03.{0}f}} {{}}", @@ -157,9 +157,11 @@ void DashboardItemGlobeLocation::render(glm::vec2& penPosition) { switch (_displayFormat.value()) { case static_cast(DisplayFormat::DecimalDegrees): { - end = fmt::format_to( + // @CPP26(abock): This can be replaced with std::runtime_format + end = std::vformat_to( _buffer.data(), - fmt::runtime(_formatString), lat, lon, dist.first, dist.second + _formatString, + std::make_format_args(lat, lon, dist.first, dist.second) ); break; } @@ -184,12 +186,15 @@ void DashboardItemGlobeLocation::render(glm::vec2& penPosition) { const double lonSec = lonMinRemainder * 60.f; - end = fmt::format_to( + // @CPP26(abock): This can be replaced with std::runtime_format + end = std::vformat_to( _buffer.data(), - fmt::runtime(_formatString), - latDeg, latMin, latSec, isNorth ? "N" : "S", - lonDeg, lonMin, lonSec, isEast ? "E" : "W", - dist.first, dist.second + _formatString, + std::make_format_args( + latDeg, latMin, latSec, isNorth ? "N" : "S", + lonDeg, lonMin, lonSec, isEast ? "E" : "W", + dist.first, dist.second + ) ); break; @@ -205,7 +210,7 @@ glm::vec2 DashboardItemGlobeLocation::size() const { ZoneScoped; return _font->boundingBox( - fmt::format("Position: {}, {} Altitude: {}", 1.f, 1.f, 1.f) + std::format("Position: {}, {} Altitude: {}", 1.f, 1.f, 1.f) ); } diff --git a/modules/globebrowsing/src/gdalwrapper.cpp b/modules/globebrowsing/src/gdalwrapper.cpp index b8797751cc..3bb7c0093d 100644 --- a/modules/globebrowsing/src/gdalwrapper.cpp +++ b/modules/globebrowsing/src/gdalwrapper.cpp @@ -140,13 +140,13 @@ void GdalWrapper::setGdalProxyConfiguration() { const std::string proxy = address + ":" + std::to_string(port); CPLSetConfigOption("GDAL_HTTP_PROXY", proxy.c_str()); - LDEBUG(fmt::format("Using proxy server '{}'", proxy)); + LDEBUG(std::format("Using proxy server '{}'", proxy)); if (!user.empty() && !password.empty()) { const std::string userPwd = user + ":" + password; CPLSetConfigOption("GDAL_HTTP_PROXYUSERPWD", userPwd.c_str()); CPLSetConfigOption("GDAL_HTTP_PROXYAUTH", auth.c_str()); - LDEBUG(fmt::format("Using authentication method: {}", auth)); + LDEBUG(std::format("Using authentication method: {}", auth)); } } } diff --git a/modules/globebrowsing/src/geojson/geojsoncomponent.cpp b/modules/globebrowsing/src/geojson/geojsoncomponent.cpp index 1ce8ada611..cd86bac7f8 100644 --- a/modules/globebrowsing/src/geojson/geojsoncomponent.cpp +++ b/modules/globebrowsing/src/geojson/geojsoncomponent.cpp @@ -368,7 +368,7 @@ GeoJsonComponent::GeoJsonComponent(const ghoul::Dictionary& dictionary, _textureIsDirty = true; } else { - LERROR(fmt::format( + LERROR(std::format( "Provided texture file does not exist: {}", _defaultProperties.pointTexture.value() )); @@ -594,7 +594,7 @@ void GeoJsonComponent::readFile() { std::ifstream file(_geoJsonFile); if (!file.good()) { - LERROR(fmt::format("Failed to open GeoJSON file: {}", _geoJsonFile.value())); + LERROR(std::format("Failed to open GeoJSON file: {}", _geoJsonFile.value())); return; } @@ -617,7 +617,7 @@ void GeoJsonComponent::readFile() { } if (_geometryFeatures.empty()) { - LWARNING(fmt::format( + LWARNING(std::format( "No GeoJson features could be successfully created for GeoJson layer " "with identifier '{}'. Disabling layer.", identifier() )); @@ -625,7 +625,7 @@ void GeoJsonComponent::readFile() { } } catch (const geos::util::GEOSException& e) { - LERROR(fmt::format( + LERROR(std::format( "Error creating GeoJson layer with identifier '{}'. Problem reading " "GeoJson file '{}'. Error: {}", identifier(), _geoJsonFile.value(), e.what() )); @@ -646,7 +646,7 @@ void GeoJsonComponent::parseSingleFeature(const geos::io::GeoJSONFeature& featur std::vector geomsToAdd; if (!geom) { // Null geometry => no geometries to add - LWARNING(fmt::format( + LWARNING(std::format( "Feature {} in GeoJson file '{}' is a null geometry and will not be loaded", indexInFile, _geoJsonFile.value() )); @@ -683,7 +683,7 @@ void GeoJsonComponent::parseSingleFeature(const geos::io::GeoJSONFeature& featur // If there is already an owner with that name as an identifier, make a // unique one if (_featuresPropertyOwner.hasPropertySubOwner(identifier)) { - identifier = fmt::format("Feature{}-", index, identifier); + identifier = std::format("Feature{}-", index, identifier); } const properties::PropertyOwner::PropertyOwnerInfo info = { @@ -698,7 +698,7 @@ void GeoJsonComponent::parseSingleFeature(const geos::io::GeoJSONFeature& featur _featuresPropertyOwner.addPropertySubOwner(_features.back().get()); } catch (const ghoul::RuntimeError& error) { - LERROR(fmt::format( + LERROR(std::format( "Error creating GeoJson layer with identifier '{}'. Problem reading " "feature {} in GeoJson file '{}'.", identifier(), indexInFile, _geoJsonFile.value() @@ -835,7 +835,7 @@ void GeoJsonComponent::flyToFeature(std::optional index) const { float lon = centroidLon + _latLongOffset.value().y; global::scriptEngine->queueScript( - fmt::format( + std::format( "openspace.globebrowsing.flyToGeo([[{}]], {}, {}, {})", _globeNode.owner()->identifier(), lat, lon, d ), @@ -846,7 +846,7 @@ void GeoJsonComponent::flyToFeature(std::optional index) const { void GeoJsonComponent::triggerDeletion() const { global::scriptEngine->queueScript( - fmt::format( + std::format( "openspace.globebrowsing.deleteGeoJson([[{}]], [[{}]])", _globeNode.owner()->identifier(), _identifier ), diff --git a/modules/globebrowsing/src/geojson/geojsonproperties.cpp b/modules/globebrowsing/src/geojson/geojsonproperties.cpp index c30f1effa7..1dab4ec7e8 100644 --- a/modules/globebrowsing/src/geojson/geojsonproperties.cpp +++ b/modules/globebrowsing/src/geojson/geojsonproperties.cpp @@ -120,7 +120,7 @@ namespace { // Should add some more information on which file the reading failed for LERRORC( "GeoJson", - fmt::format( + std::format( "Failed reading color property. Expected 3 values, got {}", val.size() ) @@ -140,7 +140,7 @@ namespace { if (!c) { LERRORC( "GeoJson", - fmt::format( + std::format( "Failed reading color property. Did not find a hex color, got {}", hex ) @@ -532,7 +532,7 @@ GeoJsonOverrideProperties propsFromGeoJson(const geos::io::GeoJSONFeature& featu result.pointTextureAnchor = GeoJsonProperties::PointTextureAnchor::Center; } else { - LERRORC("GeoJson", fmt::format( + LERRORC("GeoJson", std::format( "Point texture anchor mode '{}' not supported", mode )); } @@ -554,7 +554,7 @@ GeoJsonOverrideProperties propsFromGeoJson(const geos::io::GeoJSONFeature& featu // result.altitudeMode = GeoJsonProperties::AltitudeMode::ClampToGround; //} else { - LERRORC("GeoJson", fmt::format( + LERRORC("GeoJson", std::format( "Altitude mode '{}' not supported", mode )); } @@ -587,7 +587,7 @@ GeoJsonOverrideProperties propsFromGeoJson(const geos::io::GeoJSONFeature& featu } catch (const geos::io::GeoJSONValue::GeoJSONTypeError&) { // @TODO: Should add some more information on which file the reading failed - LERRORC("GeoJson", fmt::format( + LERRORC("GeoJson", std::format( "Error reading GeoJson property '{}'. Value has wrong type", key )); } diff --git a/modules/globebrowsing/src/geojson/globegeometryfeature.cpp b/modules/globebrowsing/src/geojson/globegeometryfeature.cpp index ebfcb7ab5e..b925be7797 100644 --- a/modules/globebrowsing/src/geojson/globegeometryfeature.cpp +++ b/modules/globebrowsing/src/geojson/globegeometryfeature.cpp @@ -151,7 +151,7 @@ void GlobeGeometryFeature::updateTexture(bool isInitializeStep) { _pointTexture->uploadToGpu(); } else { - LERROR(fmt::format( + LERROR(std::format( "Trying to use texture file that does not exist: {}", texturePath )); } @@ -235,7 +235,7 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet _type = GeometryType::Polygon; } catch (geos::util::IllegalStateException& e) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Non-simple (e.g. self-intersecting) polygons not supported yet. " "GEOS error: {}", e.what() )); @@ -244,7 +244,7 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet // https://www.sciencedirect.com/science/article/pii/S0304397520304199 } catch (geos::util::GEOSException& e) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Unknown geos error: {}", e.what() )); } @@ -282,7 +282,7 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet _key = *_properties.overrideValues.name; } else { - _key = fmt::format("Feature {} - {}", index, geo->getGeometryType()); + _key = std::format("Feature {} - {}", index, geo->getGeometryType()); } } diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index cd6350402e..60f8409dc7 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -376,7 +376,7 @@ bool GlobeLabelsComponent::loadLabelsData(const std::filesystem::path& file) { const bool hasCachedFile = std::filesystem::is_regular_file(cachedFile); if (hasCachedFile) { - LINFO(fmt::format( + LINFO(std::format( "Cached file '{}' used for labels file '{}'", cachedFile, file )); @@ -391,9 +391,9 @@ bool GlobeLabelsComponent::loadLabelsData(const std::filesystem::path& file) { } } else { - LINFO(fmt::format("Cache for labels file '{}' not found", file)); + LINFO(std::format("Cache for labels file '{}' not found", file)); } - LINFO(fmt::format("Loading labels file '{}'", file)); + LINFO(std::format("Loading labels file '{}'", file)); const bool success = readLabelsFile(file); if (success) { @@ -406,7 +406,7 @@ bool GlobeLabelsComponent::readLabelsFile(const std::filesystem::path& file) { try { std::fstream csvLabelFile(file); if (!csvLabelFile.good()) { - LERROR(fmt::format("Failed to open labels file '{}'", file)); + LERROR(std::format("Failed to open labels file '{}'", file)); return false; } if (!csvLabelFile.is_open()) { @@ -491,7 +491,7 @@ bool GlobeLabelsComponent::readLabelsFile(const std::filesystem::path& file) { return true; } catch (const std::fstream::failure& e) { - LERROR(fmt::format("Failed reading labels file '{}'", file)); + LERROR(std::format("Failed reading labels file '{}'", file)); LERROR(e.what()); return false; } @@ -500,7 +500,7 @@ bool GlobeLabelsComponent::readLabelsFile(const std::filesystem::path& file) { bool GlobeLabelsComponent::loadCachedFile(const std::filesystem::path& file) { std::ifstream fileStream(file, std::ifstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Error opening file '{}' for loading cache file", file)); + LERROR(std::format("Error opening file '{}' for loading cache file", file)); return false; } @@ -530,7 +530,7 @@ bool GlobeLabelsComponent::loadCachedFile(const std::filesystem::path& file) { bool GlobeLabelsComponent::saveCachedFile(const std::filesystem::path& file) const { std::ofstream fileStream = std::ofstream(file, std::ofstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Error opening file '{}' for save cache file", file)); + LERROR(std::format("Error opening file '{}' for save cache file", file)); return false; } fileStream.write(reinterpret_cast(&CurrentCacheVersion), sizeof(int8_t)); diff --git a/modules/globebrowsing/src/globerotation.cpp b/modules/globebrowsing/src/globerotation.cpp index 5d9f6471ff..62dd959b4f 100644 --- a/modules/globebrowsing/src/globerotation.cpp +++ b/modules/globebrowsing/src/globerotation.cpp @@ -230,7 +230,7 @@ glm::dmat3 GlobeRotation::matrix(const UpdateData&) const { if (!_globeNode) { LERRORC( "GlobeRotation", - fmt::format("Could not find globe '{}'", _globe.value()) + std::format("Could not find globe '{}'", _globe.value()) ); return _matrix; } diff --git a/modules/globebrowsing/src/globetranslation.cpp b/modules/globebrowsing/src/globetranslation.cpp index 68cc127e8e..2d997e1727 100644 --- a/modules/globebrowsing/src/globetranslation.cpp +++ b/modules/globebrowsing/src/globetranslation.cpp @@ -225,7 +225,7 @@ glm::dvec3 GlobeTranslation::position(const UpdateData&) const { if (!_attachedNode) { LERRORC( "GlobeRotation", - fmt::format("Could not find attached node '{}'", _globe.value()) + std::format("Could not find attached node '{}'", _globe.value()) ); return _position; } diff --git a/modules/globebrowsing/src/gpulayergroup.cpp b/modules/globebrowsing/src/gpulayergroup.cpp index be7096f18f..319ae6ea7c 100644 --- a/modules/globebrowsing/src/gpulayergroup.cpp +++ b/modules/globebrowsing/src/gpulayergroup.cpp @@ -116,7 +116,7 @@ void GPULayerGroup::bind(ghoul::opengl::ProgramObject& p, const LayerGroup& laye GPULayer& gal = _gpuActiveLayers[i]; auto& galuc = gal.uniformCache; const Layer& al = *activeLayers[i]; - const std::string name = fmt::format("{}[{}].", layerGroup.identifier(), i); + const std::string name = std::format("{}[{}].", layerGroup.identifier(), i); if (layerGroup.isHeightLayer()) { gal.isHeightLayer = true; @@ -152,7 +152,7 @@ void GPULayerGroup::bind(ghoul::opengl::ProgramObject& p, const LayerGroup& laye for (size_t j = 0; j < gal.gpuChunkTiles.size(); j++) { GPULayer::GPUChunkTile& t = gal.gpuChunkTiles[j]; auto& tuc = t.uniformCache; - const std::string n = fmt::format("{}pile.chunkTile{}.", name, j); + const std::string n = std::format("{}pile.chunkTile{}.", name, j); tuc.texture = p.uniformLocation(n + "textureSampler"); tuc.uvOffset = p.uniformLocation(n + "uvTransform.uvOffset"); diff --git a/modules/globebrowsing/src/layergroupid.h b/modules/globebrowsing/src/layergroupid.h index b8e6d92c11..a1d5f159fd 100644 --- a/modules/globebrowsing/src/layergroupid.h +++ b/modules/globebrowsing/src/layergroupid.h @@ -210,7 +210,7 @@ constexpr openspace::globebrowsing::layers::Layer::ID from_string(std::string_vi return it->id; } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find Layer of type '{}'", string )); } @@ -231,7 +231,7 @@ constexpr openspace::globebrowsing::layers::Group::ID from_string(std::string_vi return it->id; } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find Group of type '{}'", string )); } diff --git a/modules/globebrowsing/src/layermanager.cpp b/modules/globebrowsing/src/layermanager.cpp index 2387fa5bc8..3c088952fc 100644 --- a/modules/globebrowsing/src/layermanager.cpp +++ b/modules/globebrowsing/src/layermanager.cpp @@ -72,7 +72,7 @@ void LayerManager::initialize(const ghoul::Dictionary& layerGroupsDict) { _layerGroups[static_cast(id)]->setLayersFromDict(d); } else { - LWARNINGC("LayerManager", fmt::format("Unknown layer group '{}'", group)); + LWARNINGC("LayerManager", std::format("Unknown layer group '{}'", group)); } } diff --git a/modules/globebrowsing/src/rawtiledatareader.cpp b/modules/globebrowsing/src/rawtiledatareader.cpp index 0374d9681c..feb2a6f75f 100644 --- a/modules/globebrowsing/src/rawtiledatareader.cpp +++ b/modules/globebrowsing/src/rawtiledatareader.cpp @@ -111,7 +111,7 @@ GDALDataType toGDALDataType(GLenum glType) { default: LERRORC( "GDALRawTileDataReader", - fmt::format( + std::format( "OpenGL data type unknown to GDAL: {}", static_cast(glType) ) ); @@ -282,7 +282,7 @@ std::optional RawTileDataReader::mrfCache() { for (std::string_view fmt : Unsupported) { if (_datasetFilePath.ends_with(fmt)) { - LWARNING(fmt::format( + LWARNING(std::format( "Unsupported file format for MRF caching: '{}', Dataset: '{}'", fmt, _datasetFilePath )); @@ -294,7 +294,7 @@ std::optional RawTileDataReader::mrfCache() { const std::string datasetIdentifier = std::to_string(std::hash{}(_datasetFilePath)); - const std::string path = fmt::format("{}/{}/{}/", + const std::string path = std::format("{}/{}/{}/", mod.mrfCacheLocation(), _cacheProperties.path, datasetIdentifier); const std::string root = absPath(path).string(); std::string mrf = root + datasetIdentifier + ".mrf"; @@ -304,7 +304,7 @@ std::optional RawTileDataReader::mrfCache() { if (!std::filesystem::create_directories(root, ec)) { // Already existing directories causes a 'failure' but no error if (ec) { - LWARNING(fmt::format( + LWARNING(std::format( "Failed to create directories for cache at: '{}'. " "Error Code: '{}', message: {}", root, std::to_string(ec.value()), ec.message() @@ -319,7 +319,7 @@ std::optional RawTileDataReader::mrfCache() { GDALOpen(_datasetFilePath.c_str(), GA_ReadOnly) ); if (!src) { - LWARNING(fmt::format( + LWARNING(std::format( "Failed to load dataset '{}'. GDAL error: {}", _datasetFilePath, CPLGetLastErrorMsg() )); @@ -356,7 +356,7 @@ std::optional RawTileDataReader::mrfCache() { driver->CreateCopy(mrf.c_str(), src, false, createOpts, nullptr, nullptr) ); if (!dst) { - LWARNING(fmt::format( + LWARNING(std::format( "Failed to create MRF Caching dataset dataset '{}'. GDAL error: {}", mrf, CPLGetLastErrorMsg() )); @@ -397,7 +397,7 @@ void RawTileDataReader::initialize() { ZoneScopedN("GDALOpen"); _dataset = static_cast(GDALOpen(content.c_str(), GA_ReadOnly)); if (!_dataset) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Failed to load dataset '{}'. GDAL error: {}", _datasetFilePath, CPLGetLastErrorMsg() )); diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 2ecd96ec4a..ff921efe5b 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -866,7 +866,7 @@ void RenderableGlobe::renderSecondary(const RenderData& data, RendererTasks&) { _globeLabelsComponent.draw(data); } catch (const ghoul::opengl::TextureUnit::TextureUnitError& e) { - LERROR(fmt::format("Error on drawing globe labels '{}'", e.message)); + LERROR(std::format("Error on drawing globe labels '{}'", e.message)); } if (_geoJsonManager.isReady()) { @@ -1726,21 +1726,21 @@ void RenderableGlobe::recompileShaders() { // lastLayerIndex must be at least 0 for the shader to compile, // the layer type is inactivated by setting use to false shaderDictionary.setValue( - fmt::format("lastLayerIndex{}", layers::Groups[i].identifier), + std::format("lastLayerIndex{}", layers::Groups[i].identifier), glm::max(preprocessingData.layeredTextureInfo[i].lastLayerIdx, 0) ); shaderDictionary.setValue( - fmt::format("use{}", layers::Groups[i].identifier), + std::format("use{}", layers::Groups[i].identifier), preprocessingData.layeredTextureInfo[i].lastLayerIdx >= 0 ); shaderDictionary.setValue( - fmt::format("blend{}", layers::Groups[i].identifier), + std::format("blend{}", layers::Groups[i].identifier), preprocessingData.layeredTextureInfo[i].layerBlendingEnabled ); // This is to avoid errors from shader preprocessor shaderDictionary.setValue( - fmt::format("{}0LayerType", layers::Groups[i].identifier), + std::format("{}0LayerType", layers::Groups[i].identifier), 0 ); @@ -2198,17 +2198,17 @@ void RenderableGlobe::calculateEclipseShadows(ghoul::opengl::ProgramObject& prog constexpr std::string_view NameSource = "shadowDataArray[{}].sourceCasterVec"; constexpr std::string_view NamePos = "shadowDataArray[{}].casterPositionVec"; - programObject.setUniform(fmt::format(NameIsShadowing, counter), sd.isShadowing); + programObject.setUniform(std::format(NameIsShadowing, counter), sd.isShadowing); if (sd.isShadowing) { - programObject.setUniform(fmt::format(NameXp, counter), sd.xp); - programObject.setUniform(fmt::format(NameXu, counter), sd.xu); - programObject.setUniform(fmt::format(NameRc, counter), sd.rc); + programObject.setUniform(std::format(NameXp, counter), sd.xp); + programObject.setUniform(std::format(NameXu, counter), sd.xu); + programObject.setUniform(std::format(NameRc, counter), sd.rc); programObject.setUniform( - fmt::format(NameSource, counter), sd.sourceCasterVec + std::format(NameSource, counter), sd.sourceCasterVec ); programObject.setUniform( - fmt::format(NamePos, counter), sd.casterPositionVec + std::format(NamePos, counter), sd.casterPositionVec ); } counter++; diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index 195a2afe2c..a7fe337ac0 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -665,7 +665,7 @@ void RingsComponent::loadTexture() { if (texture) { LDEBUGC( "RingsComponent", - fmt::format("Loaded texture from '{}'", absPath(_texturePath)) + std::format("Loaded texture from '{}'", absPath(_texturePath)) ); _texture = std::move(texture); @@ -688,7 +688,7 @@ void RingsComponent::loadTexture() { if (textureForwards) { LDEBUGC( "RingsComponent", - fmt::format( + std::format( "Loaded forwards scattering texture from '{}'", absPath(_textureFwrdPath) ) @@ -715,7 +715,7 @@ void RingsComponent::loadTexture() { if (textureBackwards) { LDEBUGC( "RingsComponent", - fmt::format( + std::format( "Loaded backwards scattering texture from '{}'", absPath(_textureBckwrdPath) ) @@ -742,7 +742,7 @@ void RingsComponent::loadTexture() { if (textureUnlit) { LDEBUGC( "RingsComponent", - fmt::format("Loaded unlit texture from '{}'", absPath(_textureUnlitPath)) + std::format("Loaded unlit texture from '{}'", absPath(_textureUnlitPath)) ); _textureUnlit = std::move(textureUnlit); @@ -765,7 +765,7 @@ void RingsComponent::loadTexture() { if (textureColor) { LDEBUGC( "RingsComponent", - fmt::format("Loaded color texture from '{}'", absPath(_textureColorPath)) + std::format("Loaded color texture from '{}'", absPath(_textureColorPath)) ); _textureColor = std::move(textureColor); @@ -788,7 +788,7 @@ void RingsComponent::loadTexture() { if (textureTransparency) { LDEBUGC( "RingsComponent", - fmt::format("Loaded unlit texture from '{}'", absPath(_textureUnlitPath)) + std::format("Loaded unlit texture from '{}'", absPath(_textureUnlitPath)) ); _textureTransparency = std::move(textureTransparency); diff --git a/modules/globebrowsing/src/shadowcomponent.cpp b/modules/globebrowsing/src/shadowcomponent.cpp index 82b8d3ba50..7d0034e24e 100644 --- a/modules/globebrowsing/src/shadowcomponent.cpp +++ b/modules/globebrowsing/src/shadowcomponent.cpp @@ -534,7 +534,7 @@ void ShadowComponent::saveDepthBuffer() const { for (int i = 0; i < _shadowDepthTextureWidth; i++) { for (int j = 0; j < _shadowDepthTextureHeight; j++, k++) { const unsigned int val = static_cast(buffer[k]); - ppmFile << fmt::format("{0} {0} {0} ", val); + ppmFile << std::format("{0} {0} {0} ", val); } ppmFile << '\n'; } diff --git a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp index 400e058db0..b791c499f0 100644 --- a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp @@ -130,7 +130,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) const Parameters p = codegen::bake(dictionary); name = p.name.value_or("Name unspecified"); - const std::string _loggerCat = fmt::format("DefaultTileProvider ({})", name); + const std::string _loggerCat = std::format("DefaultTileProvider ({})", name); // 1. Get required Keys _filePath = p.filePath; @@ -162,7 +162,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) std::string identifier = p.identifier.value_or("unspecified"); std::string enclosing = p.globeName.value_or("unspecified"); - std::string path = fmt::format("{}/{}/{}/", enclosing, layerGroup, identifier); + std::string path = std::format("{}/{}/{}/", enclosing, layerGroup, identifier); const GlobeBrowsingModule& mod = *global::moduleEngine->module(); bool enabled = mod.isMRFCachingEnabled(); diff --git a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp index 38f06a658a..cd7f1af860 100644 --- a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp @@ -85,7 +85,7 @@ void SingleImageProvider::reset() { _tileTexture = ghoul::io::TextureReader::ref().loadTexture(_filePath, 2); if (!_tileTexture) { throw ghoul::RuntimeError( - fmt::format("Unable to load texture '{}'", _filePath.value()) + std::format("Unable to load texture '{}'", _filePath.value()) ); } diff --git a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp index 95d5051464..136582a69e 100644 --- a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp @@ -94,7 +94,7 @@ Tile SizeReferenceTileProvider::tile(const TileIndex& tileIndex) { unit = "m"; } - const std::string text = fmt::format("{:.0f} {:s}", tileLongitudalLength, unit); + const std::string text = std::format("{:.0f} {:s}", tileLongitudalLength, unit); const glm::vec2 textPosition = glm::vec2( 0.f, aboveEquator ? diff --git a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp index 34616b46d4..1456f92ba4 100644 --- a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp @@ -217,13 +217,13 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) _prototyped.temporalResolution = p.prototyped->temporalResolution; } catch (const ghoul::RuntimeError& e) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not create time quantizer for Temporal GDAL dataset: {}", e.message )); } if (p.prototyped->timeFormat.size() >= 64) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Time format string '{}' too large. Maximum length of 64 is allowed", p.prototyped->timeFormat )); @@ -257,7 +257,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) // unfortunately. Luckily, Spice understands DOY date formats, so // we can specify those directly and noone would use a DOY and a DOM // time string in the same format string, right? Right?! - date = fmt::format( + date = std::format( "{}-{}T{}:{}:{}", tm.tm_year + 1900, tm.tm_yday, @@ -267,7 +267,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) ); } else { - date = fmt::format( + date = std::format( "{}-{}-{} {}:{}:{}", tm.tm_year + 1900, tm.tm_mon + 1, @@ -294,7 +294,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) ); if (_folder.files.empty()) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading layer '{}'. Folder '{}' does not contain any files that " "matched the time format", _identifier, _folder.folder diff --git a/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp b/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp index fb6fe49bea..a0b186a5db 100644 --- a/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp @@ -59,7 +59,7 @@ TileIndexTileProvider::TileIndexTileProvider(const ghoul::Dictionary& dictionary Tile TileIndexTileProvider::tile(const TileIndex& tileIndex) { ZoneScoped; - const std::string text = fmt::format( + const std::string text = std::format( "level: {}\nx: {}\ny: {}", tileIndex.level, tileIndex.x, tileIndex.y ); const glm::vec2 position = glm::vec2( diff --git a/modules/globebrowsing/src/timequantizer.cpp b/modules/globebrowsing/src/timequantizer.cpp index 61daaa95f0..e54c51b352 100644 --- a/modules/globebrowsing/src/timequantizer.cpp +++ b/modules/globebrowsing/src/timequantizer.cpp @@ -169,7 +169,7 @@ void DateTime::setTime(std::string_view input) { } std::string DateTime::ISO8601() const { - return fmt::format( + return std::format( "{:0>4}-{:0>2}-{:0>2}T{:0>2}:{:0>2}:{:0>2}", _year, _month, _day, _hour, _minute, _second ); @@ -178,7 +178,7 @@ std::string DateTime::ISO8601() const { double DateTime::J2000() const { char Buffer[20]; std::memset(Buffer, 0, 20); - fmt::format_to( + std::format_to( Buffer, "{:0>4}-{:0>2}-{:0>2}T{:0>2}:{:0>2}:{:0>2}", _year, _month, _day, _hour, _minute, _second @@ -226,7 +226,7 @@ void DateTime::incrementOnce(int value, char unit) { _year += value; break; default: - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid unit in incrementOnce '{}'. Expected 'y', 'M', 'd', 'h', or 'm'", unit )); @@ -387,13 +387,13 @@ void TimeQuantizer::verifyStartTimeRestrictions() { dayUpperLimit = 31; } if (_start.day() < 1 || _start.day() > dayUpperLimit) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid start day value of {} for {}, valid days are 1 - {}", _start.day(), helpfulDescription, dayUpperLimit )); } if (_start.hour() != 0 || _start.minute() != 0 || _start.second() != 0) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid start time value of {}:{}:{}, time must be 00:00:00", _start.hour(), _start.minute(), _start.second() )); @@ -406,7 +406,7 @@ void TimeQuantizer::verifyResolutionRestrictions(const int value, const char uni break; case 'M': if (value < 1 || value > 6) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid resolution count of {} for (M)onth option. Valid counts are " "1, 2, 3, 4, or 6", value )); @@ -414,7 +414,7 @@ void TimeQuantizer::verifyResolutionRestrictions(const int value, const char uni break; case 'd': if (value < 1 || value > 28) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid resolution count of {} for (d)ay option. Valid counts are " "1 - 28", value )); @@ -422,7 +422,7 @@ void TimeQuantizer::verifyResolutionRestrictions(const int value, const char uni break; case 'h': if ((value < 1 || value > 4) && value != 6 && value != 12) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid resolution count of {} for (h)our option. Valid counts are " "1, 2, 3, 4, 6, or 12", value )); @@ -430,14 +430,14 @@ void TimeQuantizer::verifyResolutionRestrictions(const int value, const char uni break; case 'm': if (value != 15 && value != 30) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid resolution count of {} for (m)inute option. Valid counts " "are 15 or 30", value )); } break; default: - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid unit format '{}'. Expected 'y', 'M', 'd', 'h', or 'm'", unit )); } @@ -469,7 +469,7 @@ double TimeQuantizer::computeSecondsFromResolution(const int valueIn, const char break; default: - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid resolution unit format '{}'. Expected 'y', 'M', 'd', 'h', 'm', " "or 's'", unit )); @@ -531,7 +531,7 @@ bool TimeQuantizer::quantize(Time& t, bool clamp) { } char Buffer[20]; std::memset(Buffer, 0, 20); - fmt::format_to( + std::format_to( Buffer, "{:0>4}-{:0>2}-{:0>2}T{:0>2}:{:0>2}:{:0>2}", quantized.year(), quantized.month(), quantized.day(), @@ -615,7 +615,7 @@ void TimeQuantizer::doFirstApproximation(DateTime& quantized, const DateTime& un } break; default: - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Invalid unit '{}'. Expected 'y', 'M', 'd', 'h', or 'm'", unit )); } diff --git a/modules/imgui/imguimodule.cpp b/modules/imgui/imguimodule.cpp index 6f98369a6f..2521998b77 100644 --- a/modules/imgui/imguimodule.cpp +++ b/modules/imgui/imguimodule.cpp @@ -281,7 +281,7 @@ void ImGUIModule::internalDeinitialize() { void ImGUIModule::internalInitializeGL() { std::filesystem::path file = FileSys.cacheManager()->cachedFilename("imgui.ini", ""); - LDEBUG(fmt::format("Using '{}' as ImGUI cache location", file)); + LDEBUG(std::format("Using '{}' as ImGUI cache location", file)); _iniFileBuffer.resize(file.string().size() + 1); diff --git a/modules/imgui/src/guigibscomponent.cpp b/modules/imgui/src/guigibscomponent.cpp index 857e1485f2..22ff4ea0d0 100644 --- a/modules/imgui/src/guigibscomponent.cpp +++ b/modules/imgui/src/guigibscomponent.cpp @@ -114,7 +114,7 @@ void GuiGIBSComponent::render() { std::string imageFormat = std::string(ImageFormatBuffer.data()); // Construct the components of the Lua function - std::string xmlFunc = fmt::format( + std::string xmlFunc = std::format( "openspace.globebrowsing.createTemporalGibsGdalXml('{}', '{}', '{}')", layer, imageRes, imageFormat ); @@ -122,7 +122,7 @@ void GuiGIBSComponent::render() { if (startDate == "Present") { startDate.clear(); } - std::string layerScript = fmt::format( + std::string layerScript = std::format( "{{" " Identifier = '{}'," " Type = 'TemporalTileLayer'," @@ -141,7 +141,7 @@ void GuiGIBSComponent::render() { layer, startDate, endDate, temporalRes, temporalFormat, xmlFunc ); - std::string script = fmt::format( + std::string script = std::format( "openspace.globebrowsing.addLayer('Earth', 'ColorLayers', {})", layerScript ); diff --git a/modules/imgui/src/guiglobebrowsingcomponent.cpp b/modules/imgui/src/guiglobebrowsingcomponent.cpp index a97bf190dc..be43f8f425 100644 --- a/modules/imgui/src/guiglobebrowsingcomponent.cpp +++ b/modules/imgui/src/guiglobebrowsingcomponent.cpp @@ -270,7 +270,7 @@ void GuiGlobeBrowsingComponent::render() { const Capabilities cap = module->capabilities(_currentServer); if (cap.empty()) { - LWARNINGC("GlobeBrowsing", fmt::format("Unknown server '{}'", _currentServer)); + LWARNINGC("GlobeBrowsing", std::format("Unknown server '{}'", _currentServer)); } ImGui::Columns(6, nullptr, false); @@ -327,7 +327,7 @@ void GuiGlobeBrowsingComponent::render() { layerName.end() ); global::scriptEngine->queueScript( - fmt::format( + std::format( "openspace.globebrowsing.addLayer(\ '{}', \ '{}', \ diff --git a/modules/imgui/src/guiparallelcomponent.cpp b/modules/imgui/src/guiparallelcomponent.cpp index f54147ae89..b7f001865d 100644 --- a/modules/imgui/src/guiparallelcomponent.cpp +++ b/modules/imgui/src/guiparallelcomponent.cpp @@ -45,7 +45,7 @@ namespace { connectionInfo = "Hosting session with 1 client"; } else { - connectionInfo = fmt::format("Hosting session with {} clients", nClients); + connectionInfo = std::format("Hosting session with {} clients", nClients); } ImGui::Text("%s", connectionInfo.c_str()); @@ -90,12 +90,12 @@ void GuiParallelComponent::renderClientWithHost() { const size_t nClients = nConnections - 1; if (nClients > 2) { - connectionInfo += fmt::format( + connectionInfo += std::format( "You and {} more clients are connected", nClients - 1 ); } else if (nClients == 2) { - connectionInfo += fmt::format( + connectionInfo += std::format( "You and {} more client are connected", nClients - 1 ); } @@ -110,13 +110,13 @@ void GuiParallelComponent::renderClientWithHost() { const size_t nCameraKeyframes = global::navigationHandler->keyframeNavigator().nKeyframes(); - const std::string timeKeyframeInfo = fmt::format( + const std::string timeKeyframeInfo = std::format( "TimeKeyframes: {}", nTimeKeyframes ); - const std::string cameraKeyframeInfo = fmt::format( + const std::string cameraKeyframeInfo = std::format( "CameraKeyframes: {}", nCameraKeyframes ); - const std::string latencyStandardDeviation = fmt::format( + const std::string latencyStandardDeviation = std::format( "Latency standard deviation: {} s", parallel.latencyStandardDeviation() ); @@ -136,12 +136,12 @@ void GuiParallelComponent::renderClientWithoutHost() { const size_t nConnections = global::parallelPeer->nConnections(); if (nConnections > 2) { - connectionInfo += fmt::format( + connectionInfo += std::format( "You and {} more users are connected", nConnections - 1 ); } else if (nConnections == 2) { - connectionInfo += fmt::format( + connectionInfo += std::format( "You and {} more users are connected", nConnections - 1 ); } diff --git a/modules/imgui/src/guispacetimecomponent.cpp b/modules/imgui/src/guispacetimecomponent.cpp index d650336be6..a851c9a1e6 100644 --- a/modules/imgui/src/guispacetimecomponent.cpp +++ b/modules/imgui/src/guispacetimecomponent.cpp @@ -211,7 +211,7 @@ void GuiSpaceTimeComponent::render() { // No sync or send because time settings are always synced and sent to the // connected nodes and peers global::scriptEngine->queueScript( - fmt::format("openspace.time.setTime([[{}]])", std::string_view(Buffer)), + std::format("openspace.time.setTime([[{}]])", std::string_view(Buffer)), scripting::ScriptEngine::ShouldBeSynchronized::No, scripting::ScriptEngine::ShouldSendToRemote::No ); @@ -345,7 +345,7 @@ void GuiSpaceTimeComponent::render() { openspace::TimeUnits.end(), std::string(""), [](const std::string& a, const openspace::TimeUnit& unit) { - return fmt::format( + return std::format( "{}{} / second", a, nameForTimeUnit(unit, true) ) + '\0'; } diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index bb90409c85..4e1b285951 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -73,7 +73,7 @@ void renderTooltip(Property* prop, double delay) { void executeSetPropertyScript(const std::string& id, const std::string& value) { global::scriptEngine->queueScript( - fmt::format("openspace.setPropertyValueSingle('{}', {});", id, value), + std::format("openspace.setPropertyValueSingle('{}', {});", id, value), scripting::ScriptEngine::ShouldBeSynchronized::Yes, scripting::ScriptEngine::ShouldSendToRemote::Yes ); @@ -194,7 +194,7 @@ void renderSelectionProperty(Property* prop, const std::string& ownerName, if (selectionChanged) { std::string parameters = "{"; for (const std::string& s : newSelected) { - parameters += fmt::format("'{}',", s); + parameters += std::format("'{}',", s); } if (!newSelected.empty()) { parameters.pop_back(); diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 3f2482731a..f9af386224 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -99,12 +99,12 @@ void IswaKameleonGroup::registerProperties() { } void IswaKameleonGroup::readFieldlinePaths(const std::string& indexFile) { - LINFO(fmt::format("Reading seed points paths from file '{}'", indexFile)); + LINFO(std::format("Reading seed points paths from file '{}'", indexFile)); // Read the index file from disk std::ifstream seedFile(indexFile); if (!seedFile.good()) { - LERROR(fmt::format("Could not open seed points file '{}'", indexFile)); + LERROR(std::format("Could not open seed points file '{}'", indexFile)); } else { std::string line; diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index b9ab4e93dc..707aa8dd45 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -318,7 +318,7 @@ void KameleonPlane::updateFieldlineSeeds() { } void KameleonPlane::readFieldlinePaths(const std::string& indexFile) { - LINFO(fmt::format("Reading seed points paths from file '{}'", indexFile)); + LINFO(std::format("Reading seed points paths from file '{}'", indexFile)); if (_group) { dynamic_cast(_group)->setFieldlineInfo( indexFile, @@ -330,7 +330,7 @@ void KameleonPlane::readFieldlinePaths(const std::string& indexFile) { // Read the index file from disk std::ifstream seedFile(indexFile); if (!seedFile.good()) { - LERROR(fmt::format("Could not open seed points file '{}'", indexFile)); + LERROR(std::format("Could not open seed points file '{}'", indexFile)); } else { try { diff --git a/modules/iswa/rendering/texturecygnet.cpp b/modules/iswa/rendering/texturecygnet.cpp index 81bc8666cd..280f07f9b7 100644 --- a/modules/iswa/rendering/texturecygnet.cpp +++ b/modules/iswa/rendering/texturecygnet.cpp @@ -52,7 +52,7 @@ bool TextureCygnet::updateTexture() { ); if (texture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from image iswa cygnet with id '{}'", _data.id )); texture->uploadTexture(); diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 7dd7108247..40e60e7397 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -276,7 +276,7 @@ std::string IswaManager::iswaUrl(int id, double timestamp, const std::string& ty std::getline(ss, token, ' '); url += token + "-"; std::getline(ss, token, ' '); - url = fmt::format("{}{}-", url, monthNumber(token)); + url = std::format("{}{}-", url, monthNumber(token)); std::getline(ss, token, 'T'); url += token + "%20"; std::getline(ss, token, '.'); @@ -622,7 +622,7 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { } else { LWARNING( - fmt::format("'{}' is not a CDF file or cannot be found", absPath(info.path)) + std::format("'{}' is not a CDF file or cannot be found", absPath(info.path)) ); } } @@ -744,7 +744,7 @@ void IswaManager::addCdfFiles(std::string cdfpath) { } } else { - LWARNING(fmt::format("'{}' is not a CDF file or cannot be found", cdfFile)); + LWARNING(std::format("'{}' is not a CDF file or cannot be found", cdfFile)); } } diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index b65d16a411..fa98b9966d 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -50,7 +50,7 @@ namespace { info->selected = true; if (global::renderEngine->screenSpaceRenderable(name)) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "A cygnet with the name '{}' already exist", name )); } @@ -91,7 +91,7 @@ namespace { std::shared_ptr info = cygnetInformation[id]; info->selected = false; - std::string script = fmt::format( + std::string script = std::format( "openspace.unregisterScreenSpaceRenderable('{}');", cygnetInformation[id]->name ); diff --git a/modules/kameleon/src/kameleonhelper.cpp b/modules/kameleon/src/kameleonhelper.cpp index 460cfddff8..8ae94553f0 100644 --- a/modules/kameleon/src/kameleonhelper.cpp +++ b/modules/kameleon/src/kameleonhelper.cpp @@ -50,17 +50,17 @@ namespace openspace::kameleonHelper { std::unique_ptr createKameleonObject(const std::string& cdfFilePath) { auto kameleon = std::make_unique(); - LDEBUG(fmt::format("Opening the CDF file '{}'", cdfFilePath)); + LDEBUG(std::format("Opening the CDF file '{}'", cdfFilePath)); long kamStatus = kameleon->open(cdfFilePath); if (kamStatus != ccmc::FileReader::OK) { - LERROR(fmt::format( + LERROR(std::format( "Failed to create a Kameleon Object from file '{}'", cdfFilePath )); return nullptr; } - LDEBUG(fmt::format("Successfully opened '{}'", cdfFilePath)); + LDEBUG(std::format("Successfully opened '{}'", cdfFilePath)); return kameleon; } diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index 94c3982a76..e78fcbcfd9 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -117,9 +117,9 @@ bool KameleonWrapper::open(const std::string& filename) { _zCoordVar = v[2]; _type = modelType(); - LDEBUG(fmt::format("x: {}", _xCoordVar)); - LDEBUG(fmt::format("y: {}", _yCoordVar)); - LDEBUG(fmt::format("z: {}", _zCoordVar)); + LDEBUG(std::format("x: {}", _xCoordVar)); + LDEBUG(std::format("y: {}", _yCoordVar)); + LDEBUG(std::format("z: {}", _zCoordVar)); _min = glm::vec3( _model->getVariableAttribute(_xCoordVar, "actual_min").getAttributeFloat(), @@ -172,7 +172,7 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, { ghoul_assert(_model && _interpolator, "Model and interpolator must exist"); - LINFO(fmt::format( + LINFO(std::format( "Loading variable '{}' from CDF data with a uniform sampling", var )); @@ -183,10 +183,10 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, const double varMin = _model->getVariableAttribute(var, "actual_min").getAttributeFloat(); - LDEBUG(fmt::format("{} Min: {}", var, varMin)); + LDEBUG(std::format("{} Min: {}", var, varMin)); const double varMax = _model->getVariableAttribute(var, "actual_max").getAttributeFloat(); - LDEBUG(fmt::format("{} Max: {}", var, varMax)); + LDEBUG(std::format("{} Max: {}", var, varMax)); // HISTOGRAM constexpr int NBins = 200; @@ -308,10 +308,10 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, data[i] = static_cast(glm::clamp(normalizedVal, 0.0, 1.0)); if (data[i] < 0.f) { - LERROR(fmt::format("Datapoint {} less than 0", i)); + LERROR(std::format("Datapoint {} less than 0", i)); } if (data[i] > 1.f) { - LERROR(fmt::format("Datapoint {} more than 1", i)); + LERROR(std::format("Datapoint {} more than 1", i)); } } @@ -324,7 +324,7 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, float slice) const { ghoul_assert(_model && _interpolator, "Model and interpolator must exist"); - LINFO(fmt::format( + LINFO(std::format( "Loading variable '{}' from CDF data with a uniform sampling", var )); @@ -352,8 +352,8 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, const double yDim = hasYSlice ? 1.0 : outDimensions.y - 1; const double zDim = hasZSlice ? 1.0 : outDimensions.z - 1; - LDEBUG(fmt::format("{} min: {}", var, varMin)); - LDEBUG(fmt::format("{} max: {}", var, varMax)); + LDEBUG(std::format("{} min: {}", var, varMin)); + LDEBUG(std::format("{} max: {}", var, varMax)); //double maxValue = 0.0; //double minValue = std::numeric_limits::max(); @@ -455,7 +455,7 @@ float* KameleonWrapper::uniformSampledVectorValues(const std::string& xVar, { ghoul_assert(_model && _interpolator, "Model and interpolator must exist"); - LINFO(fmt::format( + LINFO(std::format( "Loading variables {} {} {} from CDF data with a uniform sampling", xVar, yVar, @@ -530,7 +530,7 @@ KameleonWrapper::Fieldlines KameleonWrapper::classifiedFieldLines(const std::str float stepSize) const { ghoul_assert(_model && _interpolator, "Model and interpolator must exist"); - LINFO(fmt::format( + LINFO(std::format( "Creating {} fieldlines from variables {} {} {}", seedPoints.size(), xVar, yVar, zVar )); @@ -592,7 +592,7 @@ KameleonWrapper::Fieldlines KameleonWrapper::fieldLines(const std::string& xVar, { ghoul_assert(_model && _interpolator, "Model and interpolator must exist"); - LINFO(fmt::format( + LINFO(std::format( "Creating {} fieldlines from variables {} {} {}", seedPoints.size(), xVar, yVar, zVar )); @@ -647,7 +647,7 @@ KameleonWrapper::Fieldlines KameleonWrapper::lorentzTrajectories( const glm::vec4& /*color*/, float step) const { - LINFO(fmt::format("Creating {} Lorentz force trajectories", seedPoints.size())); + LINFO(std::format("Creating {} Lorentz force trajectories", seedPoints.size())); Fieldlines trajectories; @@ -840,7 +840,7 @@ KameleonWrapper::TraceLine KameleonWrapper::traceCartesianFieldline( ++numSteps; if (numSteps > MaxSteps) { - LDEBUG(fmt::format("Max number of steps taken ({})", MaxSteps)); + LDEBUG(std::format("Max number of steps taken ({})", MaxSteps)); break; } } @@ -954,7 +954,7 @@ KameleonWrapper::TraceLine KameleonWrapper::traceLorentzTrajectory( ++numSteps; if (numSteps > MaxSteps) { - LDEBUG(fmt::format("Max number of steps taken ({})", MaxSteps)); + LDEBUG(std::format("Max number of steps taken ({})", MaxSteps)); break; } } diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp index 577611b777..d3d7c61b89 100644 --- a/modules/kameleonvolume/kameleonvolumereader.cpp +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -83,7 +83,7 @@ KameleonVolumeReader::KameleonVolumeReader(std::string path) : _path(std::move(p const long status = _kameleon->open(_path); if (status != ccmc::FileReader::OK) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Failed to open file '{}' with Kameleon", _path )); } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 9de9405784..3413e7c901 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -339,7 +339,7 @@ bool RenderableKameleonVolume::isCachingEnabled() const { void RenderableKameleonVolume::load() { if (!std::filesystem::is_regular_file(_sourcePath.value())) { - LERROR(fmt::format("File '{}' does not exist", _sourcePath.value())); + LERROR(std::format("File '{}' does not exist", _sourcePath.value())); return; } if (!isCachingEnabled()) { @@ -361,7 +361,7 @@ void RenderableKameleonVolume::load() { std::string RenderableKameleonVolume::cacheSuffix() const { glm::uvec3 dims = _dimensions; - return fmt::format(".{}.{}x{}x{}", _variable.value(), dims[0], dims[1], dims[2]); + return std::format(".{}.{}x{}x{}", _variable.value(), dims[0], dims[1], dims[2]); } void RenderableKameleonVolume::loadFromPath(const std::string& path) { diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp index 9993c8db9d..f3d9ba8042 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -64,7 +64,7 @@ KameleonDocumentationTask::KameleonDocumentationTask(const ghoul::Dictionary& di } std::string KameleonDocumentationTask::description() { - return fmt::format( + return std::format( "Extract metadata from CDF file '{}' and output HTML documentation to '{}'", _inputPath, _outputPath ); diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp index 833a046885..4493a589a3 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp @@ -58,7 +58,7 @@ KameleonMetadataToJsonTask::KameleonMetadataToJsonTask( } std::string KameleonMetadataToJsonTask::description() { - return fmt::format( + return std::format( "Extract metadata from CDF file '{}' and write as JSON to '{}'", _inputPath, _outputPath ); diff --git a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp index f6ca029cbc..c551aa8961 100644 --- a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp +++ b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp @@ -97,7 +97,7 @@ KameleonVolumeToRawTask::KameleonVolumeToRawTask(const ghoul::Dictionary& dictio } std::string KameleonVolumeToRawTask::description() { - return fmt::format( + return std::format( "Extract volumetric data from CDF file '{}'. Write raw volume data into '{}' " "and dictionary with metadata to '{}'", _inputPath, _rawVolumeOutputPath, _dictionaryOutputPath diff --git a/modules/multiresvolume/rendering/brickmanager.cpp b/modules/multiresvolume/rendering/brickmanager.cpp index 7039745a64..959b11522e 100644 --- a/modules/multiresvolume/rendering/brickmanager.cpp +++ b/modules/multiresvolume/rendering/brickmanager.cpp @@ -49,13 +49,13 @@ bool BrickManager::readHeader() { _header = _tsp->header(); - LDEBUG(fmt::format("Grid type: {}", _header.gridType)); - LDEBUG(fmt::format("Original num timesteps: {}", _header.numOrigTimesteps)); - LDEBUG(fmt::format("Num timesteps: {}", _header.numTimesteps)); - LDEBUG(fmt::format( + LDEBUG(std::format("Grid type: {}", _header.gridType)); + LDEBUG(std::format("Original num timesteps: {}", _header.numOrigTimesteps)); + LDEBUG(std::format("Num timesteps: {}", _header.numTimesteps)); + LDEBUG(std::format( "Brick dims: {} {} {}", _header.xBrickDim, _header.yBrickDim, _header.zBrickDim )); - LDEBUG(fmt::format( + LDEBUG(std::format( "Num bricks: {} {} {}", _header.xNumBricks, _header.yNumBricks, @@ -67,8 +67,8 @@ bool BrickManager::readHeader() { _paddedBrickDim = _brickDim + _paddingWidth * 2; _atlasDim = _paddedBrickDim*_numBricks; - LDEBUG(fmt::format("Padded brick dim: {}", _paddedBrickDim)); - LDEBUG(fmt::format("Atlas dim: {}", _atlasDim)); + LDEBUG(std::format("Padded brick dim: {}", _paddedBrickDim)); + LDEBUG(std::format("Atlas dim: {}", _atlasDim)); _numBrickVals = _paddedBrickDim*_paddedBrickDim*_paddedBrickDim; // Number of bricks per frame @@ -81,11 +81,11 @@ bool BrickManager::readHeader() { unsigned int numOTNodes = static_cast((pow(8, numOTLevels) - 1) / 7); unsigned int numBSTNodes = _header.numTimesteps * 2 - 1; _numBricksTree = numOTNodes * numBSTNodes; - LDEBUG(fmt::format("Num OT levels: {}", numOTLevels)); - LDEBUG(fmt::format("Num OT nodes: {}", numOTNodes)); - LDEBUG(fmt::format("Num BST nodes: {}", numBSTNodes)); - LDEBUG(fmt::format("Num bricks in tree: {}", _numBricksTree)); - LDEBUG(fmt::format("Num values per brick: {}", _numBrickVals)); + LDEBUG(std::format("Num OT levels: {}", numOTLevels)); + LDEBUG(std::format("Num OT nodes: {}", numOTNodes)); + LDEBUG(std::format("Num BST nodes: {}", numBSTNodes)); + LDEBUG(std::format("Num bricks in tree: {}", _numBricksTree)); + LDEBUG(std::format("Num values per brick: {}", _numBrickVals)); _brickSize = sizeof(float) * _numBrickVals; _volumeSize = _brickSize * _numBricksFrame; @@ -99,8 +99,8 @@ bool BrickManager::readHeader() { if (fileSize != calcFileSize) { LERROR("Sizes do not match"); - LERROR(fmt::format("Calculated file size: {}", calcFileSize)); - LERROR(fmt::format("File size: {}", fileSize)); + LERROR(std::format("Calculated file size: {}", calcFileSize)); + LERROR(std::format("File size: {}", fileSize)); return false; } diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.cpp b/modules/multiresvolume/rendering/errorhistogrammanager.cpp index bfe0f41156..c2ad719530 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/errorhistogrammanager.cpp @@ -53,7 +53,7 @@ bool ErrorHistogramManager::buildHistograms(int numBins) { _histograms = std::vector(_numInnerNodes); LINFOC( "ErrorHistogramManager", - fmt::format("Build {} histograms with {} bins each", _numInnerNodes, numBins) + std::format("Build {} histograms with {} bins each", _numInnerNodes, numBins) ); // All TSP Leaves diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp index e750f653aa..75d276767f 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp @@ -38,7 +38,7 @@ namespace openspace { LocalErrorHistogramManager::LocalErrorHistogramManager(TSP* tsp) : _tsp(tsp) {} bool LocalErrorHistogramManager::buildHistograms(int numBins) { - LINFO(fmt::format("Build histograms with {} bins each", numBins)); + LINFO(std::format("Build histograms with {} bins each", numBins)); _numBins = numBins; _file = &(_tsp->file()); @@ -133,7 +133,7 @@ bool LocalErrorHistogramManager::buildFromOctreeChild(unsigned int bstOffset, childValues = it->second; } else { - LERROR(fmt::format( + LERROR(std::format( "Child {} visited without cache, {}, {}", childIndex, bstOffset, octreeOffset )); @@ -152,7 +152,7 @@ bool LocalErrorHistogramManager::buildFromOctreeChild(unsigned int bstOffset, parentValues = it->second; } else { - LERROR(fmt::format("Parent {} visited without cache", parentIndex)); + LERROR(std::format("Parent {} visited without cache", parentIndex)); return false; } } @@ -237,7 +237,7 @@ bool LocalErrorHistogramManager::buildFromBstChild(unsigned int bstOffset, childValues = it->second; } else { - LERROR(fmt::format("Child {} visited without cache", childIndex)); + LERROR(std::format("Child {} visited without cache", childIndex)); return false; } } @@ -253,7 +253,7 @@ bool LocalErrorHistogramManager::buildFromBstChild(unsigned int bstOffset, parentValues = it->second; } else { - LERROR(fmt::format("Parent {} visited without cache", parentIndex)); + LERROR(std::format("Parent {} visited without cache", parentIndex)); return false; } } diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index 614757096e..924a59ea24 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -192,7 +192,7 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict _filename = absPath(dictionary.value(KeyDataSource)).string(); } else { - LERROR(fmt::format("Node did not contain a valid '{}'", KeyDataSource)); + LERROR(std::format("Node did not contain a valid '{}'", KeyDataSource)); return; } @@ -245,7 +245,7 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict _transferFunction = std::make_shared(_transferFunctionPath); } else { - LERROR(fmt::format("Node did not contain a valid '{}'", KeyTransferFunction)); + LERROR(std::format("Node did not contain a valid '{}'", KeyTransferFunction)); return; } @@ -474,7 +474,7 @@ bool RenderableMultiresVolume::initializeSelector() { case Selector::TF: if (_errorHistogramManager) { std::filesystem::path cached = FileSys.cacheManager()->cachedFilename( - fmt::format( + std::format( "{}_{}_errorHistograms", std::filesystem::path(_filename).stem().string(), nHistograms ), @@ -485,13 +485,13 @@ bool RenderableMultiresVolume::initializeSelector() { // Read histograms from cache cacheFile.close(); LINFO( - fmt::format("Loading histograms from cache '{}'", cached) + std::format("Loading histograms from cache '{}'", cached) ); success &= _errorHistogramManager->loadFromFile(cached); } else if (!_errorHistogramsPath.empty()) { // Read histograms from scene data - LINFO(fmt::format( + LINFO(std::format( "Loading histograms from scene data '{}'", _errorHistogramsPath )); success &= _errorHistogramManager->loadFromFile( @@ -500,10 +500,10 @@ bool RenderableMultiresVolume::initializeSelector() { } else { // Build histograms from tsp file - LWARNING(fmt::format("Failed to open '{}'", cached)); + LWARNING(std::format("Failed to open '{}'", cached)); success &= _errorHistogramManager->buildHistograms(nHistograms); if (success) { - LINFO(fmt::format("Writing cache to '{}'", cached)); + LINFO(std::format("Writing cache to '{}'", cached)); _errorHistogramManager->saveToFile(cached); } } @@ -514,7 +514,7 @@ bool RenderableMultiresVolume::initializeSelector() { case Selector::SIMPLE: if (_histogramManager) { std::filesystem::path cached = FileSys.cacheManager()->cachedFilename( - fmt::format("{}_{}_histogram", + std::format("{}_{}_histogram", std::filesystem::path(_filename).stem().string(), nHistograms ), "" @@ -523,18 +523,18 @@ bool RenderableMultiresVolume::initializeSelector() { if (cacheFile.is_open()) { // Read histograms from cache. cacheFile.close(); - LINFO(fmt::format("Loading histograms from '{}'", cached)); + LINFO(std::format("Loading histograms from '{}'", cached)); success &= _histogramManager->loadFromFile(cached); } else { // Build histograms from tsp file. - LWARNING(fmt::format("Failed to open '{}'", cached)); + LWARNING(std::format("Failed to open '{}'", cached)); success &= _histogramManager->buildHistograms( _tsp.get(), nHistograms ); if (success) { - LINFO(fmt::format("Writing cache to '{}'", cached)); + LINFO(std::format("Writing cache to '{}'", cached)); _histogramManager->saveToFile(cached); } } @@ -545,7 +545,7 @@ bool RenderableMultiresVolume::initializeSelector() { case Selector::LOCAL: if (_localErrorHistogramManager) { std::filesystem::path cached = FileSys.cacheManager()->cachedFilename( - fmt::format( + std::format( "{}_{}_localErrorHistograms", std::filesystem::path(_filename).stem().string(), nHistograms ), @@ -555,15 +555,15 @@ bool RenderableMultiresVolume::initializeSelector() { if (cacheFile.is_open()) { // Read histograms from cache. cacheFile.close(); - LINFO(fmt::format("Loading histograms from '{}'", cached)); + LINFO(std::format("Loading histograms from '{}'", cached)); success &= _localErrorHistogramManager->loadFromFile(cached); } else { // Build histograms from tsp file. - LWARNING(fmt::format("Failed to open '{}'", cached)); + LWARNING(std::format("Failed to open '{}'", cached)); success &= _localErrorHistogramManager->buildHistograms(nHistograms); if (success) { - LINFO(fmt::format("Writing cache to '{}'", cached)); + LINFO(std::format("Writing cache to '{}'", cached)); _localErrorHistogramManager->saveToFile(cached); } } diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index 37f1ad074e..a51c26d064 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -96,12 +96,12 @@ bool TSP::readHeader() { _file.read(reinterpret_cast(&_header), sizeof(Header)); - LDEBUG(fmt::format("Grid type: {}", _header.gridType)); - LDEBUG(fmt::format( + LDEBUG(std::format("Grid type: {}", _header.gridType)); + LDEBUG(std::format( "Brick dimensions: {} {} {}", _header.xBrickDim, _header.yBrickDim, _header.zBrickDim )); - LDEBUG(fmt::format( + LDEBUG(std::format( "Num bricks: {} {} {}", _header.xNumBricks, _header.yNumBricks, _header.zNumBricks )); @@ -118,15 +118,15 @@ bool TSP::readHeader() { _numBSTNodes = _header.numTimesteps * 2 - 1; _numTotalNodes = _numOTNodes * _numBSTNodes; - LDEBUG(fmt::format("Num OT levels: {}", _numOTLevels)); - LDEBUG(fmt::format("Num OT nodes: {}", _numOTNodes)); - LDEBUG(fmt::format("Num BST levels: {}", _numBSTLevels)); - LDEBUG(fmt::format("Num BST nodes: {}", _numBSTNodes)); - LDEBUG(fmt::format("Num total nodes: {}", _numTotalNodes)); + LDEBUG(std::format("Num OT levels: {}", _numOTLevels)); + LDEBUG(std::format("Num OT nodes: {}", _numOTNodes)); + LDEBUG(std::format("Num BST levels: {}", _numBSTLevels)); + LDEBUG(std::format("Num BST nodes: {}", _numBSTNodes)); + LDEBUG(std::format("Num total nodes: {}", _numTotalNodes)); // Allocate space for TSP structure _data.resize(_numTotalNodes*NUM_DATA); - LDEBUG(fmt::format("Data size: {}", _data.size())); + LDEBUG(std::format("Data size: {}", _data.size())); return true; } @@ -385,9 +385,9 @@ bool TSP::calculateSpatialError() { _maxSpatialError = maxNorm; _medianSpatialError = medNorm; - LDEBUG(fmt::format("Min normalized spatial std dev: {}", minNorm)); - LDEBUG(fmt::format("Max normalized spatial std dev: {}", maxNorm)); - LDEBUG(fmt::format("Median normalized spatial std dev: {}", medNorm)); + LDEBUG(std::format("Min normalized spatial std dev: {}", minNorm)); + LDEBUG(std::format("Max normalized spatial std dev: {}", maxNorm)); + LDEBUG(std::format("Median normalized spatial std dev: {}", medNorm)); return true; } @@ -496,9 +496,9 @@ bool TSP::calculateTemporalError() { _maxTemporalError = maxNorm; _medianTemporalError = medNorm; - LDEBUG(fmt::format("Min normalized temporal std dev: {}", minNorm)); - LDEBUG(fmt::format("Max normalized temporal std dev: {}", maxNorm)); - LDEBUG(fmt::format("Median normalized temporal std dev: {}", medNorm)); + LDEBUG(std::format("Min normalized temporal std dev: {}", minNorm)); + LDEBUG(std::format("Max normalized temporal std dev: {}", maxNorm)); + LDEBUG(std::format("Median normalized temporal std dev: {}", medNorm)); return true; } @@ -514,7 +514,7 @@ bool TSP::readCache() { std::ifstream file(cacheFilename, std::ios::in | std::ios::binary); if (!file.is_open()) { - LWARNING(fmt::format("Failed to open {}", cacheFilename)); + LWARNING(std::format("Failed to open {}", cacheFilename)); return false; } @@ -530,12 +530,12 @@ bool TSP::readCache() { file.close(); LDEBUG("Cached errors:"); - LDEBUG(fmt::format("Min spatial error: {}", _minSpatialError)); - LDEBUG(fmt::format("Max spatial error: {}", _maxSpatialError)); - LDEBUG(fmt::format("Median spatial error: {}", _medianSpatialError)); - LDEBUG(fmt::format("Min temporal error: {}", _minTemporalError)); - LDEBUG(fmt::format("Max temporal error: {}", _maxTemporalError)); - LDEBUG(fmt::format("Median temporal error: {}", _medianTemporalError)); + LDEBUG(std::format("Min spatial error: {}", _minSpatialError)); + LDEBUG(std::format("Max spatial error: {}", _maxSpatialError)); + LDEBUG(std::format("Median spatial error: {}", _medianSpatialError)); + LDEBUG(std::format("Min temporal error: {}", _minTemporalError)); + LDEBUG(std::format("Max temporal error: {}", _maxTemporalError)); + LDEBUG(std::format("Median temporal error: {}", _medianTemporalError)); return true; } @@ -552,10 +552,10 @@ bool TSP::writeCache() { std::ofstream file(cacheFilename, std::ios::out | std::ios::binary); if (!file.is_open()) { - LWARNING(fmt::format("Failed to open {}", cacheFilename)); + LWARNING(std::format("Failed to open {}", cacheFilename)); return false; } - LINFO(fmt::format("Writing cache to {}", cacheFilename)); + LINFO(std::format("Writing cache to {}", cacheFilename)); file.write(reinterpret_cast(&_minSpatialError), sizeof(float)); file.write(reinterpret_cast(&_maxSpatialError), sizeof(float)); diff --git a/modules/server/src/connection.cpp b/modules/server/src/connection.cpp index 41526cfb34..37e1f2709d 100644 --- a/modules/server/src/connection.cpp +++ b/modules/server/src/connection.cpp @@ -50,8 +50,8 @@ #include #include #include +#include #include -#include namespace { constexpr std::string_view _loggerCat = "ServerModule: Connection"; @@ -114,11 +114,11 @@ void Connection::handleMessage(const std::string& message) { handleJson(j); } catch (const std::domain_error& e) { - LERROR(fmt::format("JSON handling error from: {}. {}", message, e.what())); + LERROR(std::format("JSON handling error from: {}. {}", message, e.what())); } } catch (const std::out_of_range& e) { - LERROR(fmt::format("JSON handling error from: {}. {}", message, e.what())); + LERROR(std::format("JSON handling error from: {}. {}", message, e.what())); } catch (const std::exception& e) { LERROR(e.what()); @@ -126,7 +126,7 @@ void Connection::handleMessage(const std::string& message) { catch (...) { if (!isAuthorized()) { _socket->disconnect(); - LERROR(fmt::format( + LERROR(std::format( "Could not parse JSON '{}'. Connection is unauthorized. Disconnecting", message )); @@ -142,7 +142,7 @@ void Connection::handleMessage(const std::string& message) { return std::isprint(c, std::locale("")) ? char(c) : ' '; } ); - LERROR(fmt::format("Could not parse JSON '{}'", sanitizedString)); + LERROR(std::format("Could not parse JSON '{}'", sanitizedString)); } } diff --git a/modules/server/src/topics/flightcontrollertopic.cpp b/modules/server/src/topics/flightcontrollertopic.cpp index f1b1e75fa7..7deecc1773 100644 --- a/modules/server/src/topics/flightcontrollertopic.cpp +++ b/modules/server/src/topics/flightcontrollertopic.cpp @@ -175,7 +175,7 @@ void FlightControllerTopic::handleJson(const nlohmann::json& json) { auto it = CommandMap.find(json[TypeKey]); if (it == CommandMap.end()) { LWARNING( - fmt::format("Malformed JSON command: no '{}' in payload", TypeKey) + std::format("Malformed JSON command: no '{}' in payload", TypeKey) ); return; } @@ -203,7 +203,7 @@ void FlightControllerTopic::handleJson(const nlohmann::json& json) { processLua(json[Lua]); break; default: - LWARNING(fmt::format("Unrecognized action: {}", it->first)); + LWARNING(std::format("Unrecognized action: {}", it->first)); break; } } @@ -270,14 +270,14 @@ void FlightControllerTopic::changeFocus(const nlohmann::json& json) const { if (json.find(FocusKey) == json.end()) { const std::string j = json; LWARNING( - fmt::format("Could not find '{}' key in JSON. JSON was:\n{}", FocusKey, j) + std::format("Could not find '{}' key in JSON. JSON was:\n{}", FocusKey, j) ); if (json.find(AimKey) == json.end()) { LWARNING( - fmt::format("Could not find '{}' key in JSON. JSON was:\n{}", AimKey, j) + std::format("Could not find '{}' key in JSON. JSON was:\n{}", AimKey, j) ); if (json.find(AnchorKey) == json.end()) { - LWARNING(fmt::format( + LWARNING(std::format( "Could not find '{}' key in JSON. JSON was:\n{}", AnchorKey, j )); return; @@ -324,7 +324,7 @@ void FlightControllerTopic::setRenderableEnabled(const nlohmann::json& json) con if (json[RenderableKey].find(SceneNodeName) == json[RenderableKey].end()) { const std::string j = json; LWARNING( - fmt::format("Could not find '{}' key in JSON. JSON was:\n{}", FocusKey, j) + std::format("Could not find '{}' key in JSON. JSON was:\n{}", FocusKey, j) ); return; } @@ -393,7 +393,7 @@ void FlightControllerTopic::engageAutopilot(const nlohmann::json &json) { const auto mapIt = AxisIndexMap.find(it.key()); if (mapIt == AxisIndexMap.end()) { if (it.key() != TypeKey || CommandMap.find(it.value()) == CommandMap.end()) { - LWARNING(fmt::format( + LWARNING(std::format( "No axis, button, or command named '{}' (value: {})", it.key(), static_cast(it.value()) )); @@ -433,7 +433,7 @@ void FlightControllerTopic::processInputState(const nlohmann::json& json) { const auto mapIt = AxisIndexMap.find(it.key()); if (mapIt == AxisIndexMap.end()) { if (it.key() != TypeKey || CommandMap.find(it.value()) == CommandMap.end()) { - LWARNING(fmt::format( + LWARNING(std::format( "No axis, button, or command named '{}' (value: {})", it.key() , static_cast(it.value()) )); diff --git a/modules/server/src/topics/getpropertytopic.cpp b/modules/server/src/topics/getpropertytopic.cpp index 2bf2866c0c..4c0f037ba6 100644 --- a/modules/server/src/topics/getpropertytopic.cpp +++ b/modules/server/src/topics/getpropertytopic.cpp @@ -100,7 +100,7 @@ json GetPropertyTopic::propertyFromKey(const std::string& key) { return wrappedPayload(prop); } - return wrappedError(fmt::format("Property '{}' not found", key), 404); + return wrappedError(std::format("Property '{}' not found", key), 404); } } // namespace openspace diff --git a/modules/server/src/topics/luascripttopic.cpp b/modules/server/src/topics/luascripttopic.cpp index d4ab44aec3..bb0ac24bd4 100644 --- a/modules/server/src/topics/luascripttopic.cpp +++ b/modules/server/src/topics/luascripttopic.cpp @@ -102,7 +102,7 @@ namespace { return formatArrayAsLuaTable(it->get()); } if (it->is_number()) { - return fmt::format("{}", it->get()); + return std::format("{}", it->get()); } if (it->is_string()) { return formatLuaString(it->get()); diff --git a/modules/server/src/topics/setpropertytopic.cpp b/modules/server/src/topics/setpropertytopic.cpp index 12a34b3b4d..4c2d84612f 100644 --- a/modules/server/src/topics/setpropertytopic.cpp +++ b/modules/server/src/topics/setpropertytopic.cpp @@ -123,7 +123,7 @@ void SetPropertyTopic::handleJson(const nlohmann::json& json) { std::string literal = luaLiteralFromJson(value); global::scriptEngine->queueScript( - fmt::format( + std::format( "openspace.setPropertyValueSingle(\"{}\", {})", propertyKey, literal ), scripting::ScriptEngine::ShouldBeSynchronized::Yes, diff --git a/modules/server/src/topics/subscriptiontopic.cpp b/modules/server/src/topics/subscriptiontopic.cpp index 0eba60161c..383f695e9f 100644 --- a/modules/server/src/topics/subscriptiontopic.cpp +++ b/modules/server/src/topics/subscriptiontopic.cpp @@ -92,7 +92,7 @@ void SubscriptionTopic::handleJson(const nlohmann::json& json) { onChange(); } else { - LWARNING(fmt::format("Could not subscribe. Property '{}' not found", key)); + LWARNING(std::format("Could not subscribe. Property '{}' not found", key)); } } if (event == StopSubscription) { diff --git a/modules/server/src/topics/triggerpropertytopic.cpp b/modules/server/src/topics/triggerpropertytopic.cpp index a7d4e00445..c20f0afdfa 100644 --- a/modules/server/src/topics/triggerpropertytopic.cpp +++ b/modules/server/src/topics/triggerpropertytopic.cpp @@ -41,7 +41,7 @@ void TriggerPropertyTopic::handleJson(const nlohmann::json& json) { try { const std::string& propertyKey = json.at("property").get(); global::scriptEngine->queueScript( - fmt::format( + std::format( "openspace.setPropertyValueSingle(\"{}\", nil)", propertyKey ), scripting::ScriptEngine::ShouldBeSynchronized::Yes, diff --git a/modules/skybrowser/skybrowsermodule.cpp b/modules/skybrowser/skybrowsermodule.cpp index 27983cfe07..693d9566ea 100644 --- a/modules/skybrowser/skybrowsermodule.cpp +++ b/modules/skybrowser/skybrowsermodule.cpp @@ -350,7 +350,7 @@ void SkyBrowserModule::moveHoverCircle(const std::string& imageUrl, bool useScri // Show the circle if (useScript) { - const std::string script = fmt::format( + const std::string script = std::format( "openspace.setPropertyValueSingle('Scene.{}.Renderable.Fade', 1.0);", id ); @@ -374,7 +374,7 @@ void SkyBrowserModule::moveHoverCircle(const std::string& imageUrl, bool useScri pos *= skybrowser::CelestialSphereRadius * 1.1; // Note that the position can only be set through the script engine - const std::string script = fmt::format( + const std::string script = std::format( "openspace.setPropertyValueSingle('Scene.{}.Translation.Position', {});", id, ghoul::to_string(pos) ); @@ -388,7 +388,7 @@ void SkyBrowserModule::moveHoverCircle(const std::string& imageUrl, bool useScri void SkyBrowserModule::disableHoverCircle(bool useScript) { if (_hoverCircle && _hoverCircle->renderable()) { if (useScript) { - const std::string script = fmt::format( + const std::string script = std::format( "openspace.setPropertyValueSingle('Scene.{}.Renderable.Fade', 0.0);", _hoverCircle->identifier() ); @@ -439,7 +439,7 @@ TargetBrowserPair* SkyBrowserModule::pair(std::string_view id) const { ); TargetBrowserPair* found = it != _targetsBrowsers.end() ? it->get() : nullptr; if (found == nullptr) { - LINFO(fmt::format("Identifier '{}' not found", id)); + LINFO(std::format("Identifier '{}' not found", id)); } return found; } diff --git a/modules/skybrowser/skybrowsermodule_lua.inl b/modules/skybrowser/skybrowsermodule_lua.inl index 32c72c36c5..f5894e5fba 100644 --- a/modules/skybrowser/skybrowsermodule_lua.inl +++ b/modules/skybrowser/skybrowsermodule_lua.inl @@ -111,7 +111,7 @@ std::string prunedIdentifier(std::string identifier) { imageUrl ); if (!found.has_value()) { - LINFO(fmt::format( + LINFO(std::format( "No image with identifier '{}' was found in the collection.", imageUrl )); return; @@ -160,7 +160,7 @@ std::string prunedIdentifier(std::string identifier) { SceneGraphNode* circle = global::renderEngine->scene()->sceneGraphNode(identifier); if (!circle) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Could not find node to set as hover circle: {}", identifier )); } @@ -242,7 +242,7 @@ std::string prunedIdentifier(std::string identifier) { for (const std::unique_ptr& pair : pairs) { std::string id = pair->browserId(); glm::ivec3 color = pair->borderColor(); - std::string script = fmt::format( + std::string script = std::format( "openspace.skybrowser.setBorderColor('{}', {}, {}, {})", id, color.r, color.g, color.b ); diff --git a/modules/skybrowser/src/browser.cpp b/modules/skybrowser/src/browser.cpp index a9db81735b..333f840c50 100644 --- a/modules/skybrowser/src/browser.cpp +++ b/modules/skybrowser/src/browser.cpp @@ -142,7 +142,7 @@ void Browser::deinitializeGL() { _texture = nullptr; - LDEBUG(fmt::format("Deinitializing browser '{}'", _url.value())); + LDEBUG(std::format("Deinitializing browser '{}'", _url.value())); _browserInstance->close(true); diff --git a/modules/skybrowser/src/screenspaceskybrowser.cpp b/modules/skybrowser/src/screenspaceskybrowser.cpp index 1e03e88ebb..ebe5db7eb8 100644 --- a/modules/skybrowser/src/screenspaceskybrowser.cpp +++ b/modules/skybrowser/src/screenspaceskybrowser.cpp @@ -221,7 +221,7 @@ bool ScreenSpaceSkyBrowser::shouldUpdateWhileTargetAnimates() const { void ScreenSpaceSkyBrowser::setIdInBrowser() const { int currentNode = global::windowDelegate->currentNode(); - WwtCommunicator::setIdInBrowser(fmt::format("{}_{}", identifier(), currentNode)); + WwtCommunicator::setIdInBrowser(std::format("{}_{}", identifier(), currentNode)); } void ScreenSpaceSkyBrowser::setIsInitialized(bool isInitialized) { diff --git a/modules/skybrowser/src/targetbrowserpair.cpp b/modules/skybrowser/src/targetbrowserpair.cpp index e2a4ac1e70..acd3430e92 100644 --- a/modules/skybrowser/src/targetbrowserpair.cpp +++ b/modules/skybrowser/src/targetbrowserpair.cpp @@ -45,7 +45,7 @@ namespace { const glm::dvec3 positionCelestial = glm::normalize(direction) * openspace::skybrowser::CelestialSphereRadius; - const std::string script = fmt::format( + const std::string script = std::format( "openspace.setPropertyValueSingle('Scene.{}.Translation.Position', {});", id, ghoul::to_string(positionCelestial) ); @@ -322,7 +322,7 @@ void TargetBrowserPair::incrementallyAnimateToCoordinate() { } void TargetBrowserPair::startFading(float goal, float fadeTime) { - const std::string script = fmt::format( + const std::string script = std::format( "openspace.setPropertyValueSingle('Scene.{0}.Renderable.Fade', {2}, {3});" "openspace.setPropertyValueSingle('ScreenSpace.{1}.Fade', {2}, {3});", _targetNode->identifier(), _browser->identifier(), goal, fadeTime diff --git a/modules/skybrowser/src/wwtcommunicator.cpp b/modules/skybrowser/src/wwtcommunicator.cpp index aee43cce12..3507f2f513 100644 --- a/modules/skybrowser/src/wwtcommunicator.cpp +++ b/modules/skybrowser/src/wwtcommunicator.cpp @@ -187,7 +187,7 @@ void WwtCommunicator::removeSelectedImage(const std::string& imageUrl) { void WwtCommunicator::sendMessageToWwt(const ghoul::Dictionary& msg) const { std::string m = ghoul::formatJson(msg); - executeJavascript(fmt::format("sendMessageToWWT({});", m)); + executeJavascript(std::format("sendMessageToWWT({});", m)); } std::vector WwtCommunicator::selectedImages() const { @@ -239,12 +239,12 @@ void WwtCommunicator::setBorderColor(glm::ivec3 color) { void WwtCommunicator::setBorderRadius(double radius) { _borderRadius = radius; - const std::string scr = fmt::format("setBorderRadius({});", radius); + const std::string scr = std::format("setBorderRadius({});", radius); executeJavascript(scr); } void WwtCommunicator::updateBorderColor() const { - const std::string script = fmt::format( + const std::string script = std::format( "setBackgroundColor('rgb({},{},{})');", _wwtBorderColor.x, _wwtBorderColor.y, _wwtBorderColor.z ); @@ -348,7 +348,7 @@ void WwtCommunicator::setImageCollectionIsLoaded(bool isLoaded) { void WwtCommunicator::setIdInBrowser(const std::string& id) const { // Send ID to its browser - executeJavascript(fmt::format("setId('{}')", id)); + executeJavascript(std::format("setId('{}')", id)); } glm::ivec3 WwtCommunicator::borderColor() const { diff --git a/modules/skybrowser/src/wwtdatahandler.cpp b/modules/skybrowser/src/wwtdatahandler.cpp index 0390b3fcbf..7da2fe075b 100644 --- a/modules/skybrowser/src/wwtdatahandler.cpp +++ b/modules/skybrowser/src/wwtdatahandler.cpp @@ -135,7 +135,7 @@ namespace { const std::filesystem::path file = directory.string() + fileName + ".aspx"; const bool success = downloadFile(url, file); if (!success) { - LINFO(fmt::format( + LINFO(std::format( "Could not download file '{}' to directory '{}'", url, directory )); return false; @@ -154,7 +154,7 @@ namespace { // If the file contains no folders, or there are folders but without urls, // stop recursion if (!folderExists || folderContainNoUrls) { - LINFO(fmt::format("Saving '{}'", url)); + LINFO(std::format("Saving '{}'", url)); return true; } @@ -261,7 +261,7 @@ void WwtDataHandler::loadImages(const std::string& root, // 1. if (!directoryExists(directory)) { - LINFO(fmt::format("Creating directory '{}'", directory)); + LINFO(std::format("Creating directory '{}'", directory)); std::filesystem::create_directory(directory); } @@ -291,7 +291,7 @@ void WwtDataHandler::loadImages(const std::string& root, // Check if the hash has changed. This will be ignored if either the local of remote // hash does not exist if (!localHash.empty() && !remoteHash.empty() && localHash != remoteHash) { - LINFO(fmt::format( + LINFO(std::format( "Local hash '{}' differs from remote hash '{}'. Cleaning directory", localHash, remoteHash )); @@ -338,7 +338,7 @@ void WwtDataHandler::loadImages(const std::string& root, _images[imageVector[i].imageUrl].identifier = std::to_string(i); } - LINFO(fmt::format("Loaded {} WorldWide Telescope images", _images.size())); + LINFO(std::format("Loaded {} WorldWide Telescope images", _images.size())); } int WwtDataHandler::nLoadedImages() const { @@ -380,7 +380,7 @@ void WwtDataHandler::saveImagesFromXml(const tinyxml2::XMLElement* root, // If node is another folder, open recursively else if (name == Folder) { const std::string nodeName = attribute(node, Name); - const std::string newCollectionName = fmt::format( + const std::string newCollectionName = std::format( "{}/{}", collection, nodeName ); saveImagesFromXml(node, newCollectionName); diff --git a/modules/space/horizonsfile.cpp b/modules/space/horizonsfile.cpp index 1bf0cf13ca..7fc790b4b0 100644 --- a/modules/space/horizonsfile.cpp +++ b/modules/space/horizonsfile.cpp @@ -96,7 +96,7 @@ std::string constructHorizonsUrl(HorizonsType type, const std::string& target, break; } - url += fmt::format( + url += std::format( "{}'{}'{}'{}'{}'{}'{}'{}'", Command, ghoul::encodeUrl(target), Center, ghoul::encodeUrl(observer), @@ -105,10 +105,10 @@ std::string constructHorizonsUrl(HorizonsType type, const std::string& target, ); if (unit.empty()) { - url += fmt::format("{}'{}'", StepSize, ghoul::encodeUrl(stepSize)); + url += std::format("{}'{}'", StepSize, ghoul::encodeUrl(stepSize)); } else { - url += fmt::format( + url += std::format( "{}'{}%20{}'", StepSize, ghoul::encodeUrl(stepSize), unit ); } @@ -130,7 +130,7 @@ json sendHorizonsRequest(const std::string& url, const std::filesystem::path& fi bool failed = false; dl->wait(); if (!dl->hasSucceeded()) { - LERROR(fmt::format("Error downloading horizons file with URL '{}'", dl->url())); + LERROR(std::format("Error downloading horizons file with URL '{}'", dl->url())); failed = true; } @@ -163,7 +163,7 @@ HorizonsResultCode isValidHorizonsAnswer(const json& answer) { if (auto signature = answer.find("signature"); signature != answer.end()) { if (auto source = signature->find("source"); source != signature->end()) { if (*source != static_cast(ApiSource)) { - LWARNING(fmt::format( + LWARNING(std::format( "Horizons answer from unknown source '{}'", source->dump() )); } @@ -178,7 +178,7 @@ HorizonsResultCode isValidHorizonsAnswer(const json& answer) { v = v.substr(0, v.find('.')); if (v != CurrentMajorVersion) { - LWARNING(fmt::format( + LWARNING(std::format( "Unknown Horizons major version '{}' found. The currently supported " "major version is {}", version->dump(), CurrentMajorVersion )); @@ -388,7 +388,7 @@ void HorizonsFile::displayErrorMessage(HorizonsResultCode code) const { break; } - LINFO(fmt::format( + LINFO(std::format( "Valid time range is '{}' to '{}'", validTimeRange.first, validTimeRange.second )); @@ -423,7 +423,7 @@ void HorizonsFile::displayErrorMessage(HorizonsResultCode code) const { for (const std::string& station : matchingstations) { matches += '\n' + station; } - LINFO(fmt::format("Matching Observer Stations: {}", matches)); + LINFO(std::format("Matching Observer Stations: {}", matches)); break; } case HorizonsResultCode::MultipleObserver: { @@ -440,7 +440,7 @@ void HorizonsFile::displayErrorMessage(HorizonsResultCode code) const { for (const std::string& observer : matchingObservers) { matches += '\n' + observer; } - LINFO(fmt::format("Matching Observers: {}", matches)); + LINFO(std::format("Matching Observers: {}", matches)); break; } case HorizonsResultCode::ErrorNoTarget: @@ -471,7 +471,7 @@ void HorizonsFile::displayErrorMessage(HorizonsResultCode code) const { for (const std::string& target : matchingTargets) { matches += '\n' + target; } - LINFO(fmt::format("Matching targets: {}", matches)); + LINFO(std::format("Matching targets: {}", matches)); break; } case HorizonsResultCode::UnknownError: @@ -495,7 +495,7 @@ HorizonsResult readHorizonsFile(std::filesystem::path file) { std::ifstream fileStream(file); if (!fileStream.good()) { - LERROR(fmt::format("Failed to open Horizons file '{}'", file)); + LERROR(std::format("Failed to open Horizons file '{}'", file)); return HorizonsResult(); } @@ -527,7 +527,7 @@ HorizonsResult readHorizonsVectorFile(std::filesystem::path file) { std::ifstream fileStream(file); if (!fileStream.good()) { - LERROR(fmt::format("Failed to open Horizons text file {}", file)); + LERROR(std::format("Failed to open Horizons text file {}", file)); return HorizonsResult(); } @@ -557,7 +557,7 @@ HorizonsResult readHorizonsVectorFile(std::filesystem::path file) { // Get next line of same data point std::getline(fileStream, line); if (!fileStream.good()) { - LERROR(fmt::format("Malformed Horizons file '{}'", file)); + LERROR(std::format("Malformed Horizons file '{}'", file)); return HorizonsResult(); } std::stringstream str2(line); @@ -569,7 +569,7 @@ HorizonsResult readHorizonsVectorFile(std::filesystem::path file) { str2 >> xPos >> yPos >> zPos; // Convert date and time to seconds after 2000 - const std::string timeString = fmt::format("{} {}", date, time); + const std::string timeString = std::format("{} {}", date, time); const double timeInJ2000 = Time::convertTime(timeString); glm::dvec3 pos = glm::dvec3(1000 * xPos, 1000 * yPos, 1000 * zPos); const glm::dmat3 transform = @@ -596,7 +596,7 @@ HorizonsResult readHorizonsObserverFile(std::filesystem::path file) { std::ifstream fileStream(file); if (!fileStream.good()) { - LERROR(fmt::format("Failed to open Horizons text file '{}'", file)); + LERROR(std::format("Failed to open Horizons text file '{}'", file)); return HorizonsResult(); } @@ -631,7 +631,7 @@ HorizonsResult readHorizonsObserverFile(std::filesystem::path file) { // Convert date and time to seconds after 2000 // and pos to Galactic positions in meter from Observer. - const std::string timeString = fmt::format("{} {}", date, time); + const std::string timeString = std::format("{} {}", date, time); // Add position to stored data dataPoint.time = Time::convertTime(timeString); @@ -793,10 +793,10 @@ std::pair HorizonsFile::parseValidTimeRange( // Parse time stamps backwards // Format: Trajectory file Name, Start, End (yyyy-mon-dd hh:mm) if (hasTime && words.size() > 4) { - startTime = fmt::format( + startTime = std::format( "{} T {}", words[words.size() - 4], words[words.size() - 3] ); - endTime = fmt::format( + endTime = std::format( "{} T {}", words[words.size() - 2], words[words.size() - 1] ); } @@ -831,7 +831,7 @@ std::pair HorizonsFile::parseValidTimeRange( // Parse time stamps backwards // Format: Trajectory file Name, Start, End (yyyy-mon-dd hh:mm) if (hasTime && words.size() > 4) { - endTime = fmt::format( + endTime = std::format( "{} T {}", words[words.size() - 2], words[words.size() - 1] ); } diff --git a/modules/space/kepler.cpp b/modules/space/kepler.cpp index 280352004f..7c5059585b 100644 --- a/modules/space/kepler.cpp +++ b/modules/space/kepler.cpp @@ -212,7 +212,7 @@ namespace { // https://github.com/eliaskosunen/scnlib/issues/104 is fixed auto res = scn::scan(e, "{:2d}{}"); if (!res) { - throw ghoul::RuntimeError(fmt::format("Error parsing epoch '{}'", epoch)); + throw ghoul::RuntimeError(std::format("Error parsing epoch '{}'", epoch)); } auto [year, daysInYear] = res->values(); year += year > 57 ? 1900 : 2000; @@ -269,7 +269,7 @@ namespace { const std::string format = (nDashes == 2) ? "{:4}-{:2}-{:2}{}" : "{:4}{:2}{:2}{}"; auto res = scn::scan(e, scn::runtime_format(format)); if (!res) { - throw ghoul::RuntimeError(fmt::format("Error parsing epoch '{}'", epoch)); + throw ghoul::RuntimeError(std::format("Error parsing epoch '{}'", epoch)); } auto [year, monthNum, dayOfMonthNum, fractionOfDay] = res->values(); const int daysSince2000 = countDays(year); @@ -338,7 +338,7 @@ namespace { epoch, "{:4d}-{:2d}-{:2d}T{:2d}:{:2d}:{}" ); if (!res) { - throw ghoul::RuntimeError(fmt::format("Error parsing epoch '{}'", epoch)); + throw ghoul::RuntimeError(std::format("Error parsing epoch '{}'", epoch)); } std::tie(date.year, month, days, date.hours, date.minutes, date.seconds) = res->values(); @@ -354,13 +354,13 @@ namespace { //date.year, date.nDays, date.hours, date.minutes, date.seconds ); if (!res) { - throw ghoul::RuntimeError(fmt::format("Error parsing epoch '{}'", epoch)); + throw ghoul::RuntimeError(std::format("Error parsing epoch '{}'", epoch)); } std::tie(date.year, date.nDays, date.hours, date.minutes, date.seconds) = res->values(); } else { - throw ghoul::RuntimeError(fmt::format("Malformed epoch string '{}'", epoch)); + throw ghoul::RuntimeError(std::format("Malformed epoch string '{}'", epoch)); } const int daysSince2000 = countDays(date.year); @@ -430,7 +430,7 @@ std::vector readTleFile(const std::filesystem::path& file) { std::string firstLine; std::getline(f, firstLine); if (f.bad() || firstLine[0] != '1') { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Malformed TLE file '{}' at line {}", file, lineNum + 1 )); } @@ -442,7 +442,7 @@ std::vector readTleFile(const std::filesystem::path& file) { const int year = std::atoi(y.c_str()); return year >= 57 ? "19" : "20"; }(); - p.id = fmt::format("{}{}-{}", prefix, id.substr(0, 2), id.substr(3)); + p.id = std::format("{}{}-{}", prefix, id.substr(0, 2), id.substr(3)); } p.epoch = epochFromSubstring(firstLine.substr(18, 14)); // should be 13? @@ -462,7 +462,7 @@ std::vector readTleFile(const std::filesystem::path& file) { std::string secondLine; std::getline(f, secondLine); if (f.bad() || secondLine[0] != '2') { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Malformed TLE file '{}' at line {}", file, lineNum + 1 )); } @@ -534,7 +534,7 @@ std::vector readOmmFile(const std::filesystem::path& file) { } if (parts.size() != 2) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Malformed line '{}' at {}", line, lineNum )); } @@ -543,7 +543,7 @@ std::vector readOmmFile(const std::filesystem::path& file) { if (parts[1] != "2.0") { LWARNINGC( "OMM", - fmt::format( + std::format( "Only version 2.0 is currently supported but found {}. " "Parsing might fail", parts[1] @@ -617,7 +617,7 @@ std::vector readSbdbFile(const std::filesystem::path& file) { // Newer versions downloaded from the JPL SBDB website have " around variables line.erase(remove(line.begin(), line.end(), '\"'), line.end()); if (line != ExpectedHeader) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Expected JPL SBDB file to start with '{}' but found '{}' instead", ExpectedHeader, line.substr(0, 100) )); @@ -629,7 +629,7 @@ std::vector readSbdbFile(const std::filesystem::path& file) { std::vector parts = ghoul::tokenizeString(line, ','); if (parts.size() != NDataFields) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Malformed line {}, expected 8 data fields, got {}", line, parts.size() )); } @@ -742,7 +742,7 @@ std::optional> loadCache(const std::filesystem::path& fi std::vector readFile(std::filesystem::path file, Format format) { std::filesystem::path cachedFile = FileSys.cacheManager()->cachedFilename(file); if (std::filesystem::is_regular_file(cachedFile)) { - LINFO(fmt::format( + LINFO(std::format( "Cached file '{}' used for Kepler file '{}'", cachedFile, file )); @@ -767,7 +767,7 @@ std::vector readFile(std::filesystem::path file, Format format) { break; } - LINFO(fmt::format("Saving cache '{}' for Kepler file '{}'", cachedFile, file)); + LINFO(std::format("Saving cache '{}' for Kepler file '{}'", cachedFile, file)); saveCache(res, cachedFile); return res; } diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index a822d4801c..a0ad6493ec 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -114,7 +114,7 @@ void RenderableConstellationBounds::initialize() { if (it == options.end()) { // The user has specified a constellation name that doesn't exist - LWARNING(fmt::format( + LWARNING(std::format( "Option '{}' not found in list of constellations", s )); } @@ -257,7 +257,7 @@ bool RenderableConstellationBounds::loadVertexFile() { if (!s.good()) { // If this evaluates to true, the stream was not completely filled, which // means that the line was incomplete, so there was an error - LERROR(fmt::format( + LERROR(std::format( "Error reading file '{}' at line #{}", fileName, currentLineNumber )); break; diff --git a/modules/space/rendering/renderableconstellationlines.cpp b/modules/space/rendering/renderableconstellationlines.cpp index f7e0218ada..7e35fac3c9 100644 --- a/modules/space/rendering/renderableconstellationlines.cpp +++ b/modules/space/rendering/renderableconstellationlines.cpp @@ -198,7 +198,7 @@ void RenderableConstellationLines::initialize() { if (it == options.end()) { // The user has specified a constellation name that doesn't exist - LWARNING(fmt::format( + LWARNING(std::format( "Option '{}' not found in list of constellations", s )); } @@ -314,10 +314,10 @@ bool RenderableConstellationLines::readSpeckFile() { } std::filesystem::path fileName = absPath(_speckFile); - LINFO(fmt::format("Loading Speck file '{}'", fileName)); + LINFO(std::format("Loading Speck file '{}'", fileName)); std::ifstream file(fileName); if (!file.good()) { - LERROR(fmt::format("Failed to open Speck file '{}'", fileName)); + LERROR(std::format("Failed to open Speck file '{}'", fileName)); return false; } @@ -368,7 +368,7 @@ bool RenderableConstellationLines::readSpeckFile() { str >> constellationLine.colorIndex; // color index } else { - LWARNING(fmt::format( + LWARNING(std::format( "Unknown command '{}' found in constellation file '{}'", dummy, fileName )); @@ -413,7 +413,7 @@ bool RenderableConstellationLines::readSpeckFile() { constellationLine.vertices.push_back(pos.z); } else { - LERROR(fmt::format( + LERROR(std::format( "Failed reading position on line {} of mesh {} in file '{}'. " "Stopped reading constellation data", l, lineIndex, fileName )); diff --git a/modules/space/rendering/renderableconstellationsbase.cpp b/modules/space/rendering/renderableconstellationsbase.cpp index 7e63dd3df6..48bf87f33f 100644 --- a/modules/space/rendering/renderableconstellationsbase.cpp +++ b/modules/space/rendering/renderableconstellationsbase.cpp @@ -140,7 +140,7 @@ std::string RenderableConstellationsBase::constellationFullName( return _namesTranslation.at(identifier); } - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Identifier '{}' could not be found in list of constellations", identifier )); } diff --git a/modules/space/rendering/renderablefluxnodes.cpp b/modules/space/rendering/renderablefluxnodes.cpp index c1679c2057..5260cf04f4 100644 --- a/modules/space/rendering/renderablefluxnodes.cpp +++ b/modules/space/rendering/renderablefluxnodes.cpp @@ -359,11 +359,11 @@ RenderableFluxNodes::RenderableFluxNodes(const ghoul::Dictionary& dictionary) // Ensure that there are available and valid source files left if (_binarySourceFiles.empty()) { - LERROR(fmt::format("'{}' contains no files", _binarySourceFolderPath)); + LERROR(std::format("'{}' contains no files", _binarySourceFolderPath)); } } else { - LERROR(fmt::format( + LERROR(std::format( "Source folder '{}' is not a valid directory", _binarySourceFolderPath )); } @@ -456,7 +456,7 @@ void RenderableFluxNodes::loadNodeData(int energybinOption) { std::ifstream fileStream3(file3, std::ifstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Could not read file '{}'", file)); + LERROR(std::format("Could not read file '{}'", file)); return; } @@ -646,7 +646,7 @@ void RenderableFluxNodes::populateStartTimes() { _startTimes.push_back(triggerTime); } else { - LERROR(fmt::format( + LERROR(std::format( "Error in file formating. Last column in file '{}' is not on UTC " "ISO8601 format", timeFile )); diff --git a/modules/space/rendering/renderableorbitalkepler.cpp b/modules/space/rendering/renderableorbitalkepler.cpp index a5b6e29633..48c16d13d8 100644 --- a/modules/space/rendering/renderableorbitalkepler.cpp +++ b/modules/space/rendering/renderableorbitalkepler.cpp @@ -307,7 +307,7 @@ void RenderableOrbitalKepler::updateBuffers() { _numObjects = parameters.size(); if (_startRenderIdx >= _numObjects) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Start index {} out of range [0, {}]", _startRenderIdx.value(), _numObjects )); } @@ -315,7 +315,7 @@ void RenderableOrbitalKepler::updateBuffers() { long long endElement = _startRenderIdx + _sizeRender - 1; endElement = (endElement >= _numObjects) ? _numObjects - 1 : endElement; if (endElement < 0 || endElement >= _numObjects) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "End index {} out of range [0, {}]", endElement, _numObjects )); } @@ -330,7 +330,7 @@ void RenderableOrbitalKepler::updateBuffers() { if (_startRenderIdx >= parameters.size() || (_startRenderIdx + _sizeRender) >= parameters.size()) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Tried to load {} objects but only {} are available", _startRenderIdx + _sizeRender, parameters.size() )); diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 574a29fa2a..fbd66b88cd 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -246,7 +246,7 @@ void RenderableRings::loadTexture() { if (texture) { LDEBUGC( "RenderableRings", - fmt::format("Loaded texture from '{}'", absPath(_texturePath)) + std::format("Loaded texture from '{}'", absPath(_texturePath)) ); _texture = std::move(texture); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 2c1d202be4..76f8dede5e 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -662,7 +662,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) _colorTextureIsDirty = true; } else { - LWARNING(fmt::format("File not found: {}", _colorTexturePath.value())); + LWARNING(std::format("File not found: {}", _colorTexturePath.value())); } }); _colorTextureFile->setCallback([this]() { _colorTextureIsDirty = true; }); @@ -682,7 +682,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) _otherDataColorMapIsDirty = true; } else { - LWARNING(fmt::format("File not found: {}", _otherDataColorMapPath.value())); + LWARNING(std::format("File not found: {}", _otherDataColorMapPath.value())); } }); @@ -800,7 +800,7 @@ void RenderableStars::initializeGL() { if (!_queuedOtherData.empty()) { const int idx = _dataset.index(_queuedOtherData); if (idx == -1) { - LERROR(fmt::format("Could not find other data column {}", _queuedOtherData)); + LERROR(std::format("Could not find other data column {}", _queuedOtherData)); } else { _otherDataOption = idx; @@ -905,7 +905,7 @@ void RenderableStars::loadPSFTexture() { ); if (_pointSpreadFunctionTexture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from '{}'", absPath(_pointSpreadFunctionTexturePath) )); _pointSpreadFunctionTexture->uploadTexture(); @@ -1308,7 +1308,7 @@ void RenderableStars::update(const UpdateData&) { 1 ); if (_colorTexture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from '{}'", absPath(_colorTexturePath) )); _colorTexture->uploadTexture(); @@ -1333,7 +1333,7 @@ void RenderableStars::update(const UpdateData&) { 1 ); if (_otherDataColorMapTexture) { - LDEBUG(fmt::format( + LDEBUG(std::format( "Loaded texture from '{}'", absPath(_otherDataColorMapPath) )); _otherDataColorMapTexture->uploadTexture(); diff --git a/modules/space/spacemodule_lua.inl b/modules/space/spacemodule_lua.inl index 0b63785b0f..7f0da56a5d 100644 --- a/modules/space/spacemodule_lua.inl +++ b/modules/space/spacemodule_lua.inl @@ -93,7 +93,7 @@ std::vector readKeplerFile(std::filesystem::path p, std::stri f = openspace::kepler::Format::SBDB; } else { - throw ghoul::lua::LuaError(fmt::format("Unsupported format '{}'", type)); + throw ghoul::lua::LuaError(std::format("Unsupported format '{}'", type)); } std::vector params = openspace::kepler::readFile(p, f); diff --git a/modules/space/tasks/generatedebrisvolumetask.cpp b/modules/space/tasks/generatedebrisvolumetask.cpp index 5c535ce4fc..28027fdb10 100644 --- a/modules/space/tasks/generatedebrisvolumetask.cpp +++ b/modules/space/tasks/generatedebrisvolumetask.cpp @@ -291,7 +291,7 @@ std::vector readTLEFile(const std::string& filename){ keplerElements.epoch = epochFromSubstring(line.substr(18, 14)); } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "File {} @ line {} does not have '1' header", filename // linNum + 1 )); } @@ -344,7 +344,7 @@ std::vector readTLEFile(const std::string& filename){ stream >> keplerElements.meanMotion; } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "File {} @ line {} does not have '2' header", filename // , lineNum + 2 )); } @@ -402,7 +402,7 @@ std::vector getPositionBuffer(std::vector tleData, Time(0.0), false }); - // LINFO(fmt::format("cart: {} ", position)); + // LINFO(std::format("cart: {} ", position)); glm::dvec3 sphPos; if (gridType == "Spherical"){ sphPos = cartesianToSphericalCoord(position); @@ -419,7 +419,7 @@ std::vector getPositionBuffer(std::vector tleData, if (sphPos.z > maxPhi){ maxPhi = sphPos.z; } - // LINFO(fmt::format("pos: {} ", sphPos)); + // LINFO(std::format("pos: {} ", sphPos)); positionBuffer.push_back(sphPos); } @@ -430,10 +430,10 @@ std::vector getPositionBuffer(std::vector tleData, } - LINFO(fmt::format("max theta: {} ", maxTheta)); - LINFO(fmt::format("max phi: {} ", maxPhi)); - LINFO(fmt::format("min theta: {} ", minTheta)); - LINFO(fmt::format("min phi: {} ", minPhi)); + LINFO(std::format("max theta: {} ", maxTheta)); + LINFO(std::format("max phi: {} ", maxPhi)); + LINFO(std::format("min theta: {} ", minTheta)); + LINFO(std::format("min phi: {} ", minPhi)); return positionBuffer; } @@ -456,7 +456,7 @@ float getDensityAt(glm::uvec3 cell, double* densityArray, RawVolume& raw // return value at position cell from _densityPerVoxel size_t index = raw.coordsToIndex(cell); value = static_cast(densityArray[index]); - //LINFO(fmt::format("indensity: {} ", index)); + //LINFO(std::format("indensity: {} ", index)); return value; } @@ -537,9 +537,9 @@ double* mapDensityToVoxels(double* densityArray, std::vector positio { for (const glm::dvec3& position : positions) { - //LINFO(fmt::format("pos: {} ", position)); + //LINFO(std::format("pos: {} ", position)); int index = getIndexFromPosition(position, dim, maxApogee, gridType); - //LINFO(fmt::format("index: {} ", index)); + //LINFO(std::format("index: {} ", index)); if (gridType == "Cartesian"){ ++densityArray[index]; } @@ -645,7 +645,7 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal } // float maxApogee = getMaxApogee(_TLEDataVector); - LINFO(fmt::format("Max Apogee: {} ", _maxApogee)); + LINFO(std::format("Max Apogee: {} ", _maxApogee)); /** SEQUENCE * 1. handle timeStep @@ -663,7 +663,7 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal // 1.1 int numberOfIterations = static_cast(timeSpan/timeStep); - LINFO(fmt::format("timestep: {} ", numberOfIterations)); + LINFO(std::format("timestep: {} ", numberOfIterations)); std::queue> rawVolumeQueue = {}; const int size = _dimensions.x *_dimensions.y *_dimensions.z; @@ -676,7 +676,7 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal startTimeInSeconds + (i * timeStep), _gridType ); //+(i*timeStep) - //LINFO(fmt::format("pos: {} ", startPositionBuffer[4])); + //LINFO(std::format("pos: {} ", startPositionBuffer[4])); double *densityArrayp = new double[size](); //densityArrayp = mapDensityToVoxels( @@ -726,8 +726,8 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal minVal = std::min(minVal, value); maxVal = std::max(maxVal, value); - /*LINFO(fmt::format("min: {} ", minVal)); - LINFO(fmt::format("max: {} ", maxVal));*/ + /*LINFO(std::format("min: {} ", minVal)); + LINFO(std::format("max: {} ", maxVal));*/ }); rawVolumeQueue.push(rawVolume); delete[] densityArrayp; @@ -735,7 +735,7 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal // two loops is used to get a global min and max value for voxels. for(int i=0 ; i<=numberOfIterations ; ++i){ - // LINFO(fmt::format("raw file output name: {} ", _rawVolumeOutputPath)); + // LINFO(std::format("raw file output name: {} ", _rawVolumeOutputPath)); size_t lastIndex = _rawVolumeOutputPath.find_last_of("."); std::string rawOutputName = _rawVolumeOutputPath.substr(0, lastIndex); @@ -772,8 +772,8 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal metadata.minValue = minVal; metadata.maxValue = maxVal; - /*LINFO(fmt::format("min2: {} ", minVal)); - LINFO(fmt::format("max2: {} ", maxVal));*/ + /*LINFO(std::format("min2: {} ", minVal)); + LINFO(std::format("max2: {} ", maxVal));*/ ghoul::Dictionary outputDictionary = metadata.dictionary(); ghoul::DictionaryLuaFormatter formatter; diff --git a/modules/space/translation/gptranslation.cpp b/modules/space/translation/gptranslation.cpp index 145acd8772..ad27c563e3 100644 --- a/modules/space/translation/gptranslation.cpp +++ b/modules/space/translation/gptranslation.cpp @@ -72,7 +72,7 @@ GPTranslation::GPTranslation(const ghoul::Dictionary& dictionary) { ); if (element > static_cast(parameters.size())) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Requested element {} but only {} are available", element, parameters.size() )); } diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index ced6f1ec14..8e34504f8f 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -85,7 +85,7 @@ HorizonsTranslation::HorizonsTranslation(const ghoul::Dictionary& dictionary) if (std::holds_alternative(p.horizonsTextFile)) { std::string file = std::get(p.horizonsTextFile); if (!std::filesystem::is_regular_file(absPath(file))) { - LWARNING(fmt::format("The Horizons text file '{}' could not be found", file)); + LWARNING(std::format("The Horizons text file '{}' could not be found", file)); return; } @@ -99,7 +99,7 @@ HorizonsTranslation::HorizonsTranslation(const ghoul::Dictionary& dictionary) for (const std::string& file : files) { if (!std::filesystem::is_regular_file(absPath(file))) { - LWARNING(fmt::format( + LWARNING(std::format( "The Horizons text file '{}' could not be found", file )); return; @@ -145,14 +145,14 @@ void HorizonsTranslation::loadData() { for (const std::string& filePath : _horizonsTextFiles.value()) { std::filesystem::path file = absPath(filePath); if (!std::filesystem::is_regular_file(file)) { - LWARNING(fmt::format("The Horizons text file '{}' could not be found", file)); + LWARNING(std::format("The Horizons text file '{}' could not be found", file)); return; } std::filesystem::path cachedFile = FileSys.cacheManager()->cachedFilename(file); const bool hasCachedFile = std::filesystem::is_regular_file(cachedFile); if (hasCachedFile) { - LINFO(fmt::format( + LINFO(std::format( "Cached file '{}' used for Horizon file '{}'", cachedFile, file )); @@ -166,13 +166,13 @@ void HorizonsTranslation::loadData() { } } else { - LINFO(fmt::format("Cache for Horizon file '{}' not found", file)); + LINFO(std::format("Cache for Horizon file '{}' not found", file)); } - LINFO(fmt::format("Loading Horizon file '{}'", file)); + LINFO(std::format("Loading Horizon file '{}'", file)); HorizonsFile horizonsFile(file); if (!readHorizonsTextFile(horizonsFile)) { - LERROR(fmt::format("Could not read data from Horizons file '{}'", file)); + LERROR(std::format("Could not read data from Horizons file '{}'", file)); return; } @@ -210,7 +210,7 @@ bool HorizonsTranslation::loadCachedFile(const std::filesystem::path& file) { std::ifstream fileStream(file, std::ifstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Error opening file '{}' for loading cache file", file)); + LERROR(std::format("Error opening file '{}' for loading cache file", file)); return false; } @@ -259,7 +259,7 @@ bool HorizonsTranslation::loadCachedFile(const std::filesystem::path& file) { void HorizonsTranslation::saveCachedFile(const std::filesystem::path& file) const { std::ofstream fileStream(file, std::ofstream::binary); if (!fileStream.good()) { - LERROR(fmt::format("Error opening file '{}' for save cache file", file)); + LERROR(std::format("Error opening file '{}' for save cache file", file)); return; } diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp index c4f38f3e46..66409cab5a 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp @@ -160,7 +160,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format( + std::format( "{:4.0f} {:s} |{:s}>{:s}| {:.1f} %", remainingConv.first, remainingConv.second, @@ -180,7 +180,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format("Data acquisition time: {}", str), + std::format("Data acquisition time: {}", str), glm::vec4(_activeColor.value(), 1.f), ghoul::fontrendering::CrDirection::Down ); @@ -203,7 +203,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format( + std::format( "Next image: [{:02d}:{:02d}:{:02d}]", tlh.count(), tlm.count(), tls.count() ), targetColor, @@ -234,7 +234,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { RenderFont(*_font, penPosition, " |", glm::vec4(0.3f, 0.3f, 0.3f, 1.f)); RenderFont(*_font, penPosition, - fmt::format(" {:5s}", m.first), + std::format(" {:5s}", m.first), glm::vec4(_activeColor.value(), 1.f), ghoul::fontrendering::CrDirection::Down ); @@ -244,7 +244,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { RenderFont( *_font, penPosition, - fmt::format(" {:5s}", m.first), + std::format(" {:5s}", m.first), glm::vec4(0.3f, 0.3f, 0.3f, 1.f), ghoul::fontrendering::CrDirection::Down ); @@ -279,13 +279,13 @@ glm::vec2 DashboardItemInstruments::size() const { size = addToBoundingbox( size, _font->boundingBox( - fmt::format("{:.0f} s {:s} {:.1f} %", remaining, progress, t * 100.f) + std::format("{:.0f} s {:s} {:.1f} %", remaining, progress, t * 100.f) ) ); size = addToBoundingbox( size, - _font->boundingBox(fmt::format("Data acquisition time: {}", str)) + _font->boundingBox(std::format("Data acquisition time: {}", str)) ); } const std::pair nextTarget = sequencer.nextTarget(time); @@ -323,7 +323,7 @@ glm::vec2 DashboardItemInstruments::size() const { size = addToBoundingbox( size, _font->boundingBox( - fmt::format("Data acquisition adjacency: [{}:{}:{}]", hh, mm, ss) + std::format("Data acquisition adjacency: [{}:{}:{}]", hh, mm, ss) ) ); diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index de5bc927f5..4af3d48cbb 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -301,7 +301,7 @@ void RenderableFov::initializeGL() { res.shape == SpiceManager::FieldOfViewResult::Shape::Rectangle; if (!supportedShape) { throw ghoul::RuntimeError( - fmt::format("'{}' has unsupported shape", _instrument.name), + std::format("'{}' has unsupported shape", _instrument.name), "RenderableFov" ); } @@ -329,7 +329,7 @@ void RenderableFov::initializeGL() { LINFOC( _instrument.name, - fmt::format("Simplified from {} to {}", sizeBefore, sizeAfter) + std::format("Simplified from {} to {}", sizeBefore, sizeAfter) ); } diff --git a/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp b/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp index 9efca1a851..34ed44b2b3 100644 --- a/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp +++ b/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp @@ -113,7 +113,7 @@ std::string SpacecraftInstrumentsModule::frameFromBody(const std::string& body) constexpr std::string_view unionPrefix = "IAU_"; if (body.find(unionPrefix) == std::string::npos) { - return fmt::format("{}{}", unionPrefix, body); + return std::format("{}{}", unionPrefix, body); } else { return body; diff --git a/modules/spacecraftinstruments/util/hongkangparser.cpp b/modules/spacecraftinstruments/util/hongkangparser.cpp index 0a1acaba44..87842787b7 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.cpp +++ b/modules/spacecraftinstruments/util/hongkangparser.cpp @@ -86,7 +86,7 @@ HongKangParser::HongKangParser(std::string name, std::string fileName, translationDictionary.value(decoderType); // for each playbook call -> create a Decoder object for (std::string_view key : typeDictionary.keys()) { - const std::string& currentKey = fmt::format("{}.{}", decoderType, key); + const std::string& currentKey = std::format("{}.{}", decoderType, key); ghoul::Dictionary decoderDictionary; if (translationDictionary.hasValue(currentKey)) { @@ -132,7 +132,7 @@ bool HongKangParser::create() { const bool hasObserver = SpiceManager::ref().hasNaifId(_spacecraft); if (!hasObserver) { throw ghoul::RuntimeError( - fmt::format("SPICE has no observer '{}' in kernel pool", _spacecraft), + std::format("SPICE has no observer '{}' in kernel pool", _spacecraft), "HongKangParser" ); } diff --git a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp index 8f19337625..130bde2a08 100644 --- a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp +++ b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp @@ -76,7 +76,7 @@ InstrumentTimesParser::InstrumentTimesParser(std::string name, std::string seque bool InstrumentTimesParser::create() { std::filesystem::path sequenceDir = absPath(_fileName); if (!std::filesystem::is_directory(sequenceDir)) { - LERROR(fmt::format("Could not load label directory '{}'", sequenceDir)); + LERROR(std::format("Could not load label directory '{}'", sequenceDir)); return false; } @@ -88,7 +88,7 @@ bool InstrumentTimesParser::create() { std::filesystem::path filepath = sequenceDir / filename; if (!std::filesystem::is_regular_file(filepath)) { - LERROR(fmt::format("Unable to read file '{}'. Skipping file", filepath)); + LERROR(std::format("Unable to read file '{}'. Skipping file", filepath)); continue; } diff --git a/modules/spacecraftinstruments/util/labelparser.cpp b/modules/spacecraftinstruments/util/labelparser.cpp index d73a738765..ee4b92db42 100644 --- a/modules/spacecraftinstruments/util/labelparser.cpp +++ b/modules/spacecraftinstruments/util/labelparser.cpp @@ -139,7 +139,7 @@ std::string LabelParser::encode(const std::string& line) const { bool LabelParser::create() { std::filesystem::path sequenceDir = absPath(_fileName); if (!std::filesystem::is_directory(sequenceDir)) { - LERROR(fmt::format("Could not load label directory '{}'", sequenceDir)); + LERROR(std::format("Could not load label directory '{}'", sequenceDir)); return false; } @@ -165,7 +165,7 @@ bool LabelParser::create() { std::ifstream file(path); if (!file.good()) { - LERROR(fmt::format("Failed to open label file '{}'", path)); + LERROR(std::format("Failed to open label file '{}'", path)); return false; } @@ -195,21 +195,21 @@ bool LabelParser::create() { if (read == "TARGET_NAME") { _target = decode(line); if (_target.empty()) { - LWARNING(fmt::format(ErrorMsg, "TARGET_NAME", line, path)); + LWARNING(std::format(ErrorMsg, "TARGET_NAME", line, path)); } count++; } if (read == "INSTRUMENT_HOST_NAME") { _instrumentHostID = decode(line); if (_instrumentHostID.empty()) { - LWARNING(fmt::format(ErrorMsg, "INSTRUMENT_HOST_NAME", line, path)); + LWARNING(std::format(ErrorMsg, "INSTRUMENT_HOST_NAME", line, path)); } count++; } if (read == "INSTRUMENT_ID") { _instrumentID = decode(line); if (_instrumentID.empty()) { - LWARNING(fmt::format(ErrorMsg, "INSTRUMENT_ID", line, path)); + LWARNING(std::format(ErrorMsg, "INSTRUMENT_ID", line, path)); } lblName = encode(line); count++; @@ -217,7 +217,7 @@ bool LabelParser::create() { if (read == "DETECTOR_TYPE") { _detectorType = decode(line); if (_detectorType.empty()) { - LWARNING(fmt::format(ErrorMsg, "DETECTOR_TYPE", line, path)); + LWARNING(std::format(ErrorMsg, "DETECTOR_TYPE", line, path)); } count++; } @@ -248,7 +248,7 @@ bool LabelParser::create() { count++; } else{ - LERROR(fmt::format( + LERROR(std::format( "Label file '{}' deviates from generic standard", path )); LINFO( diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index e9b0b6ce4c..8a735f1889 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -425,7 +425,7 @@ void ProjectionComponent::imageProjectBegin() { if (_textureSizeDirty) { glm::ivec2 size = _textureSize; - LDEBUG(fmt::format("Changing texture size to ({}, {})", size.x, size.y)); + LDEBUG(std::format("Changing texture size to ({}, {})", size.x, size.y)); // If the texture size has changed, we have to allocate new memory and copy // the image texture to the new target @@ -453,7 +453,7 @@ void ProjectionComponent::imageProjectBegin() { GLenum status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); if (!FramebufferObject::errorChecking(status).empty()) { - LERROR(fmt::format( + LERROR(std::format( "Read Buffer ({}): {}", msg, FramebufferObject::errorChecking(status) )); } @@ -462,7 +462,7 @@ void ProjectionComponent::imageProjectBegin() { status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); if (!FramebufferObject::errorChecking(status).empty()) { - LERROR(fmt::format( + LERROR(std::format( "Draw Buffer ({}): {}", msg, FramebufferObject::errorChecking(status) )); } @@ -482,7 +482,7 @@ void ProjectionComponent::imageProjectBegin() { GLenum status = glCheckFramebufferStatus(GL_READ_FRAMEBUFFER); if (!FramebufferObject::errorChecking(status).empty()) { - LERROR(fmt::format( + LERROR(std::format( "Read Buffer ({}): {}", msg, FramebufferObject::errorChecking(status) )); } @@ -491,7 +491,7 @@ void ProjectionComponent::imageProjectBegin() { status = glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER); if (!FramebufferObject::errorChecking(status).empty()) { - LERROR(fmt::format( + LERROR(std::format( "Draw Buffer ({}): {}", msg, FramebufferObject::errorChecking(status) )); } @@ -904,7 +904,7 @@ std::shared_ptr ProjectionComponent::loadProjectionTextu } bool ProjectionComponent::generateProjectionLayerTexture(const glm::ivec2& size) { - LINFO(fmt::format("Creating projection texture of size ({}, {})", size.x, size.y)); + LINFO(std::format("Creating projection texture of size ({}, {})", size.x, size.y)); using namespace ghoul::opengl; _projectionTexture = std::make_unique( @@ -943,7 +943,7 @@ bool ProjectionComponent::generateProjectionLayerTexture(const glm::ivec2& size) } bool ProjectionComponent::generateDepthTexture(const glm::ivec2& size) { - LINFO(fmt::format("Creating depth texture of size ({}, {})", size.x, size.y)); + LINFO(std::format("Creating depth texture of size ({}, {})", size.x, size.y)); _shadowing.texture = std::make_unique( glm::uvec3(size, 1), diff --git a/modules/spout/spoutwrapper.cpp b/modules/spout/spoutwrapper.cpp index 739a3170bb..fe03d8a2c3 100644 --- a/modules/spout/spoutwrapper.cpp +++ b/modules/spout/spoutwrapper.cpp @@ -213,7 +213,7 @@ bool SpoutReceiver::updateReceiverName(const std::string& name) { bool hasCreated = _spoutHandle->CreateReceiver(nameBuf, width, height); if (!hasCreated) { if (!_isErrorMessageDisplayed) { - LWARNING(fmt::format( + LWARNING(std::format( "Could not create receiver for {} -> {}x{}", name, width, height )); _isErrorMessageDisplayed = true; @@ -294,7 +294,7 @@ bool SpoutReceiver::updateTexture(unsigned int width, unsigned int height) { if (_spoutTexture) { _spoutTexture->uploadTexture(); if (_onUpdateTextureCallback && !_onUpdateTextureCallback(width, height)) { - LWARNING(fmt::format( + LWARNING(std::format( "Could not create callback texture for {} -> {}x{}", _currentSpoutName, width, height )); @@ -304,7 +304,7 @@ bool SpoutReceiver::updateTexture(unsigned int width, unsigned int height) { _spoutHeight = height; } else { - LWARNING(fmt::format( + LWARNING(std::format( "Could not create texture for {} -> {}x{}", _currentSpoutName, width, height )); @@ -376,7 +376,7 @@ SpoutReceiverPropertyProxy::SpoutReceiverPropertyProxy(properties::PropertyOwner for (int i = 0; i < static_cast(receiverList.size()); i++) { _spoutSelection.addOption(i + 1, receiverList[i]); - LWARNING(fmt::format("List {}", receiverList[i])); + LWARNING(std::format("List {}", receiverList[i])); if (!_isSelectAny && _spoutName.value() == receiverList[i]) { idx = i + 1; @@ -424,7 +424,7 @@ bool SpoutSender::updateSenderStatus() { if (!_isSending) { if (_spoutWidth == 0 || _spoutHeight == 0) { if (!_isErrorMessageDisplayed) { - LWARNING(fmt::format( + LWARNING(std::format( "Could not create sender for {}, dimensions invalid {}x{}", _currentSpoutName, _spoutWidth, _spoutHeight )); @@ -435,7 +435,7 @@ bool SpoutSender::updateSenderStatus() { if (_currentSpoutName.empty()) { if (!_isErrorMessageDisplayed) { - LWARNING(fmt::format("Could not create sender, invalid name")); + LWARNING(std::format("Could not create sender, invalid name")); _isErrorMessageDisplayed = true; } return false; @@ -448,7 +448,7 @@ bool SpoutSender::updateSenderStatus() { bool hasCreated = _spoutHandle->CreateSender(name, _spoutWidth, _spoutHeight); if (!hasCreated) { if (!_isErrorMessageDisplayed) { - LWARNING(fmt::format( + LWARNING(std::format( "Could not create sender for {} -> {}x{}", _currentSpoutName, _spoutWidth, _spoutHeight )); @@ -588,7 +588,7 @@ SpoutSenderPropertyProxy::SpoutSenderPropertyProxy(properties::PropertyOwner& ow _spoutName = dictionary.value(NameSenderInfo.identifier); } else { - LWARNING(fmt::format("Sender does not have a name")); + LWARNING(std::format("Sender does not have a name")); } _spoutName.onChange([this]() { _isSpoutDirty = true; }); diff --git a/modules/statemachine/src/statemachine.cpp b/modules/statemachine/src/statemachine.cpp index 3311f9b968..3acfd33ca4 100644 --- a/modules/statemachine/src/statemachine.cpp +++ b/modules/statemachine/src/statemachine.cpp @@ -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 diff --git a/modules/statemachine/statemachinemodule.cpp b/modules/statemachine/statemachinemodule.cpp index 43e2edac28..0654a8ecd4 100644 --- a/modules/statemachine/statemachinemodule.cpp +++ b/modules/statemachine/statemachinemodule.cpp @@ -64,12 +64,12 @@ void StateMachineModule::initializeStateMachine(const ghoul::Dictionary& states, try { _machine = std::make_unique(dictionary); - LINFO(fmt::format( + LINFO(std::format( "State machine was created with start state: {}", currentState() )); } catch (const documentation::SpecificationError& e) { - LERROR(fmt::format("Error loading state machine: {}", e.what())); + LERROR(std::format("Error loading state machine: {}", e.what())); logError(e); } } diff --git a/modules/statemachine/statemachinemodule_lua.inl b/modules/statemachine/statemachinemodule_lua.inl index 0a583bad8e..6672835113 100644 --- a/modules/statemachine/statemachinemodule_lua.inl +++ b/modules/statemachine/statemachinemodule_lua.inl @@ -113,7 +113,7 @@ namespace { std::vector transitions = module->possibleTransitions(); LINFOC( "StateMachine", - fmt::format( + std::format( "Currently in state: '{}'. Can transition to states: [ {} ]", currentState, ghoul::join(transitions, ",") diff --git a/modules/sync/syncs/httpsynchronization.cpp b/modules/sync/syncs/httpsynchronization.cpp index 12979a5a77..22e917dca1 100644 --- a/modules/sync/syncs/httpsynchronization.cpp +++ b/modules/sync/syncs/httpsynchronization.cpp @@ -111,7 +111,7 @@ void HttpSynchronization::start() { return; } - const std::string query = fmt::format( + const std::string query = std::format( "?identifier={}&file_version={}&application_version={}", _identifier, _version, ApplicationVersion ); @@ -158,7 +158,7 @@ void HttpSynchronization::cancel() { } std::string HttpSynchronization::generateUid() { - return fmt::format("{}/{}", _identifier, _version); + return std::format("{}/{}", _identifier, _version); } void HttpSynchronization::createSyncFile(bool isFullySynchronized) const { @@ -168,7 +168,7 @@ void HttpSynchronization::createSyncFile(bool isFullySynchronized) const { dir.replace_extension("ossync"); std::ofstream syncFile(dir, std::ofstream::out); - syncFile << fmt::format( + syncFile << std::format( "{}\n{}\n", OssyncVersionNumber, (isFullySynchronized ? SynchronizationToken : "Partial Synchronized") @@ -227,7 +227,7 @@ bool HttpSynchronization::isEachFileDownloaded() { } } else { - LERROR(fmt::format( + LERROR(std::format( "{}: Unknown ossync version number read." "Got {} while {} and below are valid.", _identifier, @@ -286,7 +286,7 @@ HttpSynchronization::trySyncFromUrl(std::string url) { const std::filesystem::path destination = directory() / (filename + ".tmp"); if (sizeData.find(line) != sizeData.end()) { - LWARNING(fmt::format("{}: Duplicate entry for {}", _identifier, line)); + LWARNING(std::format("{}: Duplicate entry for {}", _identifier, line)); continue; } @@ -372,7 +372,7 @@ HttpSynchronization::trySyncFromUrl(std::string url) { for (const std::unique_ptr& d : downloads) { d->wait(); if (!d->hasSucceeded()) { - LERROR(fmt::format("Error downloading file from URL '{}'", d->url())); + LERROR(std::format("Error downloading file from URL '{}'", d->url())); failed = true; continue; } @@ -391,7 +391,7 @@ HttpSynchronization::trySyncFromUrl(std::string url) { std::error_code ec; std::filesystem::rename(tempName, originalName, ec); if (ec) { - LERROR(fmt::format("Error renaming '{}' to '{}'", tempName, originalName)); + LERROR(std::format("Error renaming '{}' to '{}'", tempName, originalName)); failed = true; } @@ -407,7 +407,7 @@ HttpSynchronization::trySyncFromUrl(std::string url) { zip_close(z); if (is64) { - LERROR(fmt::format( + LERROR(std::format( "Error while unzipping '{}': Zip64 archives are not supported", source )); continue; @@ -415,7 +415,7 @@ HttpSynchronization::trySyncFromUrl(std::string url) { int ret = zip_extract(source.c_str(), dest.c_str(), nullptr, nullptr); if (ret != 0) { - LERROR(fmt::format("Error '{}' while unzipping '{}'", ret, source)); + LERROR(std::format("Error '{}' while unzipping '{}'", ret, source)); continue; } diff --git a/modules/sync/syncs/urlsynchronization.cpp b/modules/sync/syncs/urlsynchronization.cpp index f58b1434f8..5ca58329b2 100644 --- a/modules/sync/syncs/urlsynchronization.cpp +++ b/modules/sync/syncs/urlsynchronization.cpp @@ -99,7 +99,7 @@ UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dictionary, } if (p.filename.has_value() && _urls.size() > 1) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "UrlSynchronization ({}) requested overwrite filename but specified {} URLs " "to download, which is not legal", p.identifier, _urls.size() @@ -128,11 +128,11 @@ UrlSynchronization::UrlSynchronization(const ghoul::Dictionary& dictionary, size_t hash = std::hash{}( std::accumulate(urls.begin(), urls.end(), std::string()) ); - _identifier += fmt::format("({})", hash); + _identifier += std::format("({})", hash); } if (p.forceOverride.has_value()) { - LWARNING(fmt::format( + LWARNING(std::format( "{}: The variable ForceOverride has been deprecated. " "Optionally, use SecondsUntilResync instead to specify file validity date.", p.identifier @@ -230,7 +230,7 @@ bool UrlSynchronization::isEachFileValid() { // Issue warning if file is kept but user changed setting to download on startup. if ((fileValidAsJ2000 > todaysDateAsJ2000) && _secondsUntilResync == 0) { - LWARNING(fmt::format( + LWARNING(std::format( "{}: File is valid to {} but asset specifies SecondsUntilResync = {} " "Did you mean to re-download the file? If so, remove file from sync " "folder to resync", @@ -247,7 +247,7 @@ bool UrlSynchronization::isEachFileValid() { return false; } else { - LERROR(fmt::format( + LERROR(std::format( "{}: Unknown ossync version number read. Got {} while {} and below are valid", _identifier, ossyncVersion, OssyncVersionNumber )); @@ -279,7 +279,7 @@ void UrlSynchronization::createSyncFile(bool) const { "YYYY-MM-DDTHR:MN:SC.###" ); - const std::string msg = fmt::format("{}\n{}\n", OssyncVersionNumber, fileIsValidTo); + const std::string msg = std::format("{}\n{}\n", OssyncVersionNumber, fileIsValidTo); syncFile << msg; } @@ -311,7 +311,7 @@ bool UrlSynchronization::trySyncUrls() { std::filesystem::path destination = directory() / (_filename + ".tmp"); if (sizeData.find(url) != sizeData.end()) { - LWARNING(fmt::format("{}: Duplicate entry for '{}'", _identifier, url)); + LWARNING(std::format("{}: Duplicate entry for '{}'", _identifier, url)); continue; } @@ -360,7 +360,7 @@ bool UrlSynchronization::trySyncUrls() { d->wait(); if (!d->hasSucceeded()) { failed = true; - LERROR(fmt::format("Error downloading file from URL: {}", d->url())); + LERROR(std::format("Error downloading file from URL: {}", d->url())); continue; } @@ -381,7 +381,7 @@ bool UrlSynchronization::trySyncUrls() { if (ec) { LERRORC( "URLSynchronization", - fmt::format("Error renaming file '{}' to '{}'", tempName, originalName) + std::format("Error renaming file '{}' to '{}'", tempName, originalName) ); failed = true; diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index 59c788e193..1822ce108a 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -741,7 +741,7 @@ void TouchInteraction::computeVelocities(const std::vector& li if (pinchConsecCt > 0 && action != InteractionType::PINCH) { if (pinchConsecCt > 3) { - LDEBUG(fmt::format( + LDEBUG(std::format( "PINCH gesture ended with {} drag distance and {} counts", pinchConsecZoomFactor, pinchConsecCt )); @@ -1005,7 +1005,7 @@ void TouchInteraction::step(double dt, bool directTouch) { // Because of heightmaps we need to ensure we don't go through the surface if (_zoomInLimit.value() < nodeRadius) { #ifdef TOUCH_DEBUG_PROPERTIES - LINFO(fmt::format( + LINFO(std::format( "Zoom In limit should be larger than anchor " "center to surface, setting it to {}", zoomInBounds )); @@ -1021,7 +1021,7 @@ void TouchInteraction::step(double dt, bool directTouch) { // Make sure zoom in limit is not larger than zoom out limit if (zoomInBounds > zoomOutBounds) { - LWARNING(fmt::format( + LWARNING(std::format( "Zoom In Limit should be smaller than Zoom Out Limit", zoomOutBounds )); @@ -1069,7 +1069,7 @@ void TouchInteraction::step(double dt, bool directTouch) { } else if (currentPosViolatingZoomOutLimit) { #ifdef TOUCH_DEBUG_PROPERTIES - LINFO(fmt::format( + LINFO(std::format( "You are outside zoom out {} limit, only zoom in allowed", zoomOutBounds )); @@ -1112,7 +1112,7 @@ void TouchInteraction::step(double dt, bool directTouch) { //Show velocity status every N frames if (++stepVelUpdate >= 60) { stepVelUpdate = 0; - LINFO(fmt::format( + LINFO(std::format( "DistToFocusNode {} stepZoomVelUpdate {}", length(centerToCamera), _vel.zoom )); diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index ce08d85ff1..06dff64ab9 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -254,7 +254,7 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) { } if (!gTouchHook) { - LINFO(fmt::format("Failed to setup WindowsHook for touch input redirection")); + LINFO(std::format("Failed to setup WindowsHook for touch input redirection")); #ifdef ENABLE_TUIOMESSAGES delete gTuioServer; #endif diff --git a/modules/touch/touchmodule.cpp b/modules/touch/touchmodule.cpp index 91976bd1bb..6330111fd7 100644 --- a/modules/touch/touchmodule.cpp +++ b/modules/touch/touchmodule.cpp @@ -95,7 +95,7 @@ TouchModule::TouchModule() FactoryManager::ref().factory(); if (!fRenderable->hasClass(s)) { - LWARNING(fmt::format( + LWARNING(std::format( "In property 'DefaultDirectTouchRenderableTypes': '{}' is not a " "registered renderable type. Ignoring", s )); diff --git a/modules/video/src/videoplayer.cpp b/modules/video/src/videoplayer.cpp index dd79ab5e45..856a0a9850 100644 --- a/modules/video/src/videoplayer.cpp +++ b/modules/video/src/videoplayer.cpp @@ -133,7 +133,7 @@ namespace { bool checkMpvError(int status) { if (status < 0) { - LERROR(fmt::format("Libmpv API error: {}", mpv_error_string(status))); + LERROR(std::format("Libmpv API error: {}", mpv_error_string(status))); return false; } return true; @@ -166,7 +166,7 @@ void VideoPlayer::observePropertyMpv(MpvKey key) { void VideoPlayer::setPropertyStringMpv(const char* name, const char* value) { const int result = mpv_set_property_string(_mpvHandle, name, value); if (!checkMpvError(result)) { - LWARNING(fmt::format("Error setting property '{}'", name)); + LWARNING(std::format("Error setting property '{}'", name)); } } @@ -226,7 +226,7 @@ void VideoPlayer::getPropertyAsyncMpv(MpvKey key) { formats[key] ); if (!checkMpvError(result)) { - LWARNING(fmt::format("Could not find property '{}'", keys[key])); + LWARNING(std::format("Could not find property '{}'", keys[key])); return; } } @@ -234,7 +234,7 @@ void VideoPlayer::getPropertyAsyncMpv(MpvKey key) { void VideoPlayer::commandAsyncMpv(const char* cmd[], MpvKey key) { const int result = mpv_command_async(_mpvHandle, static_cast(key), cmd); if (!checkMpvError(result)) { - LERROR(fmt::format("Could not execute command '{}'", keys[key])); + LERROR(std::format("Could not execute command '{}'", keys[key])); return; } } @@ -579,7 +579,7 @@ void VideoPlayer::handleMpvEvents() { break; } if (!checkMpvError(event->error)) { - LWARNING(fmt::format( + LWARNING(std::format( "Error at mpv event: {} {}", static_cast(event->event_id), event->reply_userdata )); @@ -603,7 +603,7 @@ void VideoPlayer::handleMpvEvents() { // Validate reply with what we have stored const MpvKey key = static_cast(event->reply_userdata); if (formats[key] != prop->format) { - LINFO(fmt::format("Wrong format for property '{}'", keys[key])); + LINFO(std::format("Wrong format for property '{}'", keys[key])); break; } getPropertyAsyncMpv(key); @@ -616,7 +616,7 @@ void VideoPlayer::handleMpvEvents() { case MPV_EVENT_LOG_MESSAGE: { mpv_event_log_message* msg = reinterpret_cast(event->data); - LINFO(fmt::format("[{}] {}: {}", msg->prefix, msg->level, msg->text)); + LINFO(std::format("[{}] {}: {}", msg->prefix, msg->level, msg->text)); break; } default: { @@ -631,7 +631,7 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) { const MpvKey key = static_cast(event->reply_userdata); if (!event->data) { - LERROR(fmt::format("Could not find data for property: {}", keys[key])); + LERROR(std::format("Could not find data for property: {}", keys[key])); return; } // Cast event to node or property depending on its format @@ -641,7 +641,7 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) { const int result = mpv_event_to_node(&node, event); if (!checkMpvError(result)) { LWARNING( - fmt::format("Error getting data from libmpv property: {}", keys[key]) + std::format("Error getting data from libmpv property: {}", keys[key]) ); } } @@ -667,7 +667,7 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) { updateFrameDuration(); } - LINFO(fmt::format("Duration: {}", *duration)); + LINFO(std::format("Duration: {}", *duration)); break; } case MpvKey::Height: { @@ -682,7 +682,7 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) { } resizeTexture(glm::ivec2(_videoResolution.x, *height)); - LINFO(fmt::format("New height: {}", *height)); + LINFO(std::format("New height: {}", *height)); // Each time a size property is updated, it means libmpv is updating the video // so we have to re-render the first frame to show it @@ -702,7 +702,7 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) { } resizeTexture(glm::ivec2(* width, _videoResolution.y)); - LINFO(fmt::format("New width: {}", *width)); + LINFO(std::format("New width: {}", *width)); // Each time a size property is updated, it means libmpv is updating the video // so we have to re-render the first frame to show it @@ -750,7 +750,7 @@ void VideoPlayer::handleMpvProperties(mpv_event* event) { updateFrameDuration(); } - LINFO(fmt::format("Detected fps: {}", *fps)); + LINFO(std::format("Detected fps: {}", *fps)); _seekThreshold = 2.0 * (1.0 / _fps); break; } @@ -860,7 +860,7 @@ double VideoPlayer::correctVideoPlaybackTime() const { } void VideoPlayer::createTexture(glm::ivec2 size) { - LINFO(fmt::format("Creating new FBO with width: {} and height: {}", size.x, size.y)); + LINFO(std::format("Creating new FBO with width: {} and height: {}", size.x, size.y)); if (size.x <= 0 || size.y <= 0) { LERROR("Cannot create empty fbo"); @@ -900,7 +900,7 @@ void VideoPlayer::resizeTexture(glm::ivec2 size) { const bool isNew = size != _videoResolution; if (isValid && isNew) { _videoResolution = size; - LINFO(fmt::format("Resizing texture: width: {} height: {}", size.x, size.y)); + LINFO(std::format("Resizing texture: width: {} height: {}", size.x, size.y)); // Delete texture _frameTexture = nullptr; diff --git a/modules/vislab/rendering/renderabledistancelabel.cpp b/modules/vislab/rendering/renderabledistancelabel.cpp index 05726662c5..3e03e64851 100644 --- a/modules/vislab/rendering/renderabledistancelabel.cpp +++ b/modules/vislab/rendering/renderabledistancelabel.cpp @@ -135,7 +135,7 @@ void RenderableDistanceLabel::update(const UpdateData&) { distanceText.erase(pos, subStr.size()); // Create final label text and set it - const std::string finalText = fmt::format("{} {}", distanceText, unitDescriptor); + const std::string finalText = std::format("{} {}", distanceText, unitDescriptor); setLabelText(finalText); // Update placement of label with transformation matrix @@ -148,14 +148,14 @@ void RenderableDistanceLabel::update(const UpdateData&) { _transformationMatrix = glm::translate(glm::dmat4(1.0), goalPos); } else { - LERROR(fmt::format( + LERROR(std::format( "Could not find scene graph node '{}' or '{}'", nodeline->start(), nodeline->end() )); } } else { - LERROR(fmt::format( + LERROR(std::format( "There is no scenegraph node with id {}", _nodelineId.value() )); _errorThrown = true; diff --git a/modules/volume/rawvolumewriter.inl b/modules/volume/rawvolumewriter.inl index 7b8c5091da..01845da3aa 100644 --- a/modules/volume/rawvolumewriter.inl +++ b/modules/volume/rawvolumewriter.inl @@ -100,7 +100,7 @@ void RawVolumeWriter::write(const RawVolume& volume) { std::ofstream file(_path, std::ios::binary); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format("Could not create file '{}'", _path)); + throw ghoul::RuntimeError(std::format("Could not create file '{}'", _path)); } file.write(buffer, length); diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index 464c140a5e..f936f027aa 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -232,7 +232,7 @@ void RenderableTimeVaryingVolume::initializeGL() { std::filesystem::path sequenceDir = absPath(_sourceDirectory); if (!std::filesystem::is_directory(sequenceDir)) { - LERROR(fmt::format("Could not load sequence directory '{}'", sequenceDir)); + LERROR(std::format("Could not load sequence directory '{}'", sequenceDir)); return; } @@ -246,7 +246,7 @@ void RenderableTimeVaryingVolume::initializeGL() { // TODO: defer loading of data to later (separate thread or at least not when loading) for (std::pair& p : _volumeTimesteps) { Timestep& t = p.second; - const std::string path = fmt::format( + const std::string path = std::format( "{}/{}.rawvolume", _sourceDirectory.value(), t.baseName ); RawVolumeReader reader(path, t.metadata.dimensions); diff --git a/modules/volume/tasks/generaterawvolumetask.cpp b/modules/volume/tasks/generaterawvolumetask.cpp index 880857d079..159d01aa85 100644 --- a/modules/volume/tasks/generaterawvolumetask.cpp +++ b/modules/volume/tasks/generaterawvolumetask.cpp @@ -88,7 +88,7 @@ GenerateRawVolumeTask::GenerateRawVolumeTask(const ghoul::Dictionary& dictionary } std::string GenerateRawVolumeTask::description() { - return fmt::format( + return std::format( "Generate a raw volume with dimenstions: ({}, {}, {}). For each cell, set the " "value by evaluating the lua function: `{}`, with three arguments (x, y, z) " "ranging from ({}, {}, {}) to ({}, {}, {}). Write raw volume data into '{}' and " diff --git a/modules/webbrowser/src/browserinstance.cpp b/modules/webbrowser/src/browserinstance.cpp index 81bbcfa7bc..b2e523e7ea 100644 --- a/modules/webbrowser/src/browserinstance.cpp +++ b/modules/webbrowser/src/browserinstance.cpp @@ -88,7 +88,7 @@ void BrowserInstance::loadUrl(const std::string& url) { ghoul_assert(_isInitialized, "BrowserInstance should be initialized"); if (!url.empty()) { - LDEBUG(fmt::format("Loading URL '{}'", url)); + LDEBUG(std::format("Loading URL '{}'", url)); _browser->GetMainFrame()->LoadURL(url); } else { @@ -98,7 +98,7 @@ void BrowserInstance::loadUrl(const std::string& url) { bool BrowserInstance::loadLocalPath(std::string path) { if (!std::filesystem::is_regular_file(path)) { - LDEBUG(fmt::format("Could not find path '{}', verify that it is correct", path)); + LDEBUG(std::format("Could not find path '{}', verify that it is correct", path)); return false; } diff --git a/modules/webbrowser/src/cefhost.cpp b/modules/webbrowser/src/cefhost.cpp index 1ee11dc811..2c6e7870a4 100644 --- a/modules/webbrowser/src/cefhost.cpp +++ b/modules/webbrowser/src/cefhost.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #ifdef __APPLE__ #include @@ -81,7 +81,7 @@ CefHost::~CefHost() { void CefHost::attachDebugSettings(CefSettings &settings) { settings.remote_debugging_port = 8088; - LDEBUG(fmt::format( + LDEBUG(std::format( "Remote WebBrowser debugging available on http://localhost:{}", settings.remote_debugging_port )); diff --git a/modules/webbrowser/src/eventhandler.cpp b/modules/webbrowser/src/eventhandler.cpp index 174fc00930..df745a55df 100644 --- a/modules/webbrowser/src/eventhandler.cpp +++ b/modules/webbrowser/src/eventhandler.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include namespace { constexpr std::string_view _loggerCat = "WebBrowser:EventHandler"; diff --git a/modules/webbrowser/src/screenspacebrowser.cpp b/modules/webbrowser/src/screenspacebrowser.cpp index c9c6a7d3c2..026c6f9f9a 100644 --- a/modules/webbrowser/src/screenspacebrowser.cpp +++ b/modules/webbrowser/src/screenspacebrowser.cpp @@ -136,7 +136,7 @@ bool ScreenSpaceBrowser::deinitializeGL() { _renderHandler->setTexture(0); _texture = nullptr; - LDEBUG(fmt::format("Deinitializing ScreenSpaceBrowser: {}", _url.value())); + LDEBUG(std::format("Deinitializing ScreenSpaceBrowser: {}", _url.value())); _browserInstance->close(true); diff --git a/modules/webbrowser/src/webrenderhandler.cpp b/modules/webbrowser/src/webrenderhandler.cpp index 81c7f75cc8..0bdccd183b 100644 --- a/modules/webbrowser/src/webrenderhandler.cpp +++ b/modules/webbrowser/src/webrenderhandler.cpp @@ -25,7 +25,6 @@ #include #include -#include #include namespace openspace { diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index f9a3d60677..61fd0e8360 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -77,11 +77,11 @@ namespace { * \return the absolute path to the file */ std::filesystem::path findHelperExecutable() { - const std::filesystem::path execLocation = absPath(fmt::format( + const std::filesystem::path execLocation = absPath(std::format( "${{BIN}}/{}", SubprocessPath )); if (!std::filesystem::is_regular_file(execLocation)) { - LERROR(fmt::format( + LERROR(std::format( "Could not find web helper executable at location: {}", execLocation )); } @@ -154,7 +154,7 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { _enabled = dictionary.value("Enabled"); } - LDEBUG(fmt::format("CEF using web helper executable: {}", _webHelperLocation)); + LDEBUG(std::format("CEF using web helper executable: {}", _webHelperLocation)); _cefHost = std::make_unique(_webHelperLocation.string()); LDEBUG("Starting CEF... done"); @@ -205,7 +205,7 @@ void WebBrowserModule::removeBrowser(BrowserInstance* browser) { global::callback::webBrowserPerformanceHotfix = nullptr; } - LDEBUG(fmt::format("Number of browsers stored: {}", _browsers.size())); + LDEBUG(std::format("Number of browsers stored: {}", _browsers.size())); } void WebBrowserModule::attachEventHandler(BrowserInstance* browserInstance) { diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index d9c8fe4f51..5e8ca13470 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -273,10 +273,10 @@ void WebGuiModule::startProcess() { std::string defaultEndpoint; if (!_defaultEndpoint.value().empty()) { - defaultEndpoint = fmt::format("--redirect \"{}\"", _defaultEndpoint.value()); + defaultEndpoint = std::format("--redirect \"{}\"", _defaultEndpoint.value()); } - const std::string command = fmt::format( + const std::string command = std::format( "\"{}\" \"{}\" --directories \"{}\" {} --http-port \"{}\" --ws-address \"{}\" " "--ws-port {} --auto-close --local", node.string(), absPath(_entryPoint.value()).string(), formattedDirectories, @@ -288,11 +288,11 @@ void WebGuiModule::startProcess() { absPath("${BIN}").string(), [](const char* data, size_t n) { const std::string str(data, n); - LDEBUG(fmt::format("Web GUI server output: {}", str)); + LDEBUG(std::format("Web GUI server output: {}", str)); }, [](const char* data, size_t n) { const std::string str(data, n); - LERROR(fmt::format("Web GUI server error: {}", str)); + LERROR(std::format("Web GUI server error: {}", str)); } ); } diff --git a/src/data/csvloader.cpp b/src/data/csvloader.cpp index 7ab566f015..4fa73168d2 100644 --- a/src/data/csvloader.cpp +++ b/src/data/csvloader.cpp @@ -80,7 +80,7 @@ Dataset loadCsvFile(std::filesystem::path filePath, std::optional s ); if (rows.size() < 2) { - LWARNING(fmt::format( + LWARNING(std::format( "Error loading data file '{}'. No data items read", filePath )); return Dataset(); @@ -145,7 +145,7 @@ Dataset loadCsvFile(std::filesystem::path filePath, std::optional s if (specs.has_value()) { bool hasAllProvided = specs->checkIfAllProvidedColumnsExist(columns); if (!hasAllProvided) { - LERROR(fmt::format( + LERROR(std::format( "Error loading data file {}. Not all columns provided in data mapping " "exists in dataset", filePath )); @@ -156,13 +156,13 @@ Dataset loadCsvFile(std::filesystem::path filePath, std::optional s bool hasTextureIndex = (res.textureDataIndex >= 0); if (hasProvidedTextureFile && !hasTextureIndex && !specs->textureColumn.has_value()) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading data file {}. No texture column was specified in the data " "mapping", filePath )); } if (!hasProvidedTextureFile && hasTextureIndex) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading data file {}. Missing texture map file location in data " "mapping", filePath )); @@ -170,12 +170,12 @@ Dataset loadCsvFile(std::filesystem::path filePath, std::optional s if (xColumn < 0 || yColumn < 0 || zColumn < 0) { // One or more position columns weren't read - LERROR(fmt::format( + LERROR(std::format( "Error loading data file '{}'. Missing X, Y or Z position column", filePath )); } - LINFO(fmt::format("Loading {} rows with {} columns", rows.size(), columns.size())); + LINFO(std::format("Loading {} rows with {} columns", rows.size(), columns.size())); ProgressBar progress = ProgressBar(static_cast(rows.size())); std::set uniqueTextureIndicesInData; @@ -239,7 +239,7 @@ Dataset loadCsvFile(std::filesystem::path filePath, std::optional s if (hasProvidedTextureFile) { const std::filesystem::path path = *specs->textureMap; if (!std::filesystem::is_regular_file(path)) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Failed to open texture map file {}", path )); } @@ -256,7 +256,7 @@ std::vector loadTextureMapFile(std::filesystem::path path, std::ifstream file(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Failed to open texture map file {}", path )); } @@ -282,7 +282,7 @@ std::vector loadTextureMapFile(std::filesystem::path path, )); if (nNonEmptyTokens > 2) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading texture map file {}: Line {} has too many parameters. " "Expected 2: an integer index followed by a filename, where the file " "name may not include whitespaces", @@ -299,7 +299,7 @@ std::vector loadTextureMapFile(std::filesystem::path path, for (const Dataset::Texture& t : res) { if (t.index == texture.index) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading texture map file {}: Texture index '{}' defined twice", path, texture.index )); diff --git a/src/data/dataloader.cpp b/src/data/dataloader.cpp index a97327ad0b..c1815e60e8 100644 --- a/src/data/dataloader.cpp +++ b/src/data/dataloader.cpp @@ -47,7 +47,7 @@ namespace { template void checkSize(U value, std::string_view message) { if (value > std::numeric_limits::max()) { - throw ghoul::RuntimeError(fmt::format("Error saving file '{}'", message)); + throw ghoul::RuntimeError(std::format("Error saving file '{}'", message)); } } @@ -87,7 +87,7 @@ namespace { if (std::filesystem::exists(cached)) { LINFOC( "DataLoader", - fmt::format("Cached file {} used for file {}", cached, filePath) + std::format("Cached file {} used for file {}", cached, filePath) ); std::optional dataset = loadCacheFunction(cached); @@ -99,7 +99,7 @@ namespace { FileSys.cacheManager()->removeCacheFile(cached); } } - LINFOC("DataLoader", fmt::format("Loading file '{}'", filePath)); + LINFOC("DataLoader", std::format("Loading file '{}'", filePath)); T dataset = loadFunction(filePath, specs); if (!dataset.entries.empty()) { @@ -120,7 +120,7 @@ Dataset loadFile(std::filesystem::path path, std::optional specs) { const std::ifstream file = std::ifstream(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format("Failed to open data file '{}'", path)); + throw ghoul::RuntimeError(std::format("Failed to open data file '{}'", path)); } const std::string extension = ghoul::toLowerCase(path.extension().string()); @@ -133,7 +133,7 @@ Dataset loadFile(std::filesystem::path path, std::optional specs) { res = speck::loadSpeckFile(path, std::move(specs)); } else { - LERRORC("DataLoader", fmt::format( + LERRORC("DataLoader", std::format( "Could not read data file '{}'. File format '{}' is not supported", path, path.extension() )); @@ -349,7 +349,7 @@ Labelset loadFile(std::filesystem::path path, std::optional) { const std::ifstream file = std::ifstream(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format("Failed to open dataset file '{}'", path)); + throw ghoul::RuntimeError(std::format("Failed to open dataset file '{}'", path)); } const std::string extension = ghoul::toLowerCase(path.extension().string()); @@ -359,7 +359,7 @@ Labelset loadFile(std::filesystem::path path, std::optional) { res = speck::loadLabelFile(path); } else { - LERRORC("DataLoader", fmt::format( + LERRORC("DataLoader", std::format( "Could not read label data file '{}'. File format '{}' is not supported", path, path.extension() )); @@ -469,7 +469,7 @@ Labelset loadFromDataset(const Dataset& dataset) { label.position = entry.position; label.text = entry.comment.value_or("MISSING LABEL"); // @TODO: make is possible to configure this identifier? - label.identifier = fmt::format("Point-{}", count); + label.identifier = std::format("Point-{}", count); res.entries.push_back(std::move(label)); } @@ -485,7 +485,7 @@ ColorMap loadFile(std::filesystem::path path, std::optional) { const std::ifstream file = std::ifstream(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format("Failed to open colormap file '{}'", path)); + throw ghoul::RuntimeError(std::format("Failed to open colormap file '{}'", path)); } const std::string extension = ghoul::toLowerCase(path.extension().string()); @@ -495,7 +495,7 @@ ColorMap loadFile(std::filesystem::path path, std::optional) { res = speck::loadCmapFile(path); } else { - LERRORC("DataLoader", fmt::format( + LERRORC("DataLoader", std::format( "Could not read color map file '{}'. File format '{}' is not supported", path, path.extension() )); diff --git a/src/data/datamapping.cpp b/src/data/datamapping.cpp index 0d14002a2e..9907d49ba5 100644 --- a/src/data/datamapping.cpp +++ b/src/data/datamapping.cpp @@ -186,7 +186,7 @@ bool DataMapping::checkIfAllProvidedColumnsExist( std::string_view key) { if (col.has_value() && !containsColumn(*col, columns, isCaseSensitive)) { - LWARNING(fmt::format("Could not find provided {} column: '{}'", key, *col)); + LWARNING(std::format("Could not find provided {} column: '{}'", key, *col)); return false; } return true; @@ -208,7 +208,7 @@ std::string generateHashString(const DataMapping& dm) { } unsigned int excludeColumnsHash = ghoul::hashCRC32(a); - return fmt::format( + return std::format( "DM|{}|{}|{}|{}|{}|{}|{}|{}", dm.xColumnName.value_or(""), dm.yColumnName.value_or(""), diff --git a/src/data/speckloader.cpp b/src/data/speckloader.cpp index 9dc2e3e6db..e4a8c2e1cd 100644 --- a/src/data/speckloader.cpp +++ b/src/data/speckloader.cpp @@ -76,7 +76,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe std::ifstream file(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format("Failed to open speck file '{}'", path)); + throw ghoul::RuntimeError(std::format("Failed to open speck file '{}'", path)); } Dataset res; @@ -129,7 +129,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe // texturevar // where is the data value index where the texture index is stored if (res.textureDataIndex != -1) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading speck file '{}': Texturevar defined twice", path )); } @@ -148,7 +148,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe // starts. There are 6 values stored in total, xyz + uvw if (res.orientationDataIndex != -1) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading speck file '{}': Orientation index defined twice", path )); } @@ -184,7 +184,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe )); if (nNonEmptyTokens > 4) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading speck file {}: Too many arguments for texture on line {}", path, currentLineNumber )); @@ -205,7 +205,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe for (const Dataset::Texture& t : res.textures) { if (t.index == texture.index) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading speck file '{}': Texture index '{}' defined twice", path, texture.index )); @@ -224,7 +224,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe // If we get this far, we had an illegal header as it wasn't an empty line and // didn't start with either '#' denoting a comment line, and didn't start with // either the 'datavar', 'texturevar', 'polyorivar', or 'texture' keywords - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error in line {} while reading the header information of file '{}'. Line is " "neither a comment line, nor starts with one of the supported keywords for " "SPECK files", @@ -273,7 +273,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe // If the first character is a digit, we have left the preamble and are in the // data section of the file if (!std::isdigit(line[0]) && line[0] != '-') { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading speck file '{}': Header information and datasegment " "intermixed", path )); @@ -297,7 +297,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe if (!str.good()) { // Need to subtract one of the line number here as we increase the current // line count in the beginning of the while loop we are currently in - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading position information out of data line {} in file '{}'. " "Value was not a number", currentLineNumber - 1, path @@ -331,7 +331,7 @@ Dataset loadSpeckFile(std::filesystem::path path, std::optional spe // Need to subtract one of the line number here as we increase the // current line count in the beginning of the while loop we are // currently in - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading data value {} out of data line {} in file '{}'. " "Value was not a number", i, currentLineNumber - 1, path @@ -376,7 +376,7 @@ Labelset loadLabelFile(std::filesystem::path path) { std::ifstream file(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format("Failed to open dataset file '{}'", path)); + throw ghoul::RuntimeError(std::format("Failed to open dataset file '{}'", path)); } Labelset res; @@ -410,7 +410,7 @@ Labelset loadLabelFile(std::filesystem::path path) { // really sure how these configuration files work, but they don't seem to be // included in the speck file) if (res.textColorIndex != -1) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading label file '{}': Textcolor defined twice", path )); } @@ -448,7 +448,7 @@ Labelset loadLabelFile(std::filesystem::path path) { // If the first character is a digit, we have left the preamble and are in the // data section of the file if (!std::isdigit(line[0]) && line[0] != '-') { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading label file '{}': Header information and datasegment " "intermixed", path )); @@ -477,7 +477,7 @@ Labelset loadLabelFile(std::filesystem::path path) { rest = rest.substr(index); } if (!startsWith(rest, "text")) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading label file '{}': File contains an unsupported value " "between positions and text label", path )); @@ -510,7 +510,7 @@ ColorMap loadCmapFile(std::filesystem::path path) { std::ifstream file = std::ifstream(path); if (!file.good()) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Failed to open color map file '{}'", path )); } @@ -575,7 +575,7 @@ ColorMap loadCmapFile(std::filesystem::path path) { res.entries.shrink_to_fit(); if (nColorLines != static_cast(res.entries.size())) { - LWARNINGC("SpeckLoader", fmt::format( + LWARNINGC("SpeckLoader", std::format( "While loading color map '{}', the expected number of color values '{}' was " "different from the actual number of color values '{}'", path, nColorLines, res.entries.size() diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index 9c74ff5fc2..a7820bc02f 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -74,15 +74,15 @@ std::string to_string(const openspace::documentation::TestResult& value) { stream << "Specification Failure. "; for (const TestResult::Offense& offense : value.offenses) { - stream << fmt::format(" {}", ghoul::to_string(offense)); + stream << std::format(" {}", ghoul::to_string(offense)); if (!offense.explanation.empty()) { - stream << fmt::format(" ({})", offense.explanation); + stream << std::format(" ({})", offense.explanation); } stream << '\n'; } for (const TestResult::Warning& warning : value.warnings) { - stream << fmt::format(" {}\n", ghoul::to_string(warning)); + stream << std::format(" {}\n", ghoul::to_string(warning)); } return stream.str(); @@ -95,7 +95,7 @@ std::string to_string(const openspace::documentation::TestResult::Offense& value stream << value.offender + ": " + ghoul::to_string(value.reason); if (!value.explanation.empty()) { - stream << fmt::format(" ({})", value.explanation); + stream << std::format(" ({})", value.explanation); } return stream.str(); @@ -159,7 +159,7 @@ void logError(const SpecificationError& error, std::string component) { LERRORC(error.component, error.message); } else { - LERRORC(fmt::format("{}: {}", component, error.component), error.message); + LERRORC(std::format("{}: {}", component, error.component), error.message); } for (const documentation::TestResult::Offense& o : error.result.offenses) { if (o.explanation.empty()) { @@ -168,7 +168,7 @@ void logError(const SpecificationError& error, std::string component) { else { LERRORC( ghoul::to_string(o.reason), - fmt::format("{}: {}", o.offender, o.explanation) + std::format("{}: {}", o.offender, o.explanation) ); } } diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 89a28af415..42cacd2dd9 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -41,7 +41,7 @@ DocumentationEngine* DocumentationEngine::_instance = nullptr; DocumentationEngine::DuplicateDocumentationException::DuplicateDocumentationException( Documentation doc) - : ghoul::RuntimeError(fmt::format( + : ghoul::RuntimeError(std::format( "Duplicate Documentation with name '{}' and id '{}'", doc.name, doc.id )) , documentation(std::move(doc)) diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 81a7f36a11..f221454833 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -626,12 +626,12 @@ TestResult TableVerifier::operator()(const ghoul::Dictionary& dictionary, // Add the 'key' as a prefix to make the new offender a fully qualified identifer for (TestResult::Offense& s : res.offenses) { - s.offender = fmt::format("{}.{}", key, s.offender); + s.offender = std::format("{}.{}", key, s.offender); } // Add the 'key' as a prefix to make the new warning a fully qualified identifer for (TestResult::Warning& w : res.warnings) { - w.offender = fmt::format("{}.{}", key, w.offender); + w.offender = std::format("{}.{}", key, w.offender); } return res; @@ -718,12 +718,12 @@ TestResult ReferencingVerifier::operator()(const ghoul::Dictionary& dictionary, // Add the 'key' as a prefix to make the offender a fully qualified identifer for (TestResult::Offense& s : r.offenses) { - s.offender = fmt::format("{}.{}", key, s.offender); + s.offender = std::format("{}.{}", key, s.offender); } // Add the 'key' as a prefix to make the warning a fully qualified identifer for (TestResult::Warning& w : r.warnings) { - w.offender = fmt::format("{}.{}", key, w.offender); + w.offender = std::format("{}.{}", key, w.offender); } return r; @@ -797,7 +797,7 @@ std::string OrVerifier::type() const { types.begin(), std::mem_fn(&Verifier::type) ); - types.push_back(fmt::format("or {}", values.back()->type())); + types.push_back(std::format("or {}", values.back()->type())); return ghoul::join(types, ", "); } @@ -811,7 +811,7 @@ std::string OrVerifier::documentation() const { documentations.begin(), std::mem_fn(&Verifier::documentation) ); - documentations.push_back(fmt::format("or {}", values.back()->documentation())); + documentations.push_back(std::format("or {}", values.back()->documentation())); return ghoul::join(documentations, ", "); } diff --git a/src/engine/configuration.cpp b/src/engine/configuration.cpp index 9eb8c9d0a4..7f6f1dd0a9 100644 --- a/src/engine/configuration.cpp +++ b/src/engine/configuration.cpp @@ -551,7 +551,7 @@ void parseLuaState(Configuration& configuration) { if (p.consoleKey.has_value()) { const KeyWithModifier km = stringToKey(*p.consoleKey); if (km.modifier != KeyModifier::None) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Console key '{}' must be a 'bare' key and cannot contain any modifiers", *p.consoleKey )); @@ -690,7 +690,7 @@ std::filesystem::path findConfiguration(const std::string& filename) { if (directory == nextDirectory) { // We have reached the root of the file system and did not find the file throw ghoul::RuntimeError( - fmt::format("Could not find configuration file '{}'", filename), + std::format("Could not find configuration file '{}'", filename), "ConfigurationManager" ); } @@ -707,7 +707,7 @@ Configuration loadConfigurationFromFile(const std::filesystem::path& configurati Configuration result; // Injecting the resolution of the primary screen into the Lua state - const std::string script = fmt::format( + const std::string script = std::format( "ScreenResolution = {{ x = {}, y = {} }}", primaryMonitorResolution.x, primaryMonitorResolution.y ); diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index c91e34c528..c3768943ec 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -140,7 +140,7 @@ std::shared_ptr DownloadManager::downloadFile( FILE* fp; errno_t error = fopen_s(&fp, file.string().c_str(), "wb"); if (error != 0) { - LERROR(fmt::format( + LERROR(std::format( "Could not open/create file: {}. Errno: {}", file, errno )); } @@ -148,7 +148,7 @@ std::shared_ptr DownloadManager::downloadFile( FILE* fp = fopen(file.string().c_str(), "wb"); // write binary #endif // WIN32 if (!fp) { - LERROR(fmt::format( + LERROR(std::format( "Could not open/create file: {}. Errno: {}", file, errno )); } @@ -194,7 +194,7 @@ std::shared_ptr DownloadManager::downloadFile( else { long rescode = 0; curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &rescode); - future->errorMessage = fmt::format( + future->errorMessage = std::format( "{}. HTTP code: {}", curl_easy_strerror(res), rescode ); } @@ -227,7 +227,7 @@ std::future DownloadManager::fetchFile( SuccessCallback successCallback, ErrorCallback errorCallback) { - LDEBUG(fmt::format("Start downloading file '{}' into memory", url)); + LDEBUG(std::format("Start downloading file '{}' into memory", url)); auto downloadFunction = [url, successCb = std::move(successCallback), errorCb = std::move(errorCallback)]() @@ -278,7 +278,7 @@ std::future DownloadManager::fetchFile( errorCb(err); } else { - LWARNING(fmt::format("Error downloading '{}': {}", url, err)); + LWARNING(std::format("Error downloading '{}': {}", url, err)); } curl_easy_cleanup(curl); // Set a boolean variable in MemoryFile to determine if it is diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 4212596462..e098301e56 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -97,7 +97,7 @@ void ModuleEngine::initializeGL() { LDEBUG("Initializing OpenGL of modules"); for (std::unique_ptr& m : _modules) { - LDEBUG(fmt::format("Initializing OpenGL of module '{}'", m->identifier())); + LDEBUG(std::format("Initializing OpenGL of module '{}'", m->identifier())); m->initializeGL(); } LDEBUG("Finished initializing OpenGL of modules"); @@ -109,13 +109,13 @@ void ModuleEngine::deinitialize() { LDEBUG("Deinitializing modules"); for (auto mIt = _modules.rbegin(); mIt != _modules.rend(); ++mIt) { - LDEBUG(fmt::format("Deinitializing module '{}'", (*mIt)->identifier())); + LDEBUG(std::format("Deinitializing module '{}'", (*mIt)->identifier())); (*mIt)->deinitialize(); } LDEBUG("Finished deinitializing modules"); for (auto mIt = _modules.rbegin(); mIt != _modules.rend(); ++mIt) { - LDEBUG(fmt::format("Destroying module '{}'", (*mIt)->identifier())); + LDEBUG(std::format("Destroying module '{}'", (*mIt)->identifier())); (*mIt) = nullptr; } LDEBUG("Finished destroying modules"); @@ -128,7 +128,7 @@ void ModuleEngine::deinitializeGL() { LDEBUG("Deinitializing OpenGL of modules"); for (auto mIt = _modules.rbegin(); mIt != _modules.rend(); ++mIt) { - LDEBUG(fmt::format("Deinitializing OpenGL of module '{}'", (*mIt)->identifier())); + LDEBUG(std::format("Deinitializing OpenGL of module '{}'", (*mIt)->identifier())); (*mIt)->deinitializeGL(); } @@ -149,12 +149,12 @@ void ModuleEngine::registerModule(std::unique_ptr module) { ); if (it != _modules.end()) { throw ghoul::RuntimeError( - fmt::format("Module name '{}' was registered before", module->identifier()), + std::format("Module name '{}' was registered before", module->identifier()), "ModuleEngine" ); } - LDEBUG(fmt::format("Registered module '{}'", module->identifier())); + LDEBUG(std::format("Registered module '{}'", module->identifier())); _modules.push_back(std::move(module)); } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 18dd74ca45..8ee9db5957 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -236,11 +236,11 @@ void OpenSpaceEngine::registerPathTokens() { using T = std::string; for (const std::pair& path : global::configuration->pathTokens) { std::string fullKey = "${" + path.first + "}"; - LDEBUG(fmt::format("Registering path '{}': {}", fullKey, path.second)); + LDEBUG(std::format("Registering path '{}': {}", fullKey, path.second)); const bool overrideBase = (fullKey == "${BASE}"); if (overrideBase) { - LINFO(fmt::format("Overriding base path with '{}'", path.second)); + LINFO(std::format("Overriding base path with '{}'", path.second)); } const bool overrideTemporary = (fullKey == "${TEMPORARY}"); @@ -273,8 +273,8 @@ void OpenSpaceEngine::initialize() { if (global::configuration->usePerProfileCache) { cacheFolder = cacheFolder + "-" + global::configuration->profile; - LINFO(fmt::format("Old cache: {}", absPath("${CACHE}"))); - LINFO(fmt::format("New cache: {}", cacheFolder)); + LINFO(std::format("Old cache: {}", absPath("${CACHE}"))); + LINFO(std::format("New cache: {}", cacheFolder)); FileSys.registerPathToken( "${CACHE}", cacheFolder, @@ -352,13 +352,13 @@ void OpenSpaceEngine::initialize() { const std::string ext = file.extension().string(); std::filesystem::path newCandidate = file; - newCandidate.replace_filename(fmt::format("{}-{}{}", fname, rot, ext)); + newCandidate.replace_filename(std::format("{}-{}{}", fname, rot, ext)); std::filesystem::path oldCandidate = file; if (rot > 1) { // We don't actually have a -0 version, it is just the base name oldCandidate.replace_filename( - fmt::format("{}-{}{}", fname, rot - 1, ext) + std::format("{}-{}{}", fname, rot - 1, ext) ); } @@ -399,10 +399,10 @@ void OpenSpaceEngine::initialize() { // Process profile file std::filesystem::path profile; if (!std::filesystem::is_regular_file(global::configuration->profile)) { - const std::filesystem::path userCandidate = absPath(fmt::format( + const std::filesystem::path userCandidate = absPath(std::format( "${{USER_PROFILES}}/{}.profile", global::configuration->profile )); - const std::filesystem::path profileCandidate = absPath(fmt::format( + const std::filesystem::path profileCandidate = absPath(std::format( "${{PROFILES}}/{}.profile", global::configuration->profile )); @@ -414,7 +414,7 @@ void OpenSpaceEngine::initialize() { profile = profileCandidate; } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not load profile '{}': File does not exist", global::configuration->profile )); @@ -491,7 +491,7 @@ void OpenSpaceEngine::initializeGL() { // Check the required OpenGL versions of the registered modules const ghoul::systemcapabilities::Version version = global::moduleEngine->requiredOpenGLVersion(); - LINFO(fmt::format("Required OpenGL version: {}", ghoul::to_string(version))); + LINFO(std::format("Required OpenGL version: {}", ghoul::to_string(version))); if (OpenGLCap.openGLVersion() < version) { throw ghoul::RuntimeError( @@ -507,7 +507,7 @@ void OpenSpaceEngine::initializeGL() { for (OpenSpaceModule* m : global::moduleEngine->modules()) { for (const std::string& ext : m->requiredOpenGLExtensions()) { if (!SysCap.component().isExtensionSupported(ext)) { - LFATAL(fmt::format( + LFATAL(std::format( "Module '{}' required OpenGL extension '{}' which is not " "available on this system. Some functionality related to this " "module will probably not work", @@ -597,7 +597,7 @@ void OpenSpaceEngine::initializeGL() { const std::string s = ghoul::to_string(source); const std::string t = ghoul::to_string(type); - const std::string cat = fmt::format("OpenGL ({}) [{}] {{{}}}", s, t, id); + const std::string cat = std::format("OpenGL ({}) [{}] {{{}}}", s, t, id); switch (severity) { case Severity::High: LERRORC(cat, message); @@ -619,7 +619,7 @@ void OpenSpaceEngine::initializeGL() { std::string stackString = "Stacktrace\n"; std::vector stack = ghoul::stackTrace(); for (size_t i = 0; i < stack.size(); i++) { - stackString += fmt::format("{}: {}\n", i, stack[i]); + stackString += std::format("{}: {}\n", i, stack[i]); } LDEBUGC(cat, stackString); } @@ -645,26 +645,26 @@ void OpenSpaceEngine::initializeGL() { case GL_INVALID_ENUM: LERRORC( "OpenGL Invalid State", - fmt::format("Function '{}': GL_INVALID_ENUM", f.function->name()) + std::format("Function '{}': GL_INVALID_ENUM", f.function->name()) ); break; case GL_INVALID_VALUE: LERRORC( "OpenGL Invalid State", - fmt::format("Function '{}': GL_INVALID_VALUE", f.function->name()) + std::format("Function '{}': GL_INVALID_VALUE", f.function->name()) ); break; case GL_INVALID_OPERATION: LERRORC( "OpenGL Invalid State", - fmt::format( + std::format( "Function '{}': GL_INVALID_OPERATION", f.function->name() )); break; case GL_INVALID_FRAMEBUFFER_OPERATION: LERRORC( "OpenGL Invalid State", - fmt::format( + std::format( "Function '{}': GL_INVALID_FRAMEBUFFER_OPERATION", f.function->name() ) @@ -673,13 +673,13 @@ void OpenSpaceEngine::initializeGL() { case GL_OUT_OF_MEMORY: LERRORC( "OpenGL Invalid State", - fmt::format("Function '{}': GL_OUT_OF_MEMORY", f.function->name()) + std::format("Function '{}': GL_OUT_OF_MEMORY", f.function->name()) ); break; default: LERRORC( "OpenGL Invalid State", - fmt::format("Unknown error code: {0:x}", static_cast(error)) + std::format("Unknown error code: {0:x}", static_cast(error)) ); } }); @@ -910,7 +910,7 @@ void OpenSpaceEngine::runGlobalCustomizationScripts() { std::filesystem::path s = absPath(script); if (std::filesystem::is_regular_file(s)) { try { - LINFO(fmt::format("Running global customization script: {}", s)); + LINFO(std::format("Running global customization script: {}", s)); ghoul::lua::runScriptFile(state, s.string()); } catch (const ghoul::RuntimeError& e) { @@ -918,7 +918,7 @@ void OpenSpaceEngine::runGlobalCustomizationScripts() { } } else { - LDEBUG(fmt::format("Ignoring non-existing script file: {}", s)); + LDEBUG(std::format("Ignoring non-existing script file: {}", s)); } } } @@ -932,15 +932,15 @@ void OpenSpaceEngine::loadFonts() { std::filesystem::path fontName = absPath(font.second); if (!std::filesystem::is_regular_file(fontName)) { - LERROR(fmt::format("Could not find font '{}' for key '{}'", fontName, key)); + LERROR(std::format("Could not find font '{}' for key '{}'", fontName, key)); continue; } - LDEBUG(fmt::format("Registering font '{}' with key '{}'", fontName, key)); + LDEBUG(std::format("Registering font '{}' with key '{}'", fontName, key)); const bool success = global::fontManager->registerFontPath(key, fontName); if (!success) { - LERROR(fmt::format( + LERROR(std::format( "Error registering font '{}' with key '{}'", fontName, key )); } @@ -1136,13 +1136,13 @@ void OpenSpaceEngine::postSynchronizationPreDraw() { int fatalCounter = LogMgr.messageCounter(ghoul::logging::LogLevel::Fatal); if (warningCounter > 0) { - LWARNINGC("Logging", fmt::format("Number of Warnings: {}", warningCounter)); + LWARNINGC("Logging", std::format("Number of Warnings: {}", warningCounter)); } if (errorCounter > 0) { - LWARNINGC("Logging", fmt::format("Number of Errors: {}", errorCounter)); + LWARNINGC("Logging", std::format("Number of Errors: {}", errorCounter)); } if (fatalCounter > 0) { - LWARNINGC("Logging", fmt::format("Number of Fatals: {}", fatalCounter)); + LWARNINGC("Logging", std::format("Number of Fatals: {}", fatalCounter)); } LogMgr.resetMessageCounters(); @@ -1453,7 +1453,7 @@ void OpenSpaceEngine::handleDragDrop(std::filesystem::path file) { } if (lua_isnil(s, -1)) { - LWARNING(fmt::format("Unhandled file dropped: {}", file)); + LWARNING(std::format("Unhandled file dropped: {}", file)); return; } @@ -1514,14 +1514,14 @@ bool OpenSpaceEngine::setMode(Mode newMode) { return false; } else if (_currentMode != Mode::UserControl && newMode != Mode::UserControl) { - LERROR(fmt::format( + LERROR(std::format( "Cannot switch to mode '{}' when in '{}' mode", stringify(newMode), stringify(_currentMode) )); return false; } - LDEBUG(fmt::format("Mode: {}", stringify(newMode))); + LDEBUG(std::format("Mode: {}", stringify(newMode))); _currentMode = newMode; return true; @@ -1529,7 +1529,7 @@ bool OpenSpaceEngine::setMode(Mode newMode) { void OpenSpaceEngine::resetMode() { _currentMode = Mode::UserControl; - LDEBUG(fmt::format("Reset engine mode to '{}'", stringify(_currentMode))); + LDEBUG(std::format("Reset engine mode to '{}'", stringify(_currentMode))); } OpenSpaceEngine::CallbackHandle OpenSpaceEngine::addModeChangeCallback( @@ -1603,7 +1603,7 @@ void setCameraFromProfile(const Profile& p) { auto checkNodeExists = [](const std::string& node) { if (global::renderEngine->scene()->sceneGraphNode(node) == nullptr) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error when setting camera from profile. Could not find node '{}'", node )); } @@ -1644,10 +1644,10 @@ void setCameraFromProfile(const Profile& p) { // dependency in this core code. Eventually, goToGeo will be incorporated // in the OpenSpace core and this code will change. checkNodeExists(geo.anchor); - std::string geoScript = fmt::format("openspace.globebrowsing.goToGeo" + std::string geoScript = std::format("openspace.globebrowsing.goToGeo" "([[{}]], {}, {}", geo.anchor, geo.latitude, geo.longitude); if (geo.altitude.has_value()) { - geoScript += fmt::format(", {}", geo.altitude.value()); + geoScript += std::format(", {}", geo.altitude.value()); } geoScript += ")"; global::scriptEngine->queueScript( @@ -1707,12 +1707,12 @@ void setActionsFromProfile(const Profile& p) { LERROR("Identifier must to provided to register action"); } if (global::actionManager->hasAction(a.identifier)) { - LERROR(fmt::format( + LERROR(std::format( "Action for identifier '{}' already existed & registered", a.identifier )); } if (a.script.empty()) { - LERROR(fmt::format( + LERROR(std::format( "Identifier '{}' does not provide a Lua command to execute", a.identifier )); } @@ -1733,10 +1733,10 @@ void setKeybindingsFromProfile(const Profile& p) { LERROR("Action must not be empty"); } if (!global::actionManager->hasAction(k.action)) { - LERROR(fmt::format("Action '{}' does not exist", k.action)); + LERROR(std::format("Action '{}' does not exist", k.action)); } if (k.key.key == openspace::Key::Unknown) { - LERROR(fmt::format( + LERROR(std::format( "Could not find key '{}'", std::to_string(static_cast(k.key.key)) )); diff --git a/src/engine/openspaceengine_lua.inl b/src/engine/openspaceengine_lua.inl index d1aafdb5a6..42efc4ebb0 100644 --- a/src/engine/openspaceengine_lua.inl +++ b/src/engine/openspaceengine_lua.inl @@ -66,7 +66,7 @@ namespace { SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(uri); if (!node) { - throw ghoul::lua::LuaError(fmt::format("Unknown scene graph node '{}'", uri)); + throw ghoul::lua::LuaError(std::format("Unknown scene graph node '{}'", uri)); } node->addTag(std::move(tag)); @@ -78,7 +78,7 @@ namespace { SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(uri); if (!node) { - throw ghoul::lua::LuaError(fmt::format("Unknown scene graph node '{}'", uri)); + throw ghoul::lua::LuaError(std::format("Unknown scene graph node '{}'", uri)); } node->removeTag(tag); @@ -90,7 +90,7 @@ namespace { { using namespace openspace; - LINFOC("OpenSpaceEngine", fmt::format("Downloading file from '{}'", url)); + LINFOC("OpenSpaceEngine", std::format("Downloading file from '{}'", url)); std::shared_ptr future = global::downloadManager->downloadFile( url, @@ -103,7 +103,7 @@ namespace { if (waitForCompletion) { while (!future->isFinished && future->errorMessage.empty()) { // just wait - LTRACEC("OpenSpaceEngine", fmt::format("waiting '{}'", future->errorMessage)); + LTRACEC("OpenSpaceEngine", std::format("waiting '{}'", future->errorMessage)); } } } @@ -142,7 +142,7 @@ namespace { ); const bool hasCachedFile = std::filesystem::is_regular_file(fileName); if (hasCachedFile) { - LDEBUGC("OpenSpaceEngine", fmt::format("Cached file '{}' used", fileName)); + LDEBUGC("OpenSpaceEngine", std::format("Cached file '{}' used", fileName)); return fileName; } else { @@ -220,7 +220,7 @@ namespace { bool includeFirstLine = false) { if (!std::filesystem::exists(file) || !std::filesystem::is_regular_file(file)) { - throw ghoul::lua::LuaError(fmt::format("Could not find file '{}'", file)); + throw ghoul::lua::LuaError(std::format("Could not find file '{}'", file)); } std::vector> res = @@ -258,7 +258,7 @@ namespace { */ [[codegen::luawrap]] ghoul::Dictionary loadJson(std::filesystem::path path) { if (!std::filesystem::exists(path)) { - throw ghoul::RuntimeError(fmt::format("File '{}' did not exist", path)); + throw ghoul::RuntimeError(std::format("File '{}' did not exist", path)); } std::ifstream f(path); diff --git a/src/engine/settings.cpp b/src/engine/settings.cpp index 8eee78e707..2b6a09b989 100644 --- a/src/engine/settings.cpp +++ b/src/engine/settings.cpp @@ -68,7 +68,7 @@ namespace version1 { settings.visibility = properties::Property::Visibility::Developer; } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Unknown visibility value '{}'", *visibility )); } @@ -127,7 +127,7 @@ Settings loadSettings(const std::filesystem::path& filename) { return version1::parseSettings(setting); } - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Unrecognized version for setting: {}", version )); } diff --git a/src/events/event.cpp b/src/events/event.cpp index 59bba16046..f1aa87de91 100644 --- a/src/events/event.cpp +++ b/src/events/event.cpp @@ -45,12 +45,12 @@ namespace openspace::events { void log(int i, const EventSceneGraphNodeAdded& e) { ghoul_assert(e.type == EventSceneGraphNodeAdded::Type, "Wrong type"); - LINFO(fmt::format("[{}] SceneGraphNodeAdded: {}", i, e.node)); + LINFO(std::format("[{}] SceneGraphNodeAdded: {}", i, e.node)); } void log(int i, const EventSceneGraphNodeRemoved& e) { ghoul_assert(e.type == EventSceneGraphNodeRemoved::Type, "Wrong type"); - LINFO(fmt::format("[{}] SceneGraphNodeRemoved: {}", i, e.node)); + LINFO(std::format("[{}] SceneGraphNodeRemoved: {}", i, e.node)); } void log(int i, const EventParallelConnection& e) { @@ -64,12 +64,12 @@ void log(int i, const EventParallelConnection& e) { default: throw ghoul::MissingCaseException(); } }(e.state); - LINFO(fmt::format("[{}] ParallelConnection ({})", i, state)); + LINFO(std::format("[{}] ParallelConnection ({})", i, state)); } void log(int i, [[ maybe_unused ]] const EventProfileLoadingFinished& e) { ghoul_assert(e.type == EventProfileLoadingFinished::Type, "Wrong type"); - LINFO(fmt::format("[{}] ProfileLoadingFinished", i)); + LINFO(std::format("[{}] ProfileLoadingFinished", i)); } void log(int i, const EventApplicationShutdown& e) { @@ -82,17 +82,17 @@ void log(int i, const EventApplicationShutdown& e) { default: throw ghoul::MissingCaseException(); } }(e.state); - LINFO(fmt::format("[{}] ApplicationShutdown", i)); + LINFO(std::format("[{}] ApplicationShutdown", i)); } void log(int i, const EventScreenSpaceRenderableAdded& e) { ghoul_assert(e.type == EventScreenSpaceRenderableAdded::Type, "Wrong type"); - LINFO(fmt::format("[{}] ScreenSpaceRenderableAdded: {}", i, e.renderable)); + LINFO(std::format("[{}] ScreenSpaceRenderableAdded: {}", i, e.renderable)); } void log(int i, const EventScreenSpaceRenderableRemoved& e) { ghoul_assert(e.type == EventScreenSpaceRenderableRemoved::Type, "Wrong type"); - LINFO(fmt::format("[{}] ScreenSpaceRenderableRemoved: {}", i, e.renderable)); + LINFO(std::format("[{}] ScreenSpaceRenderableRemoved: {}", i, e.renderable)); } void log(int i, const EventCameraFocusTransition& e) { @@ -112,7 +112,7 @@ void log(int i, const EventCameraFocusTransition& e) { } }(e.transition); - LINFO(fmt::format( + LINFO(std::format( "[{}] CameraTransition: {}, {} ({})", i, reinterpret_cast(e.camera), e.node, t )); @@ -120,7 +120,7 @@ void log(int i, const EventCameraFocusTransition& e) { void log(int i, const EventTimeOfInterestReached& e) { ghoul_assert(e.type == EventTimeOfInterestReached::Type, "Wrong type"); - LINFO(fmt::format( + LINFO(std::format( "[{}] TimeOfInterestReached: {}, {}", i, e.time->UTC(), reinterpret_cast(e.camera) )); @@ -128,32 +128,32 @@ void log(int i, const EventTimeOfInterestReached& e) { void log(int i, [[ maybe_unused ]] const EventMissionEventReached& e) { ghoul_assert(e.type == EventMissionEventReached::Type, "Wrong type"); - LINFO(fmt::format("[{}] MissionEventReached", i)); + LINFO(std::format("[{}] MissionEventReached", i)); } void log(int i, const EventPlanetEclipsed& e) { ghoul_assert(e.type == EventPlanetEclipsed::Type, "Wrong type"); - LINFO(fmt::format("[{}] PlanetEclipsed: {} -> {}", i, e.eclipsee, e.eclipser)); + LINFO(std::format("[{}] PlanetEclipsed: {} -> {}", i, e.eclipsee, e.eclipser)); } void log(int i, [[ maybe_unused ]] const EventInterpolationFinished& e) { ghoul_assert(e.type == EventInterpolationFinished::Type, "Wrong type"); - LINFO(fmt::format("[{}] InterpolationFinished", i)); + LINFO(std::format("[{}] InterpolationFinished", i)); } void log(int i, const EventFocusNodeChanged& e) { ghoul_assert(e.type == EventFocusNodeChanged::Type, "Wrong type"); - LINFO(fmt::format("[{}] FocusNodeChanged: {} -> {}", i, e.oldNode, e.newNode)); + LINFO(std::format("[{}] FocusNodeChanged: {} -> {}", i, e.oldNode, e.newNode)); } void log(int i, const EventLayerAdded& e) { ghoul_assert(e.type == EventLayerAdded::Type, "Wrong type"); - LINFO(fmt::format("[{}] LayerAdded: {}", i, e.layer)); + LINFO(std::format("[{}] LayerAdded: {}", i, e.layer)); } void log(int i, const EventLayerRemoved& e) { ghoul_assert(e.type == EventLayerRemoved::Type, "Wrong type"); - LINFO(fmt::format("[{}] LayerRemoved: {}", i, e.layer)); + LINFO(std::format("[{}] LayerRemoved: {}", i, e.layer)); } void log(int i, const EventSessionRecordingPlayback& e) { @@ -169,12 +169,12 @@ void log(int i, const EventSessionRecordingPlayback& e) { } }(e.state); - LINFO(fmt::format("[{}] SessionRecordingPlayback: {}", i, state)); + LINFO(std::format("[{}] SessionRecordingPlayback: {}", i, state)); } void log(int i, const EventPointSpacecraft& e) { ghoul_assert(e.type == EventPointSpacecraft::Type, "Wrong type"); - LINFO(fmt::format( + LINFO(std::format( "[{}] PointSpacecraft: Ra: {}, Dec: {}, Duration: {}", i, e.ra, e.dec, e.duration )); @@ -182,17 +182,17 @@ void log(int i, const EventPointSpacecraft& e) { void log(int i, const EventRenderableEnabled& e) { ghoul_assert(e.type == EventRenderableEnabled::Type, "Wrong type"); - LINFO(fmt::format("[{}] EventRenderableEnabled: {}", i, e.node)); + LINFO(std::format("[{}] EventRenderableEnabled: {}", i, e.node)); } void log(int i, const EventRenderableDisabled& e) { ghoul_assert(e.type == EventRenderableDisabled::Type, "Wrong type"); - LINFO(fmt::format("[{}] EventRenderableDisabled: {}", i, e.node)); + LINFO(std::format("[{}] EventRenderableDisabled: {}", i, e.node)); } void log(int i, const EventCameraPathStarted& e) { ghoul_assert(e.type == EventCameraPathStarted::Type, "Wrong type"); - LINFO(fmt::format( + LINFO(std::format( "[{}] EventCameraPathStarted: Origin: '{}' Destination: '{}'", i, e.origin, e.destination )); @@ -200,7 +200,7 @@ void log(int i, const EventCameraPathStarted& e) { void log(int i, const EventCameraPathFinished& e) { ghoul_assert(e.type == EventCameraPathFinished::Type, "Wrong type"); - LINFO(fmt::format( + LINFO(std::format( "[{}] EventCameraPathFinished: Origin: '{}' Destination: '{}'", i, e.origin, e.destination )); @@ -208,12 +208,12 @@ void log(int i, const EventCameraPathFinished& e) { void log(int i, const EventCameraMovedPosition& e) { ghoul_assert(e.type == EventCameraMovedPosition::Type, "Wrong type"); - LINFO(fmt::format("[{}] EventCameraMovedPosition", i)); + LINFO(std::format("[{}] EventCameraMovedPosition", i)); } void log(int i, const CustomEvent& e) { ghoul_assert(e.type == CustomEvent::Type, "Wrong type"); - LINFO(fmt::format("[{}] CustomEvent: {} ({})", i, e.subtype, e.payload)); + LINFO(std::format("[{}] CustomEvent: {} ({})", i, e.subtype, e.payload)); } std::string_view toString(Event::Type type) { @@ -318,7 +318,7 @@ Event::Type fromString(std::string_view str) { return Event::Type::Custom; } - throw ghoul::RuntimeError(fmt::format("Unknown event type '{}'", str)); + throw ghoul::RuntimeError(std::format("Unknown event type '{}'", str)); } ghoul::Dictionary toParameter(const Event& e) { diff --git a/src/events/eventengine.cpp b/src/events/eventengine.cpp index da1f06c9f9..b135b72c13 100644 --- a/src/events/eventengine.cpp +++ b/src/events/eventengine.cpp @@ -124,7 +124,7 @@ void EventEngine::unregisterEventAction(uint32_t identifier) { } // If we get this far, we haven't found the identifier - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find event with identifier '{}'", identifier )); } @@ -148,13 +148,13 @@ void EventEngine::unregisterEventTopic(size_t topicId, events::Event::Type type) } } else { - LWARNING(fmt::format("Could not find registered event '{}' with topicId: {}", + LWARNING(std::format("Could not find registered event '{}' with topicId: {}", events::toString(type), topicId) ); } } else { - LWARNING(fmt::format("Could not find registered event '{}'", + LWARNING(std::format("Could not find registered event '{}'", events::toString(type)) ); } diff --git a/src/interaction/actionmanager.cpp b/src/interaction/actionmanager.cpp index becc063264..5f72d9cbc1 100644 --- a/src/interaction/actionmanager.cpp +++ b/src/interaction/actionmanager.cpp @@ -88,7 +88,7 @@ void ActionManager::triggerAction(const std::string& identifier, if (!hasAction(identifier)) { LWARNINGC( "ActionManager", - fmt::format("Action '{}' not found in the list", identifier) + std::format("Action '{}' not found in the list", identifier) ); return; } @@ -97,7 +97,7 @@ void ActionManager::triggerAction(const std::string& identifier, std::string script = arguments.isEmpty() ? a.command : - fmt::format("args = {}\n{}", ghoul::formatLua(arguments), a.command); + std::format("args = {}\n{}", ghoul::formatLua(arguments), a.command); if (!shouldBeSynchronized || a.isLocal) { global::scriptEngine->queueScript( diff --git a/src/interaction/actionmanager_lua.inl b/src/interaction/actionmanager_lua.inl index f07d82b63a..be68d6672f 100644 --- a/src/interaction/actionmanager_lua.inl +++ b/src/interaction/actionmanager_lua.inl @@ -64,7 +64,7 @@ namespace { } if (!global::actionManager->hasAction(identifier)) { throw ghoul::lua::LuaError( - fmt::format("Identifier '{}' for action not found", identifier) + std::format("Identifier '{}' for action not found", identifier) ); } @@ -105,7 +105,7 @@ struct [[codegen::Dictionary(Action)]] Action { using namespace openspace; if (global::actionManager->hasAction(action.identifier)) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Identifier '{}' for action already registered", action.identifier )); } @@ -118,7 +118,7 @@ struct [[codegen::Dictionary(Action)]] Action { a.guiPath = action.guiPath.value_or(a.guiPath); if (!a.guiPath.starts_with('/')) { throw ghoul::RuntimeError( - fmt::format( + std::format( "Tried to register action: '{}'. The field 'GuiPath' is set to '{}' but " "should be '/{}' ", a.name, a.guiPath, a.guiPath) ); @@ -141,7 +141,7 @@ struct [[codegen::Dictionary(Action)]] Action { } if (!global::actionManager->hasAction(identifier)) { throw ghoul::lua::LuaError( - fmt::format("Identifier '{}' for action not found", identifier) + std::format("Identifier '{}' for action not found", identifier) ); } @@ -189,7 +189,7 @@ struct [[codegen::Dictionary(Action)]] Action { throw ghoul::lua::LuaError("Identifier must not be empty"); } if (!global::actionManager->hasAction(id)) { - throw ghoul::lua::LuaError(fmt::format("Action '{}' not found", id)); + throw ghoul::lua::LuaError(std::format("Action '{}' not found", id)); } // No sync because this is already inside a Lua script, therefor it has diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 66f18db6b3..676130bbe4 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -162,7 +162,7 @@ void JoystickCameraStates::updateStateFromInput( localRotation.second.y += value; break; case AxisType::Property: - const std::string script = fmt::format( + const std::string script = std::format( "openspace.setPropertyValue('{}', {});", t.propertyUri, value ); @@ -421,7 +421,7 @@ JoystickCameraStates::joystickCameraState(const std::string& joystickName) const } } - LWARNING(fmt::format("Cannot find JoystickCameraState with name '{}'", joystickName)); + LWARNING(std::format("Cannot find JoystickCameraState with name '{}'", joystickName)); return nullptr; } @@ -436,7 +436,7 @@ JoystickCameraStates::findOrAddJoystickCameraState(const std::string& joystickNa joystick->joystickName = joystickName; } else { - LWARNING(fmt::format( + LWARNING(std::format( "Cannot add more joysticks, only {} joysticks are supported", JoystickInputStates::MaxNumJoysticks )); diff --git a/src/interaction/keybindingmanager_lua.inl b/src/interaction/keybindingmanager_lua.inl index 6343059530..a6d369110c 100644 --- a/src/interaction/keybindingmanager_lua.inl +++ b/src/interaction/keybindingmanager_lua.inl @@ -35,12 +35,12 @@ namespace { throw ghoul::lua::LuaError("Action must not be empty"); } if (!global::actionManager->hasAction(action)) { - throw ghoul::lua::LuaError(fmt::format("Action '{}' does not exist", action)); + throw ghoul::lua::LuaError(std::format("Action '{}' does not exist", action)); } openspace::KeyWithModifier iKey = openspace::stringToKey(key); if (iKey.key == openspace::Key::Unknown) { - throw ghoul::lua::LuaError(fmt::format("Could not find key '{}'", key)); + throw ghoul::lua::LuaError(std::format("Could not find key '{}'", key)); } global::keybindingManager->bindKey(iKey.key, iKey.modifier, std::move(action)); diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index b30297c21b..2012271d3e 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -183,7 +183,7 @@ bool SessionRecording::handleRecordingFile(std::string filenameIn) { std::filesystem::path absFilename = absPath("${RECORDINGS}/" + filenameIn); if (std::filesystem::is_regular_file(absFilename)) { - LERROR(fmt::format( + LERROR(std::format( "Unable to start recording; file '{}' already exists", absFilename )); return false; @@ -196,7 +196,7 @@ bool SessionRecording::handleRecordingFile(std::string filenameIn) { } if (!_recordFile.is_open() || !_recordFile.good()) { - LERROR(fmt::format( + LERROR(std::format( "Unable to open file '{}' for keyframe recording", absFilename )); return false; @@ -266,7 +266,7 @@ void SessionRecording::recordCurrentTimePauseState() { } void SessionRecording::recordCurrentTimeRate() { - std::string initialTimeRateCommand = fmt::format( + std::string initialTimeRateCommand = std::format( "openspace.time.setDeltaTime({})", global::timeManager->targetDeltaTime() ); saveScriptKeyframeToPropertiesBaseline(std::move(initialTimeRateCommand)); @@ -426,7 +426,7 @@ bool SessionRecording::startPlayback(std::string& filename, } if (!_playbackFile.is_open() || !_playbackFile.good()) { - LERROR(fmt::format( + LERROR(std::format( "Unable to open file '{}' for keyframe playback", absFilename.c_str() )); stopPlayback(); @@ -464,7 +464,7 @@ bool SessionRecording::startPlayback(std::string& filename, return false; } - LINFO(fmt::format( + LINFO(std::format( "Playback session started: ({:8.3f},0.0,{:13.3f}) with {}/{}/{} entries, " "forceTime={}", now, _timestampPlaybackStarted_simulation, _keyframesCamera.size(), @@ -972,7 +972,7 @@ void SessionRecording::savePropertyBaseline(properties::Property& prop) { != _propertyBaselinesSaved.end() ); if (!isPropAlreadySaved) { - const std::string initialScriptCommand = fmt::format( + const std::string initialScriptCommand = std::format( "openspace.setPropertyValueSingle(\"{}\", {})", propIdentifier, prop.stringValue() ); @@ -1047,7 +1047,7 @@ void SessionRecording::render() { glm::vec4(1.f), ghoul::fontrendering::CrDirection::Down ); - const std::string text2 = fmt::format( + const std::string text2 = std::format( "Scale: {}", global::navigationHandler->camera()->scaling() ); ghoul::fontrendering::RenderFont(*font, penPosition, text2, glm::vec4(1.f)); @@ -1081,7 +1081,7 @@ bool SessionRecording::playbackAddEntriesToTimeline() { unsigned char frameType = readFromPlayback(_playbackFile); // Check if have reached EOF if (!_playbackFile) { - LINFO(fmt::format( + LINFO(std::format( "Finished parsing {} entries from playback file '{}'", _playbackLineNum - 1, _playbackFilename )); @@ -1097,7 +1097,7 @@ bool SessionRecording::playbackAddEntriesToTimeline() { parsingStatusOk = playbackScript(); } else { - LERROR(fmt::format( + LERROR(std::format( "Unknown frame type {} @ index {} of playback file '{}'", frameType, _playbackLineNum - 1, _playbackFilename )); @@ -1115,7 +1115,7 @@ bool SessionRecording::playbackAddEntriesToTimeline() { std::istringstream iss(_playbackLineParsing); std::string entryType; if (!(iss >> entryType)) { - LERROR(fmt::format( + LERROR(std::format( "Error reading entry type @ line {} of playback file '{}'", _playbackLineNum, _playbackFilename )); @@ -1135,7 +1135,7 @@ bool SessionRecording::playbackAddEntriesToTimeline() { continue; } else { - LERROR(fmt::format( + LERROR(std::format( "Unknown frame type {} @ line {} of playback file '{}'", entryType, _playbackLineNum, _playbackFilename )); @@ -1143,7 +1143,7 @@ bool SessionRecording::playbackAddEntriesToTimeline() { break; } } - LINFO(fmt::format( + LINFO(std::format( "Finished parsing {} entries from playback file '{}'", _playbackLineNum, _playbackFilename )); @@ -1323,14 +1323,14 @@ bool SessionRecording::readCameraKeyframeBinary(Timestamps& times, kf.read(&file); } catch (std::bad_alloc&) { - LERROR(fmt::format( + LERROR(std::format( "Allocation error with camera playback from keyframe entry {}", lineN - 1 )); return false; } catch (std::length_error&) { - LERROR(fmt::format( + LERROR(std::format( "length_error with camera playback from keyframe entry {}", lineN - 1 )); @@ -1338,7 +1338,7 @@ bool SessionRecording::readCameraKeyframeBinary(Timestamps& times, } if (!file) { - LINFO(fmt::format( + LINFO(std::format( "Error reading camera playback from keyframe entry {}", lineN - 1 )); @@ -1361,7 +1361,7 @@ bool SessionRecording::readCameraKeyframeAscii(Timestamps& times, kf._timestamp = times.timeOs; if (iss.fail() || !iss.eof()) { - LERROR(fmt::format("Error parsing camera line {} of playback file", lineN)); + LERROR(std::format("Error parsing camera line {} of playback file", lineN)); return false; } return true; @@ -1453,14 +1453,14 @@ bool SessionRecording::readTimeKeyframeBinary(Timestamps& times, kf.read(&file); } catch (std::bad_alloc&) { - LERROR(fmt::format( + LERROR(std::format( "Allocation error with time playback from keyframe entry {}", lineN - 1 )); return false; } catch (std::length_error&) { - LERROR(fmt::format( + LERROR(std::format( "length_error with time playback from keyframe entry {}", lineN - 1 )); @@ -1468,7 +1468,7 @@ bool SessionRecording::readTimeKeyframeBinary(Timestamps& times, } if (!file) { - LERROR(fmt::format( + LERROR(std::format( "Error reading time playback from keyframe entry {}", lineN - 1 )); return false; @@ -1489,7 +1489,7 @@ bool SessionRecording::readTimeKeyframeAscii(Timestamps& times, kf.read(iss); if (iss.fail() || !iss.eof()) { - LERROR(fmt::format( + LERROR(std::format( "Error parsing time line {} of playback file", lineN )); return false; @@ -1561,7 +1561,7 @@ void SessionRecording::checkIfScriptUsesScenegraphNode(std::string s) { if (navNode != "nil") { auto it = std::find(_loadedNodes.begin(), _loadedNodes.end(), navNode); if (it == _loadedNodes.end()) { - LWARNING(fmt::format( + LWARNING(std::format( "Playback file contains a property setting of navigation using " "scenegraph node '{}', which is not currently loaded", navNode )); @@ -1576,7 +1576,7 @@ void SessionRecording::checkIfScriptUsesScenegraphNode(std::string s) { subjectOfSetProp ); if (matchHits.empty()) { - LWARNING(fmt::format( + LWARNING(std::format( "Playback file contains a property setting of scenegraph " "node '{}', which is not currently loaded", found )); @@ -1668,7 +1668,7 @@ bool SessionRecording::checkIfInitialFocusNodeIsLoaded(unsigned int firstCamInde _keyframesCamera[_timeline[firstCamIndex].idxIntoKeyframeTypeArray].focusNode; auto it = std::find(_loadedNodes.begin(), _loadedNodes.end(), startFocusNode); if (it == _loadedNodes.end()) { - LERROR(fmt::format( + LERROR(std::format( "Playback file requires scenegraph node '{}', which is " "not currently loaded", startFocusNode )); @@ -1743,14 +1743,14 @@ bool SessionRecording::readScriptKeyframeBinary(Timestamps& times, kf.read(&file); } catch (std::bad_alloc&) { - LERROR(fmt::format( + LERROR(std::format( "Allocation error with script playback from keyframe entry {}", lineN - 1 )); return false; } catch (std::length_error&) { - LERROR(fmt::format( + LERROR(std::format( "length_error with script playback from keyframe entry {}", lineN - 1 )); @@ -1758,7 +1758,7 @@ bool SessionRecording::readScriptKeyframeBinary(Timestamps& times, } if (!file) { - LERROR(fmt::format( + LERROR(std::format( "Error reading script playback from keyframe entry {}", lineN - 1 )); @@ -1778,11 +1778,11 @@ bool SessionRecording::readScriptKeyframeAscii(Timestamps& times, iss >> times.timeOs >> times.timeRec >> times.timeSim; kf.read(iss); if (iss.fail()) { - LERROR(fmt::format("Error parsing script line {} of playback file", lineN)); + LERROR(std::format("Error parsing script line {} of playback file", lineN)); return false; } else if (!iss.eof()) { - LERROR(fmt::format("Did not find an EOL at line {} of playback file", lineN)); + LERROR(std::format("Did not find an EOL at line {} of playback file", lineN)); return false; } return true; @@ -1801,7 +1801,7 @@ bool SessionRecording::addKeyframeToTimeline(std::vector& timelin }); } catch(...) { - LERROR(fmt::format( + LERROR(std::format( "Timeline memory allocation error trying to add keyframe {}. The playback " "file may be too large for system memory", lineNum - 1 @@ -2004,7 +2004,7 @@ bool SessionRecording::processNextNonCameraKeyframeAheadInTime() { _idxScript = _timeline[_idxTimeline_nonCamera].idxIntoKeyframeTypeArray; return processScriptKeyframe(); default: - LERROR(fmt::format( + LERROR(std::format( "Bad keyframe type encountered during playback at index {}", _idxTimeline_nonCamera )); @@ -2284,7 +2284,7 @@ void SessionRecording::readFileIntoStringStream(std::string filename, { std::filesystem::path conversionInFilename = absPath(filename); if (!std::filesystem::is_regular_file(conversionInFilename)) { - throw ConversionError(fmt::format( + throw ConversionError(std::format( "Cannot find the specified playback file '{}' to convert", conversionInFilename )); @@ -2303,7 +2303,7 @@ void SessionRecording::readFileIntoStringStream(std::string filename, } stream << inputFstream.rdbuf(); if (!inputFstream.is_open() || !inputFstream.good()) { - throw ConversionError(fmt::format( + throw ConversionError(std::format( "Unable to open file '{}' for conversion", filename )); } @@ -2355,7 +2355,7 @@ std::string SessionRecording::convertFile(std::string filename, int depth) { } if (depth != 0) { conversionOutFilename = determineConversionOutFilename(filename, mode); - LINFO(fmt::format( + LINFO(std::format( "Starting conversion on rec file '{}', version {} in {} mode. " "Writing result to '{}'", newFilename, fileVersion, (mode == DataMode::Ascii) ? "ascii" : "binary", @@ -2369,7 +2369,7 @@ std::string SessionRecording::convertFile(std::string filename, int depth) { conversionOutFile.open(conversionOutFilename); } if (!conversionOutFile.is_open() || !conversionOutFile.good()) { - LERROR(fmt::format( + LERROR(std::format( "Unable to open file '{}' for conversion result", conversionOutFilename )); @@ -2422,7 +2422,7 @@ bool SessionRecording::convertEntries(std::string& inFilename, unsigned char frameType = readFromPlayback(inStream); // Check if have reached EOF if (!inStream) { - LINFO(fmt::format( + LINFO(std::format( "Finished converting {} entries from playback file '{}'", lineNum - 1, inFilename )); @@ -2465,7 +2465,7 @@ bool SessionRecording::convertEntries(std::string& inFilename, } } else { - LERROR(fmt::format( + LERROR(std::format( "Unknown frame type {} @ index {} of conversion file '{}'", frameType, lineNum - 1, inFilename )); @@ -2481,7 +2481,7 @@ bool SessionRecording::convertEntries(std::string& inFilename, std::istringstream iss(lineParsing); std::string entryType; if (!(iss >> entryType)) { - LERROR(fmt::format( + LERROR(std::format( "Error reading entry type @ line {} of conversion file '{}'", lineNum, inFilename )); @@ -2528,14 +2528,14 @@ bool SessionRecording::convertEntries(std::string& inFilename, continue; } else { - LERROR(fmt::format( + LERROR(std::format( "Unknown frame type {} @ line {} of conversion file '{}'", entryType, lineNum, inFilename )); conversionStatusOk = false; } } - LINFO(fmt::format( + LINFO(std::format( "Finished parsing {} entries from conversion file '{}'", lineNum, inFilename )); @@ -2553,7 +2553,7 @@ std::string SessionRecording_legacy_0085::getLegacyConversionResult(std::string { // This method is overriden in each legacy subclass, but does nothing in this instance // as the oldest supported legacy version. - LERROR(fmt::format( + LERROR(std::format( "Version 00.85 is the oldest supported legacy file format; no conversion " "can be made. It is possible that file '{}' has a corrupted header or an invalid " "file format version number", diff --git a/src/interaction/tasks/convertrecfileversiontask.cpp b/src/interaction/tasks/convertrecfileversiontask.cpp index 1bc49b77b8..930f7a0112 100644 --- a/src/interaction/tasks/convertrecfileversiontask.cpp +++ b/src/interaction/tasks/convertrecfileversiontask.cpp @@ -54,7 +54,7 @@ ConvertRecFileVersionTask::ConvertRecFileVersionTask(const ghoul::Dictionary& di ghoul_assert(std::filesystem::is_regular_file(_inFilePath), "The file must exist"); if (!std::filesystem::is_regular_file(_inFilePath)) { - LERROR(fmt::format("Failed to load session recording file: {}", _inFilePath)); + LERROR(std::format("Failed to load session recording file: {}", _inFilePath)); } else { sessRec = new SessionRecording(false); @@ -66,7 +66,7 @@ ConvertRecFileVersionTask::~ConvertRecFileVersionTask() { } std::string ConvertRecFileVersionTask::description() { - std::string description = fmt::format( + std::string description = std::format( "Convert file format of session recording file '{}' to current version", _inFilePath ); @@ -87,7 +87,7 @@ void ConvertRecFileVersionTask::convert() { SessionRecording::FileExtensionAscii ); if (!hasBinaryFileExtension && !hasAsciiFileExtension) { - LERROR(fmt::format( + LERROR(std::format( "Input filename does not have expected '{}' or '{}' extension", SessionRecording::FileExtensionBinary, SessionRecording::FileExtensionAscii )); diff --git a/src/interaction/tasks/convertrecformattask.cpp b/src/interaction/tasks/convertrecformattask.cpp index 635e13d835..b8010199fb 100644 --- a/src/interaction/tasks/convertrecformattask.cpp +++ b/src/interaction/tasks/convertrecformattask.cpp @@ -65,7 +65,7 @@ ConvertRecFormatTask::ConvertRecFormatTask(const ghoul::Dictionary& dictionary) ghoul_assert(std::filesystem::is_regular_file(_inFilePath), "The file must exist"); if (!std::filesystem::is_regular_file(_inFilePath)) { - LERROR(fmt::format("Failed to load session recording file: {}", _inFilePath)); + LERROR(std::format("Failed to load session recording file: {}", _inFilePath)); } else { _iFile.open(_inFilePath, std::ifstream::in | std::ifstream::binary); @@ -82,7 +82,7 @@ ConvertRecFormatTask::~ConvertRecFormatTask() { std::string ConvertRecFormatTask::description() { std::string description = - fmt::format("Convert session recording file '{}'", _inFilePath); + std::format("Convert session recording file '{}'", _inFilePath); if (_fileFormatType == SessionRecording::DataMode::Ascii) { description += "(ascii format) "; } @@ -92,7 +92,7 @@ std::string ConvertRecFormatTask::description() { else { description += "(UNKNOWN format) "; } - description += fmt::format("conversion to file '{}'", _outFilePath); + description += std::format("conversion to file '{}'", _outFilePath); return description; } @@ -116,13 +116,13 @@ void ConvertRecFormatTask::convert() { } if (_inFilePath.extension() != expectedFileExtension_in) { - LWARNING(fmt::format( + LWARNING(std::format( "Input filename doesn't have expected '{}' format file extension", currentFormat )); } if (_outFilePath.extension() == expectedFileExtension_in) { - LERROR(fmt::format( + LERROR(std::format( "Output filename has '{}' file extension, but is conversion from '{}'", currentFormat, currentFormat )); @@ -172,7 +172,7 @@ void ConvertRecFormatTask::determineFormatType() { if (line.substr(0, SessionRecording::FileHeaderTitle.length()) != SessionRecording::FileHeaderTitle) { - LERROR(fmt::format( + LERROR(std::format( "Session recording file '{}' does not have expected header", _inFilePath )); } @@ -207,7 +207,7 @@ void ConvertRecFormatTask::convertToAscii() { const unsigned char frameType = readFromPlayback(_iFile); // Check if have reached EOF if (!_iFile) { - LINFO(fmt::format( + LINFO(std::format( "Finished converting {} entries from file '{}'", lineNum - 1, _inFilePath )); break; @@ -244,7 +244,7 @@ void ConvertRecFormatTask::convertToAscii() { skf.write(keyframeLine); } else { - LERROR(fmt::format( + LERROR(std::format( "Unknown frame type @ index {} of playback file '{}'", lineNum - 1, _inFilePath )); @@ -275,7 +275,7 @@ void ConvertRecFormatTask::convertToBinary() { std::istringstream iss(lineContents); std::string entryType; if (!(iss >> entryType)) { - LERROR(fmt::format( + LERROR(std::format( "Error reading entry type @ line {} of file '{}'", lineNum, _inFilePath )); break; @@ -300,7 +300,7 @@ void ConvertRecFormatTask::convertToBinary() { continue; } else { - LERROR(fmt::format( + LERROR(std::format( "Unknown frame type {} @ line {} of file '{}'", entryType, lineContents, _inFilePath )); @@ -308,7 +308,7 @@ void ConvertRecFormatTask::convertToBinary() { } } _oFile.close(); - LINFO(fmt::format( + LINFO(std::format( "Finished converting {} entries from file '{}'", lineNum, _inFilePath )); } diff --git a/src/interaction/touchbar.mm b/src/interaction/touchbar.mm index d96f89837f..8cc7149f73 100644 --- a/src/interaction/touchbar.mm +++ b/src/interaction/touchbar.mm @@ -190,7 +190,7 @@ NSArray* focusIdentifiers; NSString* title = [button title]; - std::string str = fmt::format( + std::string str = std::format( "openspace.setPropertyValueSingle('{}', '{}');\ openspace.setPropertyValueSingle('{}', '');\ openspace.setPropertyValueSingle('{}', '');", diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp index 4a04fe6bc2..c22dd8441e 100644 --- a/src/mission/mission.cpp +++ b/src/mission/mission.cpp @@ -123,7 +123,7 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dictionary) { ); if (!overallTimeRange.includes(timeRangeSubPhases)) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "User specified time range must at least include its subphases'", "Mission ({})", _name )); @@ -148,7 +148,7 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dictionary) { ); } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "If there are no subphases specified, the time range has to be specified", "Mission ({})", _name )); diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 1312877b70..0b6f8f589c 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -548,7 +548,7 @@ void NavigationHandler::saveNavigationState(const std::filesystem::path& filepat if (!referenceFrameIdentifier.empty()) { const SceneGraphNode* referenceFrame = sceneGraphNode(referenceFrameIdentifier); if (!referenceFrame) { - LERROR(fmt::format( + LERROR(std::format( "Could not find node '{}' to use as reference frame", referenceFrameIdentifier )); @@ -565,12 +565,12 @@ void NavigationHandler::saveNavigationState(const std::filesystem::path& filepat // Adding the .navstate extension to the filepath if it came without one absolutePath.replace_extension(".navstate"); } - LINFO(fmt::format("Saving camera position: {}", absolutePath)); + LINFO(std::format("Saving camera position: {}", absolutePath)); std::ofstream ofs(absolutePath); if (!ofs.good()) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error saving navigation state to '{}'", filepath )); } @@ -582,7 +582,7 @@ void NavigationHandler::loadNavigationState(const std::string& filepath, bool useTimeStamp) { std::filesystem::path absolutePath = absPath(filepath); - LINFO(fmt::format("Reading camera state from file: {}", absolutePath)); + LINFO(std::format("Reading camera state from file: {}", absolutePath)); if (!absolutePath.has_extension()) { // Adding the .navstate extension to the filepath if it came without one @@ -600,7 +600,7 @@ void NavigationHandler::loadNavigationState(const std::string& filepath, ); if (contents.empty()) { - throw::ghoul::RuntimeError(fmt::format( + throw::ghoul::RuntimeError(std::format( "Failed reading camera state from file: {}. File is empty", absolutePath )); } diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 3e94397f51..7a805751e6 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -60,7 +60,7 @@ namespace { const SceneGraphNode* referenceFrame = sceneGraphNode(*frame); if (!referenceFrame) { throw ghoul::lua::LuaError( - fmt::format("Could not find node '{}' as reference frame", *frame) + std::format("Could not find node '{}' as reference frame", *frame) ); } state = global::navigationHandler->navigationState(*referenceFrame); diff --git a/src/navigation/navigationstate.cpp b/src/navigation/navigationstate.cpp index c80ce7f44a..a8c2d035c2 100644 --- a/src/navigation/navigationstate.cpp +++ b/src/navigation/navigationstate.cpp @@ -174,14 +174,14 @@ CameraPose NavigationState::cameraPose() const { const SceneGraphNode* anchorNode = sceneGraphNode(anchor); if (!anchorNode) { - LERROR(fmt::format( + LERROR(std::format( "Could not find scene graph node '{}' used as anchor", anchor )); return CameraPose(); } if (!referenceFrameNode) { - LERROR(fmt::format( + LERROR(std::format( "Could not find scene graph node '{}' used as reference frame", referenceFrame )); diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 01baef8f30..f9b801b683 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -555,7 +555,7 @@ OrbitalNavigator::OrbitalNavigator() ); } else { - LERROR(fmt::format( + LERROR(std::format( "No scenegraph node with identifier '{}' exists", _anchor.value() )); } @@ -571,7 +571,7 @@ OrbitalNavigator::OrbitalNavigator() setAimNode(node); } else { - LERROR(fmt::format( + LERROR(std::format( "No scenegraph node with identifier '{}' exists", _aim.value() )); } @@ -1934,7 +1934,7 @@ void OrbitalNavigator::triggerIdleBehavior(std::string_view choice) { behavior = IdleBehavior::Behavior::OrbitAroundUp; } else { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "No existing IdleBehavior with identifier '{}'", choice )); } diff --git a/src/navigation/path.cpp b/src/navigation/path.cpp index 1a404cd302..4a89772f36 100644 --- a/src/navigation/path.cpp +++ b/src/navigation/path.cpp @@ -569,7 +569,7 @@ Path createPathFromDictionary(const ghoul::Dictionary& dictionary, const SceneGraphNode* targetNode = sceneGraphNode(navigationState.anchor); if (!targetNode) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find anchor node '{}' in provided navigation state", navigationState.anchor )); @@ -587,7 +587,7 @@ Path createPathFromDictionary(const ghoul::Dictionary& dictionary, const SceneGraphNode* targetNode = sceneGraphNode(nodeIdentifier); if (!targetNode) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find target node '{}'", nodeIdentifier )); } diff --git a/src/navigation/pathcurves/avoidcollisioncurve.cpp b/src/navigation/pathcurves/avoidcollisioncurve.cpp index 82061f8f1e..ebb3286e48 100644 --- a/src/navigation/pathcurves/avoidcollisioncurve.cpp +++ b/src/navigation/pathcurves/avoidcollisioncurve.cpp @@ -192,7 +192,7 @@ void AvoidCollisionCurve::removeCollisions(int step) { const bool isStartInsideNode = isPointInsideSphere(p1, Center, radius); const bool isEndInsideNode = isPointInsideSphere(p2, Center, radius); if (isStartInsideNode || isEndInsideNode) { - LWARNING(fmt::format( + LWARNING(std::format( "Something went wrong! " "At least one point in the path is inside node: {}", node->identifier() diff --git a/src/navigation/pathnavigator.cpp b/src/navigation/pathnavigator.cpp index b5410c03fa..c623b79946 100644 --- a/src/navigation/pathnavigator.cpp +++ b/src/navigation/pathnavigator.cpp @@ -313,7 +313,7 @@ void PathNavigator::createPath(const ghoul::Dictionary& dictionary) { // Do nothing } catch (const ghoul::RuntimeError& e) { - LERROR(fmt::format("Could not create path. Reason: {}", e.message)); + LERROR(std::format("Could not create path. Reason: {}", e.message)); return; } @@ -436,7 +436,7 @@ double PathNavigator::findValidBoundingSphere(const SceneGraphNode* node) const double result = sphere(node); if (result < _minValidBoundingSphere) { - LDEBUG(fmt::format( + LDEBUG(std::format( "The scene graph node '{}' has no, or a very small, bounding sphere. Using " "minimal value of {}. This might lead to unexpected results", node->identifier(), _minValidBoundingSphere.value() diff --git a/src/navigation/pathnavigator_lua.inl b/src/navigation/pathnavigator_lua.inl index 97d8999681..060fe7f0d5 100644 --- a/src/navigation/pathnavigator_lua.inl +++ b/src/navigation/pathnavigator_lua.inl @@ -173,7 +173,7 @@ namespace { } catch (const documentation::SpecificationError& e) { logError(e, "flyToNavigationState"); - throw ghoul::lua::LuaError(fmt::format("Unable to create a path: {}", e.what())); + throw ghoul::lua::LuaError(std::format("Unable to create a path: {}", e.what())); } ghoul::Dictionary instruction; diff --git a/src/navigation/waypoint.cpp b/src/navigation/waypoint.cpp index 7fad87329c..bb8be8f1c5 100644 --- a/src/navigation/waypoint.cpp +++ b/src/navigation/waypoint.cpp @@ -50,7 +50,7 @@ Waypoint::Waypoint(const glm::dvec3& pos, const glm::dquat& rot, std::string ref const SceneGraphNode* node = sceneGraphNode(_nodeIdentifier); if (!node) { - LERROR(fmt::format("Could not find node '{}'", _nodeIdentifier)); + LERROR(std::format("Could not find node '{}'", _nodeIdentifier)); return; } @@ -62,7 +62,7 @@ Waypoint::Waypoint(const NavigationState& ns) { const SceneGraphNode* anchorNode = sceneGraphNode(ns.anchor); if (!anchorNode) { - LERROR(fmt::format("Could not find node '{}' to target", ns.anchor)); + LERROR(std::format("Could not find node '{}' to target", ns.anchor)); return; } @@ -71,7 +71,7 @@ Waypoint::Waypoint(const NavigationState& ns) { if (!ns.aim.empty()) { const SceneGraphNode* aimNode = sceneGraphNode(ns.aim); if (!aimNode) { - LERROR(fmt::format("Could not find node '{}' to use as aim", ns.aim)); + LERROR(std::format("Could not find node '{}' to use as aim", ns.aim)); return; } _aimNodeIdentifier = ns.aim; @@ -177,7 +177,7 @@ Waypoint computeWaypointFromNodeInfo(const NodeCameraStateSpec& spec, { const SceneGraphNode* targetNode = sceneGraphNode(spec.identifier); if (!targetNode) { - LERROR(fmt::format("Could not find target node '{}'", spec.identifier)); + LERROR(std::format("Could not find target node '{}'", spec.identifier)); return Waypoint(); } diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 5b09e9ceea..4c51f97286 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -168,7 +168,7 @@ ParallelConnection::Message ParallelConnection::receiveMessage() { offset += sizeof(uint8_t); if (protocolVersionIn != ProtocolVersion) { - LERROR(fmt::format( + LERROR(std::format( "Protocol versions do not match. Remote version: {}, Local version: {}", protocolVersionIn, ProtocolVersion diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index c3296a4ccd..53d7b99f80 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -401,7 +401,7 @@ void ParallelPeer::dataMessageReceived(const std::vector& message) { break; } default: - LERROR(fmt::format( + LERROR(std::format( "Unidentified message with identifier '{}' received in parallel " "connection", type diff --git a/src/properties/optionproperty.cpp b/src/properties/optionproperty.cpp index d1b28ffac3..98b1be9a3c 100644 --- a/src/properties/optionproperty.cpp +++ b/src/properties/optionproperty.cpp @@ -63,7 +63,7 @@ void OptionProperty::addOption(int value, std::string desc) { for (const Option& o : _options) { if (o.value == option.value) { - LWARNING(fmt::format( + LWARNING(std::format( "The value of option {{ {} -> {} }} was already registered when trying " "to add option {{ {} -> {} }}", o.value, o.description, option.value, option.description @@ -108,7 +108,7 @@ void OptionProperty::setValue(int value) { } // Otherwise, log an error - LERROR(fmt::format("Could not find an option for value '{}'", value)); + LERROR(std::format("Could not find an option for value '{}'", value)); } bool OptionProperty::hasOption() const { @@ -162,7 +162,7 @@ std::string OptionProperty::generateAdditionalJsonDescription() const { const std::string dSan = escapedJson(d); result += '{'; - result += fmt::format(R"("{}": "{}")", vSan, dSan); + result += std::format(R"("{}": "{}")", vSan, dSan); result += '}'; if (i != _options.size() - 1) { diff --git a/src/properties/property.cpp b/src/properties/property.cpp index 206511bd49..ef54ba8367 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -82,7 +82,7 @@ std::string Property::fullyQualifiedIdentifier() const { while (currentOwner) { const std::string& ownerId = currentOwner->identifier(); if (!ownerId.empty()) { - identifier = fmt::format("{}.{}", ownerId, identifier); + identifier = std::format("{}.{}", ownerId, identifier); } currentOwner = currentOwner->owner(); } @@ -275,7 +275,7 @@ std::string Property::generateJsonDescription() const { const std::string metaData = generateMetaDataJsonDescription(); const std::string description = generateAdditionalJsonDescription(); - return fmt::format( + return std::format( R"({{"{}":"{}","{}":"{}","{}":"{}","{}":{},"{}":{}}})", TypeKey, cName, IdentifierKey, identifierSan, NameKey, gNameSan, MetaDataKey, metaData, AdditionalDataKey, description @@ -318,7 +318,7 @@ std::string Property::generateMetaDataJsonDescription() const { ); } - std::string result = fmt::format( + std::string result = std::format( R"({{"{}":"{}","{}":"{}","{}":{},"{}":{},"{}":{}}})", MetaDataKeyGroup, sanitizedGroupId, MetaDataKeyVisibility, vis, diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index cfb7332b25..db9c3b2910 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -213,7 +213,7 @@ void PropertyOwner::addProperty(Property* prop) { // If we found the property identifier, we need to bail out if (it != _properties.end() && (*it)->identifier() == prop->identifier()) { - LERROR(fmt::format( + LERROR(std::format( "Property identifier '{}' already present in PropertyOwner '{}'", prop->identifier(), identifier() @@ -224,7 +224,7 @@ void PropertyOwner::addProperty(Property* prop) { // Otherwise we still have to look if there is a PropertyOwner with the same name const bool hasOwner = hasPropertySubOwner(prop->identifier()); if (hasOwner) { - LERROR(fmt::format( + LERROR(std::format( "Property identifier '{}' already names a registered PropertyOwner", prop->identifier() )); @@ -259,7 +259,7 @@ void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner* ow // If we found the propertyowner's name, we need to bail out if (it != _subOwners.end() && (*it)->identifier() == owner->identifier()) { - LERROR(fmt::format( + LERROR(std::format( "PropertyOwner '{}' already present in PropertyOwner '{}'", owner->identifier(), identifier() @@ -270,7 +270,7 @@ void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner* ow // We still need to check if the PropertyOwners name is used in a Property const bool hasProp = hasProperty(owner->identifier()); if (hasProp) { - LERROR(fmt::format( + LERROR(std::format( "PropertyOwner '{}'s name already names a Property", owner->identifier() )); return; @@ -302,7 +302,7 @@ void PropertyOwner::removeProperty(Property* prop) { _properties.erase(it); } else { - LERROR(fmt::format( + LERROR(std::format( "Property with identifier '{}' not found for removal", prop->identifier() )); } @@ -329,7 +329,7 @@ void PropertyOwner::removePropertySubOwner(openspace::properties::PropertyOwner* _subOwners.erase(it); } else { - LERROR(fmt::format( + LERROR(std::format( "PropertyOwner with name '{}' not found for removal", owner->identifier() )); } diff --git a/src/properties/selectionproperty.cpp b/src/properties/selectionproperty.cpp index 8830ca4c83..c652b05c85 100644 --- a/src/properties/selectionproperty.cpp +++ b/src/properties/selectionproperty.cpp @@ -92,7 +92,7 @@ void SelectionProperty::setOptions(const std::vector& keys) { _options.push_back(key); } else { - LWARNING(fmt::format("Ignoring duplicated key '{}'", key)); + LWARNING(std::format("Ignoring duplicated key '{}'", key)); } } _options.shrink_to_fit(); @@ -109,7 +109,7 @@ void SelectionProperty::setOptions(const std::vector& keys) { void SelectionProperty::addOption(const std::string& key) { if (hasOption(key)) { - LWARNING(fmt::format("Cannot add option. Key '{}' already exists", key)); + LWARNING(std::format("Cannot add option. Key '{}' already exists", key)); return; } @@ -153,7 +153,7 @@ bool SelectionProperty::removeInvalidKeys(std::set& keys) const { auto it = keys.begin(); while (it != keys.end()) { if (!hasOption(*it)) { - LWARNING(fmt::format( + LWARNING(std::format( "Key '{}' is not a valid option and is removed from selection", *it )); it = keys.erase(it); @@ -168,7 +168,7 @@ bool SelectionProperty::removeInvalidKeys(std::set& keys) const { std::string SelectionProperty::generateAdditionalJsonDescription() const { const nlohmann::json optionsJson(_options); - std::string result = fmt::format( + std::string result = std::format( R"({{ "{}": {} }})", OptionsKey, optionsJson.dump() ); return result; diff --git a/src/rendering/colormappingcomponent.cpp b/src/rendering/colormappingcomponent.cpp index a6dd578abe..6070f3c4af 100644 --- a/src/rendering/colormappingcomponent.cpp +++ b/src/rendering/colormappingcomponent.cpp @@ -242,7 +242,7 @@ ColorMappingComponent::ColorMappingComponent() colorMapFile.onChange([this]() { const bool fileExists = std::filesystem::exists(colorMapFile.value()); if (!fileExists) { - LERROR(fmt::format("Could not find cmap file: {}", colorMapFile.value())); + LERROR(std::format("Could not find cmap file: {}", colorMapFile.value())); } _colorMapFileIsDirty = true; }); @@ -478,7 +478,7 @@ void ColorMappingComponent::initializeParameterData(const dataloader::Dataset& d } if (!found) { - LWARNING(fmt::format( + LWARNING(std::format( "Dataset does not contain specified parameter '{}'", o )); } @@ -491,7 +491,7 @@ void ColorMappingComponent::initializeParameterData(const dataloader::Dataset& d if (_providedParameter.has_value()) { if (indexOfProvidedOption == -1) { - LERROR(fmt::format( + LERROR(std::format( "Error when reading Parameter. Could not find provided parameter '{}' in " "list of parameter options", *_providedParameter )); diff --git a/src/rendering/dashboard_lua.inl b/src/rendering/dashboard_lua.inl index 0cc98277cb..a7533b834a 100644 --- a/src/rendering/dashboard_lua.inl +++ b/src/rendering/dashboard_lua.inl @@ -33,7 +33,7 @@ namespace { ); } catch (const ghoul::RuntimeError& e) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Error adding dashboard item: {}", e.what() )); } diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 209d308ebc..d63722b271 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -970,7 +970,7 @@ void FramebufferRenderer::updateRaycastData() { try { _exitPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( - fmt::format("Volume {} exit", data.id), + std::format("Volume {} exit", data.id), absPath(vsPath), absPath(ExitFragmentShaderPath), dict @@ -983,7 +983,7 @@ void FramebufferRenderer::updateRaycastData() { ghoul::Dictionary outsideDict = dict; outsideDict.setValue("getEntryPath", std::string(GetEntryOutsidePath)); _raycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( - fmt::format("Volume {} raycast", data.id), + std::format("Volume {} raycast", data.id), absPath(vsPath), absPath(RaycastFragmentShaderPath), outsideDict @@ -996,7 +996,7 @@ void FramebufferRenderer::updateRaycastData() { ghoul::Dictionary insideDict = dict; insideDict.setValue("getEntryPath", std::string(GetEntryInsidePath)); _insideRaycastPrograms[raycaster] = ghoul::opengl::ProgramObject::Build( - fmt::format("Volume {} inside raycast", data.id), + std::format("Volume {} inside raycast", data.id), absPath("${SHADERS}/framebuffer/resolveframebuffer.vert"), absPath(RaycastFragmentShaderPath), insideDict @@ -1037,7 +1037,7 @@ void FramebufferRenderer::updateDeferredcastData() { try { _deferredcastPrograms[caster] = ghoul::opengl::ProgramObject::Build( - fmt::format("Deferred {} raycast", data.id), + std::format("Deferred {} raycast", data.id), vsPath, fsPath, dict diff --git a/src/rendering/labelscomponent.cpp b/src/rendering/labelscomponent.cpp index 7d05765eee..4d5e47643f 100644 --- a/src/rendering/labelscomponent.cpp +++ b/src/rendering/labelscomponent.cpp @@ -258,7 +258,7 @@ void LabelsComponent::initialize() { } void LabelsComponent::loadLabels() { - LINFO(fmt::format("Loading label file '{}'", _labelFile)); + LINFO(std::format("Loading label file '{}'", _labelFile)); if (_createdFromDataset) { // The labelset should already have been loaded diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 9f92771c01..7a23ccd012 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -508,7 +508,7 @@ void LoadingScreen::render() { int p = static_cast(std::round(info.progress * 100)); if (isTotalSizeKnown) { if (info.totalSize < 1024 * 1024) { // 1MB - text = fmt::format( + text = std::format( "{} ({}%)\n{}/{} {}", text, p, info.currentSize, info.totalSize, "bytes" ); @@ -517,7 +517,7 @@ void LoadingScreen::render() { float curr = info.currentSize / (1024.f * 1024.f); float total = info.totalSize / (1024.f * 1024.f); - text = fmt::format( + text = std::format( "{} ({}%)\n{:.3f}/{:.3f} {}", text, p, curr, total, "MB" ); @@ -526,11 +526,11 @@ void LoadingScreen::render() { else { // We don't know the total size but we have started downloading data if (info.currentSize < 1024 * 1024) { - text = fmt::format("{}\n{} {}", text, info.currentSize, "bytes"); + text = std::format("{}\n{} {}", text, info.currentSize, "bytes"); } else { float curr = info.currentSize / (1024.f * 1024.f); - text = fmt::format("{}\n{:.3f} {}", text, curr, "MB"); + text = std::format("{}\n{:.3f} {}", text, curr, "MB"); } } } @@ -631,7 +631,7 @@ void LoadingScreen::renderLogMessages() const { } size_t row = 0; for (auto& [level, amount] : numberOfErrorsPerLevel) { - const std::string text = fmt::format("{}: {}", ghoul::to_string(level), amount); + const std::string text = std::format("{}: {}", ghoul::to_string(level), amount); const glm::vec2 bbox = _logFont->boundingBox(text); renderer.render( *_logFont, diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index 5794169419..fd1ea36d20 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -201,7 +201,7 @@ void LuaConsole::initialize() { if (version != CurrentVersion) { LWARNINGC( "LuaConsole", - fmt::format("Outdated console history version: {}", version) + std::format("Outdated console history version: {}", version) ); } else { diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 4a68fa2fba..4f21e42357 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -500,7 +500,7 @@ void RenderEngine::initialize() { OPENSPACE_VERSION_PATCH }; if (current < latest) { - _versionString += fmt::format( + _versionString += std::format( " [Available: {}.{}.{}]", latest.major, latest.minor, latest.patch ); } @@ -733,7 +733,7 @@ void RenderEngine::render(const glm::mat4& sceneMatrix, const glm::mat4& viewMat std::string dt = std::to_string(global::windowDelegate->deltaTime()); std::string avgDt = std::to_string(global::windowDelegate->averageDeltaTime()); - const std::string res = fmt::format( + const std::string res = std::format( "Frame: {} {}\nSwap group frame: {}\nDt: {}\nAvg Dt: {}", fn, fr, sgFn, dt, avgDt ); @@ -887,7 +887,7 @@ void RenderEngine::renderShutdownInformation(float timer, float fullTime) { constexpr std::string_view FirstLine = "Shutdown in: {:.2f}s/{:.2f}s"; const glm::vec2 size1 = _fontShutdown->boundingBox( - fmt::format(FirstLine, timer, fullTime) + std::format(FirstLine, timer, fullTime) ); glm::vec2 penPosition = glm::vec2( @@ -898,7 +898,7 @@ void RenderEngine::renderShutdownInformation(float timer, float fullTime) { RenderFont( *_fontShutdown, penPosition, - fmt::format(FirstLine, timer, fullTime), + std::format(FirstLine, timer, fullTime), ghoul::fontrendering::CrDirection::Down ); // Important: Length of this string is the same as the first line to make them align @@ -1104,7 +1104,7 @@ void RenderEngine::addScreenSpaceRenderable(std::unique_ptrend()) { - LERROR(fmt::format( + LERROR(std::format( "Cannot add scene space renderable. Identifier '{}' already exists", identifier )); @@ -1366,7 +1366,7 @@ void RenderEngine::renderScreenLog() { std::array buf; { std::fill(buf.begin(), buf.end(), char(0)); - char* end = fmt::format_to( + char* end = std::format_to( buf.data(), "{:<15} {}{}", it.timeString, @@ -1391,7 +1391,7 @@ void RenderEngine::renderScreenLog() { const std::string_view lvl = ghoul::to_string(it.level); std::fill(buf.begin(), buf.end(), char(0)); - char* end = fmt::format_to(buf.data(), "({})", lvl); + char* end = std::format_to(buf.data(), "({})", lvl); RenderFont( *_fontLog, glm::vec2( diff --git a/src/rendering/texturecomponent.cpp b/src/rendering/texturecomponent.cpp index 4a7ed293ab..dcda824d91 100644 --- a/src/rendering/texturecomponent.cpp +++ b/src/rendering/texturecomponent.cpp @@ -99,7 +99,7 @@ void TextureComponent::loadFromFile(const std::filesystem::path& path) { ); if (texture) { - LDEBUG(fmt::format("Loaded texture from '{}'", absolutePath)); + LDEBUG(std::format("Loaded texture from '{}'", absolutePath)); _texture = std::move(texture); _textureFile = std::make_unique(absolutePath); diff --git a/src/scene/asset.cpp b/src/scene/asset.cpp index 08fe0884ec..309ce7de86 100644 --- a/src/scene/asset.cpp +++ b/src/scene/asset.cpp @@ -279,10 +279,10 @@ void Asset::initialize() { return; } if (!isSynchronized()) { - LERROR(fmt::format("Cannot initialize unsynchronized asset '{}'", _assetPath)); + LERROR(std::format("Cannot initialize unsynchronized asset '{}'", _assetPath)); return; } - LDEBUG(fmt::format("Initializing asset '{}'", _assetPath)); + LDEBUG(std::format("Initializing asset '{}'", _assetPath)); // 1. Initialize requirements for (Asset* child : _requiredAssets) { @@ -294,14 +294,14 @@ void Asset::initialize() { _manager.callOnInitialize(this); } catch (const documentation::SpecificationError& e) { - LERROR(fmt::format("Failed to initialize asset '{}'", path())); + LERROR(std::format("Failed to initialize asset '{}'", path())); documentation::logError(e); setState(State::InitializationFailed); return; } catch (const ghoul::RuntimeError& e) { - LERROR(fmt::format("Failed to initialize asset '{}'", path())); - LERROR(fmt::format("{}: {}", e.component, e.message)); + LERROR(std::format("Failed to initialize asset '{}'", path())); + LERROR(std::format("{}: {}", e.component, e.message)); setState(State::InitializationFailed); return; } @@ -314,7 +314,7 @@ void Asset::deinitialize() { if (!isInitialized()) { return; } - LDEBUG(fmt::format("Deinitializing asset '{}'", _assetPath)); + LDEBUG(std::format("Deinitializing asset '{}'", _assetPath)); // Perform inverse actions as in initialize, in reverse order (3 - 1) @@ -326,8 +326,8 @@ void Asset::deinitialize() { _manager.callOnDeinitialize(this); } catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format("Failed to deinitialize asset '{}'", _assetPath)); - LERROR(fmt::format("{}: {}", e.component, e.message)); + LERROR(std::format("Failed to deinitialize asset '{}'", _assetPath)); + LERROR(std::format("{}: {}", e.component, e.message)); return; } diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 694c682f5e..7a9dc5e14f 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -106,21 +106,6 @@ namespace { #include "assetmanager_codegen.cpp" } // namespace -namespace fmt { - template - struct formatter> :fmt::formatter { - - template - auto format(const std::optional& opt, FormatContext& ctx) { - if (opt) { - fmt::formatter::format(*opt, ctx); - return ctx.out(); - } - return fmt::format_to(ctx.out(), ""); - } - }; -} // namespace fmt - namespace openspace { AssetManager::AssetManager(ghoul::lua::LuaState* state, @@ -238,7 +223,7 @@ void AssetManager::update() { [&path](const std::unique_ptr& a) { return a->path() == path; } ); if (it == _assets.cend()) { - LWARNING(fmt::format("Tried to remove unknown asset '{}'. Skipping", asset)); + LWARNING(std::format("Tried to remove unknown asset '{}'. Skipping", asset)); continue; } @@ -288,7 +273,7 @@ void AssetManager::update() { it = _unfinishedSynchronizations.erase(it); } else if (si->synchronization->isRejected()) { - LERROR(fmt::format( + LERROR(std::format( "Failed to synchronize resource '{}'", si->synchronization->name() )); for (Asset* a : si->assets) { @@ -362,7 +347,7 @@ bool AssetManager::loadAsset(Asset* asset, Asset* parent) { }; if (!std::filesystem::is_regular_file(asset->path())) { - LERROR(fmt::format( + LERROR(std::format( "Could not load asset '{}': File does not exist", asset->path()) ); return false; @@ -372,7 +357,7 @@ bool AssetManager::loadAsset(Asset* asset, Asset* parent) { ghoul::lua::runScriptFile(*_luaState, asset->path()); } catch (const ghoul::lua::LuaRuntimeException& e) { - LERROR(fmt::format("Could not load asset '{}': {}", asset->path(), e.message)); + LERROR(std::format("Could not load asset '{}': {}", asset->path(), e.message)); return false; } catch (const ghoul::RuntimeError& e) { @@ -658,7 +643,7 @@ void AssetManager::setUpAssetLuaTable(Asset* asset) { if (!dependency) { return ghoul::lua::luaError( L, - fmt::format("Asset '{}' not found", assetName) + std::format("Asset '{}' not found", assetName) ); } // this = parent ; child = dependency @@ -892,7 +877,7 @@ Asset* AssetManager::retrieveAsset(const std::filesystem::path& path, if (a->firstParent()) { // The first request came from another asset, so we can mention it in the // error message - LWARNING(fmt::format( + LWARNING(std::format( "Loading asset {0} from {1} with enable state {3} different from " "initial loading from {2} with state {4}. Only {4} will have an " "effect", @@ -919,7 +904,7 @@ Asset* AssetManager::retrieveAsset(const std::filesystem::path& path, } if (!std::filesystem::is_regular_file(path)) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Could not find asset file '{}' requested by '{}'", path, retriever )); @@ -943,7 +928,7 @@ void AssetManager::callOnInitialize(Asset* asset) const { for (const int init : it->second) { lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, init); if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "When initializing '{}': {}", asset->path(), ghoul::lua::value(*_luaState, -1) @@ -966,7 +951,7 @@ void AssetManager::callOnDeinitialize(Asset* asset) const { for (const int deinit : it->second) { lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, deinit); if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "When deinitializing '{}': {}", asset->path(), ghoul::lua::value(*_luaState, -1) diff --git a/src/scene/profile.cpp b/src/scene/profile.cpp index 6f06d27024..571a232506 100644 --- a/src/scene/profile.cpp +++ b/src/scene/profile.cpp @@ -78,7 +78,7 @@ namespace { if (!isOptional) { throw Profile::ParsingError( Profile::ParsingError::Severity::Error, - fmt::format("'{}.{}' field is missing", keyPrefix, key) + std::format("'{}.{}' field is missing", keyPrefix, key) ); } } @@ -98,7 +98,7 @@ namespace { throw Profile::ParsingError( Profile::ParsingError::Severity::Error, - fmt::format("'{}.{}' must be {}", keyPrefix, key, type) + std::format("'{}.{}' must be {}", keyPrefix, key, type) ); } } @@ -111,7 +111,7 @@ namespace { if (allowedKeys.find(key) == allowedKeys.end()) { LINFOC( "Profile", - fmt::format("Key '{}' not supported in '{}'", key, prefix) + std::format("Key '{}' not supported in '{}'", key, prefix) ); } } @@ -577,7 +577,7 @@ void convertVersion10to11(nlohmann::json& profile) { profile.at("keybindings").get>(); for (size_t i = 0; i < kbs.size(); i++) { version10::Keybinding& kb = kbs[i]; - const std::string identifier = fmt::format("profile.keybind.{}", i); + const std::string identifier = std::format("profile.keybind.{}", i); Profile::Action action; action.identifier = identifier; @@ -749,7 +749,7 @@ Profile::Profile(const std::filesystem::path& path) { inFile.open(path, std::ifstream::in); } catch (const std::ifstream::failure& e) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Exception opening profile file for read '{}': {}", path, e.what() )); } diff --git a/src/scene/profile_lua.inl b/src/scene/profile_lua.inl index 358fa66750..9fd8f3de0f 100644 --- a/src/scene/profile_lua.inl +++ b/src/scene/profile_lua.inl @@ -43,7 +43,7 @@ namespace { std::tm* utcTime = std::gmtime(&t); ghoul_assert(utcTime, "Conversion to UTC failed"); - std::string time = fmt::format( + std::string time = std::format( "{:04d}-{:02d}-{:02d}T{:02d}_{:02d}_{:02d}", utcTime->tm_year + 1900, utcTime->tm_mon + 1, @@ -54,24 +54,24 @@ namespace { ); std::filesystem::path path = global::configuration->profile; path.replace_extension(); - std::string newFile = fmt::format("{}_{}", path.string(), time); - std::string sourcePath = fmt::format( + std::string newFile = std::format("{}_{}", path.string(), time); + std::string sourcePath = std::format( "{}/{}.profile", absPath("${USER_PROFILES}").string(), global::configuration->profile ); - std::string destPath = fmt::format( + std::string destPath = std::format( "{}/{}.profile", absPath("${PROFILES}").string(), global::configuration->profile ); if (!std::filesystem::is_regular_file(sourcePath)) { - sourcePath = fmt::format( + sourcePath = std::format( "{}/{}.profile", absPath("${USER_PROFILES}").string(), global::configuration->profile ); } LINFOC( "Profile", - fmt::format("Saving a copy of the old profile as '{}'", newFile) + std::format("Saving a copy of the old profile as '{}'", newFile) ); std::filesystem::copy(sourcePath, destPath); saveFilePath = global::configuration->profile; @@ -98,7 +98,7 @@ namespace { ); } - std::string absFilename = fmt::format( + std::string absFilename = std::format( "{}/{}.profile", absPath("${PROFILES}").string(), *saveFilePath ); if (!std::filesystem::is_regular_file(absFilename)) { @@ -107,7 +107,7 @@ namespace { if (std::filesystem::is_regular_file(absFilename) && !overwrite) { throw ghoul::lua::LuaError( - fmt::format( + std::format( "Unable to save profile '{}'. File of same name already exists", absFilename ) @@ -121,7 +121,7 @@ namespace { } catch (const std::ofstream::failure& e) { throw ghoul::lua::LuaError( - fmt::format( + std::format( "Exception opening profile file for write '{}': {}", absFilename, e.what() ) ); @@ -132,7 +132,7 @@ namespace { } catch (const std::ofstream::failure& e) { throw ghoul::lua::LuaError( - fmt::format("Data write error to file '{}': {}", absFilename, e.what()) + std::format("Data write error to file '{}': {}", absFilename, e.what()) ); } } diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 05ea76406f..9d5da1b66d 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -128,7 +128,7 @@ Scene::~Scene() { continue; } - LWARNING(fmt::format( + LWARNING(std::format( "SceneGraphNode '{}' was not removed before shutdown", node->identifier() )); @@ -157,7 +157,7 @@ Camera* Scene::camera() const { void Scene::registerNode(SceneGraphNode* node) { if (_nodesByIdentifier.contains(node->identifier())) { - throw Scene::InvalidSceneError(fmt::format( + throw Scene::InvalidSceneError(std::format( "Node with identifier '{}' already exists", node->identifier() )); } @@ -260,7 +260,7 @@ void Scene::sortTopologically() { } } if (!inDegrees.empty()) { - LERROR(fmt::format( + LERROR(std::format( "The scene contains circular dependencies. {} nodes will be disabled", inDegrees.size() )); @@ -374,7 +374,7 @@ SceneGraphNode* Scene::loadNode(const ghoul::Dictionary& nodeDictionary) { const bool hasParent = nodeDictionary.hasKey(KeyParent); if (_nodesByIdentifier.find(nodeIdentifier) != _nodesByIdentifier.end()) { - LERROR(fmt::format( + LERROR(std::format( "Cannot add scene graph node '{}'. A node with that name already exists", nodeIdentifier )); @@ -387,7 +387,7 @@ SceneGraphNode* Scene::loadNode(const ghoul::Dictionary& nodeDictionary) { parent = sceneGraphNode(parentIdentifier); if (!parent) { // TODO: Throw exception - LERROR(fmt::format( + LERROR(std::format( "Could not find parent '{}' for '{}'", parentIdentifier, nodeIdentifier )); return nullptr; @@ -420,7 +420,7 @@ SceneGraphNode* Scene::loadNode(const ghoul::Dictionary& nodeDictionary) { SceneGraphNode* dep = sceneGraphNode(depName); if (!dep) { // TODO: Throw exception - LERROR(fmt::format( + LERROR(std::format( "Could not find dependency '{}' for '{}'", depName, nodeIdentifier )); foundAllDeps = false; @@ -683,7 +683,7 @@ void Scene::handlePropertyLuaTableEntry(ghoul::lua::LuaState& L, const std::stri switch (enclosedType) { case PropertyValueType::Boolean: - LERROR(fmt::format( + LERROR(std::format( "A Lua table of bool values is not supported. (processing property '{}')", _profilePropertyName )); @@ -704,7 +704,7 @@ void Scene::handlePropertyLuaTableEntry(ghoul::lua::LuaState& L, const std::stri break; case PropertyValueType::Table: default: - LERROR(fmt::format( + LERROR(std::format( "Table-within-a-table values are not supported for profile a " "property (processing property '{}')", _profilePropertyName )); @@ -734,7 +734,7 @@ void Scene::processPropertyValueTableEntries(ghoul::lua::LuaState& L, table.push_back(std::get(tableElement)); } catch (std::bad_variant_access&) { - LERROR(fmt::format( + LERROR(std::format( "Error attempting to parse profile property setting for '{}' using " "value = {}", _profilePropertyName, value )); diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index df30467c15..765193ab7c 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -109,7 +109,7 @@ std::vector findMatchesInAllProperties( if (propertyName.empty() && nodeName.empty()) { LERRORC( "findMatchesInAllProperties", - fmt::format( + std::format( "Malformed regular expression: '{}': Empty both before and after '*'", regex ) @@ -121,7 +121,7 @@ std::vector findMatchesInAllProperties( if (regex.find_first_of("*", wildPos + 1) != std::string::npos) { LERRORC( "findMatchesInAllProperties", - fmt::format( + std::format( "Malformed regular expression: '{}': Currently only one '*' is " "supported", regex ) @@ -224,7 +224,7 @@ void applyRegularExpression(lua_State* L, const std::string& regex, if (type != prop->typeLua()) { LERRORC( "property_setValue", - fmt::format( + std::format( "{}: Property '{}' does not accept input of type '{}'. Requested " "type: {}", errorLocation(L), prop->fullyQualifiedIdentifier(), @@ -263,7 +263,7 @@ void applyRegularExpression(lua_State* L, const std::string& regex, if (!foundMatching) { LERRORC( "property_setValue", - fmt::format( + std::format( "{}: No property matched the requested URI '{}'", errorLocation(L), regex ) ); @@ -303,7 +303,7 @@ int setPropertyCallSingle(properties::Property& prop, const std::string& uri, if (type != prop.typeLua()) { LERRORC( "property_setValue", - fmt::format( + std::format( "{}: Property '{}' does not accept input of type '{}'. " "Requested type: {}", errorLocation(L), uri, luaTypeToString(type), @@ -363,7 +363,7 @@ int propertySetValue(lua_State* L) { ghoul::lua::value(L, 3, ghoul::lua::PopValue::No); } else { - std::string msg = fmt::format( + std::string msg = std::format( "Unexpected type '{}' in argument 3", ghoul::lua::luaTypeToString(lua_type(L, 3)) ); @@ -376,7 +376,7 @@ int propertySetValue(lua_State* L) { ghoul::lua::value(L, 4, ghoul::lua::PopValue::No); } else { - std::string msg = fmt::format( + std::string msg = std::format( "Unexpected type '{}' in argument 4", ghoul::lua::luaTypeToString(lua_type(L, 4)) ); @@ -389,7 +389,7 @@ int propertySetValue(lua_State* L) { ghoul::lua::value(L, 5, ghoul::lua::PopValue::No); } else { - std::string msg = fmt::format( + std::string msg = std::format( "Unexpected type '{}' in argument 5", ghoul::lua::luaTypeToString(lua_type(L, 5)) ); @@ -402,7 +402,7 @@ int propertySetValue(lua_State* L) { if (!correctName) { LWARNINGC( "propertySetValue", - fmt::format("'{}' is not a valid easing method", easingMethodName) + std::format("'{}' is not a valid easing method", easingMethodName) ); } else { @@ -415,7 +415,7 @@ int propertySetValue(lua_State* L) { if (!prop) { LERRORC( "property_setValue", - fmt::format( + std::format( "{}: Property with URI '{}' was not found", ghoul::lua::errorLocation(L), uriOrRegex ) @@ -459,7 +459,7 @@ int propertyGetValue(lua_State* L) { if (!prop) { LERRORC( "propertyGetValue", - fmt::format( + std::format( "{}: Property with URI '{}' was not found", ghoul::lua::errorLocation(L), uri ) @@ -517,7 +517,7 @@ namespace { // If none then malformed regular expression if (propertyName.empty() && nodeName.empty()) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Malformed regular expression: '{}': Empty both before and after '*'", regex )); @@ -525,7 +525,7 @@ namespace { // Currently do not support several wildcards if (regex.find_first_of("*", wildPos + 1) != std::string::npos) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Malformed regular expression: '{}': Currently only one '*' is supported", regex )); @@ -637,12 +637,12 @@ namespace { logError(e, cat); throw ghoul::lua::LuaError( - fmt::format("Error loading scene graph node: {}", e.what()) + std::format("Error loading scene graph node: {}", e.what()) ); } catch (const ghoul::RuntimeError& e) { throw ghoul::lua::LuaError( - fmt::format("Error loading scene graph node: {}", e.what()) + std::format("Error loading scene graph node: {}", e.what()) ); } } @@ -676,7 +676,7 @@ namespace { SceneGraphNode* foundNode = sceneGraphNode(identifier); if (!foundNode) { throw ghoul::lua::LuaError( - fmt::format("Did not find a match for identifier: {}", identifier) + std::format("Did not find a match for identifier: {}", identifier) ); } @@ -738,7 +738,7 @@ namespace { // If none then malformed regular expression if (propertyName.empty() && nodeName.empty()) { throw ghoul::lua::LuaError( - fmt::format( + std::format( "Malformed regular expression: '{}': Empty both before and after '*'", name ) @@ -748,7 +748,7 @@ namespace { // Currently do not support several wildcards if (name.find_first_of("*", wildPos + 1) != std::string::npos) { throw ghoul::lua::LuaError( - fmt::format( + std::format( "Malformed regular expression: '{}': " "Currently only one '*' is supported", name @@ -812,7 +812,7 @@ namespace { if (!foundMatch) { throw ghoul::lua::LuaError( - fmt::format("Did not find a match for identifier: {}", name) + std::format("Did not find a match for identifier: {}", name) ); } @@ -931,7 +931,7 @@ namespace { SceneGraphNode* node = sceneGraphNode(identifier); if (!node) { throw ghoul::lua::LuaError( - fmt::format("Did not find a match for identifier: {} ", identifier) + std::format("Did not find a match for identifier: {} ", identifier) ); } @@ -948,7 +948,7 @@ namespace { SceneGraphNode* node = sceneGraphNode(identifier); if (!node) { throw ghoul::lua::LuaError( - fmt::format("Did not find a match for identifier: {} ", identifier) + std::format("Did not find a match for identifier: {} ", identifier) ); } @@ -964,13 +964,13 @@ namespace { using namespace openspace; SceneGraphNode* node = sceneGraphNode(identifier); if (!node) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Did not find a match for identifier: {}", identifier )); } SceneGraphNode* newParentNode = sceneGraphNode(newParent); if (!newParentNode) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Did not find a match for new parent identifier: {}", newParent )); } @@ -987,7 +987,7 @@ namespace { using namespace openspace; SceneGraphNode* node = sceneGraphNode(identifier); if (!node) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Did not find a match for identifier: {}", identifier )); } @@ -1004,7 +1004,7 @@ namespace { using namespace openspace; SceneGraphNode* node = sceneGraphNode(identifier); if (!node) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Did not find a match for identifier: {}", identifier )); } @@ -1096,7 +1096,7 @@ enum class [[codegen::enum]] CustomPropertyType { } if (global::userPropertyOwner->hasProperty(identifier)) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Failed to register property '{}' since a user-defined property with that " "name already exists", identifier @@ -1218,7 +1218,7 @@ enum class [[codegen::enum]] CustomPropertyType { delete p; } else { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Could not find user-defined property '{}'", identifier )); } diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 1a39016b90..e35d569367 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -380,7 +380,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( *p.transform->translation ); - LDEBUG(fmt::format( + LDEBUG(std::format( "Successfully created ephemeris for '{}'", result->identifier() )); } @@ -390,7 +390,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( *p.transform->rotation ); - LDEBUG(fmt::format( + LDEBUG(std::format( "Successfully created rotation for '{}'", result->identifier() )); } @@ -398,7 +398,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( if (p.transform->scale.has_value()) { result->_transform.scale = Scale::createFromDictionary(*p.transform->scale); - LDEBUG(fmt::format( + LDEBUG(std::format( "Successfully created scale for '{}'", result->identifier() )); } @@ -411,7 +411,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( if (p.timeFrame.has_value()) { result->_timeFrame = TimeFrame::createFromDictionary(*p.timeFrame); - LDEBUG(fmt::format( + LDEBUG(std::format( "Successfully created time frame for '{}'", result->identifier() )); result->addPropertySubOwner(result->_timeFrame.get()); @@ -423,7 +423,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( ghoul_assert(result->_renderable, "Failed to create Renderable"); result->_renderable->_parent = result.get(); result->addPropertySubOwner(result->_renderable.get()); - LDEBUG(fmt::format( + LDEBUG(std::format( "Successfully created renderable for '{}'", result->identifier() )); } @@ -481,7 +481,7 @@ ghoul::mm_unique_ptr SceneGraphNode::createFromDictionary( } } - LDEBUG(fmt::format("Successfully created SceneGraphNode '{}'", result->identifier())); + LDEBUG(std::format("Successfully created SceneGraphNode '{}'", result->identifier())); result->_lastScreenSpaceUpdateTime = std::chrono::high_resolution_clock::now(); result->_type = "SceneGraphNode"; @@ -584,7 +584,7 @@ void SceneGraphNode::initialize() { ZoneScoped; ZoneName(identifier().c_str(), identifier().size()); - LDEBUG(fmt::format("Initializing: {}", identifier())); + LDEBUG(std::format("Initializing: {}", identifier())); if (_renderable) { _renderable->initialize(); @@ -605,14 +605,14 @@ void SceneGraphNode::initialize() { _evaluatedBoundingSphere = boundingSphere(); _evaluatedInteractionSphere = interactionSphere(); - LDEBUG(fmt::format("Finished initializing: {}", identifier())); + LDEBUG(std::format("Finished initializing: {}", identifier())); } void SceneGraphNode::initializeGL() { ZoneScoped; ZoneName(identifier().c_str(), identifier().size()); - LDEBUG(fmt::format("Initializing GL: {}", identifier())); + LDEBUG(std::format("Initializing GL: {}", identifier())); if (_renderable) { _renderable->initializeGL(); @@ -638,14 +638,14 @@ void SceneGraphNode::initializeGL() { _state = State::GLInitialized; - LDEBUG(fmt::format("Finished initializating GL: {}", identifier())); + LDEBUG(std::format("Finished initializating GL: {}", identifier())); } void SceneGraphNode::deinitialize() { ZoneScoped; ZoneName(identifier().c_str(), identifier().size()); - LDEBUG(fmt::format("Deinitializing: {}", identifier())); + LDEBUG(std::format("Deinitializing: {}", identifier())); setScene(nullptr); @@ -655,20 +655,20 @@ void SceneGraphNode::deinitialize() { clearChildren(); _parent = nullptr; - LDEBUG(fmt::format("Finished deinitializing: {}", identifier())); + LDEBUG(std::format("Finished deinitializing: {}", identifier())); } void SceneGraphNode::deinitializeGL() { ZoneScoped; ZoneName(identifier().c_str(), identifier().size()); - LDEBUG(fmt::format("Deinitializing GL: {}", identifier())); + LDEBUG(std::format("Deinitializing GL: {}", identifier())); if (_renderable) { _renderable->deinitializeGL(); } - LDEBUG(fmt::format("Finished deinitializing GL: {}", identifier())); + LDEBUG(std::format("Finished deinitializing GL: {}", identifier())); } void SceneGraphNode::traversePreOrder(const std::function& fn) { diff --git a/src/scripting/lualibrary.cpp b/src/scripting/lualibrary.cpp index c3c77999ca..2c4045a4bb 100644 --- a/src/scripting/lualibrary.cpp +++ b/src/scripting/lualibrary.cpp @@ -46,7 +46,7 @@ void LuaLibrary::merge(LuaLibrary rhs) { // want to overwrite it LERRORC( "LuaLibrary", - fmt::format( + std::format( "Lua function '{}' in library '{}' has been defined twice", fun.name, rhs.name ) diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index c409b9cc64..78fea8233e 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -247,7 +247,7 @@ bool ScriptEngine::runScriptFile(const std::filesystem::path& filename) { ZoneScoped; if (!std::filesystem::is_regular_file(filename)) { - LERROR(fmt::format("Script with name '{}' did not exist", filename)); + LERROR(std::format("Script with name '{}' did not exist", filename)); return false; } @@ -282,35 +282,35 @@ bool ScriptEngine::isLibraryNameAllowed(lua_State* state, const std::string& nam result = true; break; case LUA_TBOOLEAN: - LERROR(fmt::format("Library name '{}' specifies a boolean", name)); + LERROR(std::format("Library name '{}' specifies a boolean", name)); break; case LUA_TLIGHTUSERDATA: - LERROR(fmt::format("Library name '{}' specifies a light user data", name)); + LERROR(std::format("Library name '{}' specifies a light user data", name)); break; case LUA_TNUMBER: - LERROR(fmt::format("Library name '{}' specifies a number", name)); + LERROR(std::format("Library name '{}' specifies a number", name)); break; case LUA_TSTRING: - LERROR(fmt::format("Library name '{}' specifies a string", name)); + LERROR(std::format("Library name '{}' specifies a string", name)); break; case LUA_TTABLE: if (hasLibrary(name)) { - LERROR(fmt::format( + LERROR(std::format( "Library with name '{}' has been registered before", name )); } else { - LERROR(fmt::format("Library name '{}' specifies a table", name)); + LERROR(std::format("Library name '{}' specifies a table", name)); } break; case LUA_TFUNCTION: - LERROR(fmt::format("Library name '{}' specifies a function", name)); + LERROR(std::format("Library name '{}' specifies a function", name)); break; case LUA_TUSERDATA: - LERROR(fmt::format("Library name '{}' specifies a user data", name)); + LERROR(std::format("Library name '{}' specifies a user data", name)); break; case LUA_TTHREAD: - LERROR(fmt::format("Library name '{}' specifies a thread", name)); + LERROR(std::format("Library name '{}' specifies a thread", name)); break; } @@ -329,7 +329,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, lua_getfield(state, -1, p.name.c_str()); const bool isNil = lua_isnil(state, -1); if (!isNil) { - LERROR(fmt::format("Function name '{}' was already assigned", p.name)); + LERROR(std::format("Function name '{}' was already assigned", p.name)); return; } lua_pop(state, 1); @@ -365,7 +365,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, ghoul::lua::push(state, "documentation"); lua_gettable(state, -2); if (lua_isnil(state, -1)) { - LERROR(fmt::format( + LERROR(std::format( "Module '{}' did not provide a documentation in script file '{}'", library.name, script )); @@ -496,7 +496,7 @@ void ScriptEngine::writeLog(const std::string& script) { _logFilename = absPath(global::configuration->scriptLog).string(); _logFileExists = true; - LDEBUG(fmt::format("Using script log file '{}'", _logFilename)); + LDEBUG(std::format("Using script log file '{}'", _logFilename)); // Test file and clear previous input const std::ofstream file = std::ofstream( @@ -505,7 +505,7 @@ void ScriptEngine::writeLog(const std::string& script) { ); if (!file.good()) { - LERROR(fmt::format( + LERROR(std::format( "Could not open file '{}' for logging scripts", _logFilename )); @@ -521,7 +521,7 @@ void ScriptEngine::writeLog(const std::string& script) { // Simple text output to logfile std::ofstream file(_logFilename, std::ofstream::app); if (!file.good()) { - LERROR(fmt::format("Could not open file '{}' for logging scripts", _logFilename)); + LERROR(std::format("Could not open file '{}' for logging scripts", _logFilename)); return; } diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index a9b55d46ed..64b6e60d9b 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -93,7 +93,7 @@ namespace { [[codegen::luawrap]] std::string readFile(std::filesystem::path file) { std::filesystem::path p = absPath(file); if (!std::filesystem::is_regular_file(p)) { - throw ghoul::lua::LuaError(fmt::format("Could not open file '{}'", file)); + throw ghoul::lua::LuaError(std::format("Could not open file '{}'", file)); } std::ifstream f(p); @@ -224,14 +224,14 @@ std::vector walkCommon(std::string path, bool recursive, bool sorte zip_close(z); if (is64) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Error while unzipping '{}': Zip64 archives are not supported", source )); } int ret = zip_extract(source.c_str(), destination.c_str(), nullptr, nullptr); if (ret != 0) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Error while unzipping '{}': {}", source, ret )); } diff --git a/src/util/coordinateconversion.cpp b/src/util/coordinateconversion.cpp index cf2819cf45..f7638aa095 100644 --- a/src/util/coordinateconversion.cpp +++ b/src/util/coordinateconversion.cpp @@ -49,7 +49,7 @@ namespace { if (hOrDIndex == std::string::npos || mIndex == std::string::npos || sIndex == std::string::npos) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Ra or Dec '{}' format is incorrect. Correct format is: Ra 'XhYmZs', " "and Dec 'XdYmZs'", str )); @@ -65,7 +65,7 @@ namespace { // Hours or degrees must be an integer double temp = std::stod(sHoursOrDegrees); if (std::floor(temp) != temp) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Ra or Dec '{}' format is incorrect. Correct format is: Ra 'XhYmZs', " "and Dec 'XdYmZs', where X must be an integer", str )); @@ -75,7 +75,7 @@ namespace { // Minutes must be an integer temp = std::stod(sMinutes); if (std::floor(temp) != temp) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Ra or Dec '{}' format is incorrect. Correct format is: Ra 'XhYmZs', " "and Dec 'XdYmZs', where Y must be an integer", str )); @@ -86,7 +86,7 @@ namespace { seconds = std::stod(sSeconds); } catch (const std::invalid_argument&) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Ra or Dec '{}' format is incorrect. Correct format is: Ra 'XhYmZs', " "and Dec 'XdYmZs'", str )); @@ -95,7 +95,7 @@ namespace { void parseRa(const std::string& ra, int& hours, int& minutes, double& seconds) { if (ra.find('d') != std::string::npos) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Ra '{}' format is incorrect. Correct format is: 'XhYmZs'", ra )); } @@ -104,7 +104,7 @@ namespace { void parseDec(const std::string& dec, int& degrees, int& minutes, double& seconds) { if (dec.find('h') != std::string::npos) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Dec '{}' format is incorrect. Correct format is: 'XdYmZs'", dec )); } @@ -114,21 +114,21 @@ namespace { bool isRaDecValid(int raH, int raM, double raS, int decD, int decM, double decS) { // Ra if (raH < 0.0 || raH >= 24.0) { - LWARNING(fmt::format( + LWARNING(std::format( "Right ascension hours '{}' is outside the allowed range of 0 to 24 " "hours (exclusive)", raH )); return false; } if (raM < 0.0 || raM >= 60.0) { - LWARNING(fmt::format( + LWARNING(std::format( "Right ascension minutes '{}' is outside the allowed range of 0 to 60 " "minutes (exclusive)", raM )); return false; } if (raS < 0.0 || raS >= 60.0) { - LWARNING(fmt::format( + LWARNING(std::format( "Right ascension seconds '{}' is outside the allowed " "range of 0 to 60 seconds (exclusive)", raS )); @@ -137,7 +137,7 @@ namespace { // Dec if (decD < -90.0 || decD > 90.0) { - LWARNING(fmt::format("Declination degrees '{}' is outside the allowed range " + LWARNING(std::format("Declination degrees '{}' is outside the allowed range " "of -90 to 90 degrees (inclusive)", decD )); return false; @@ -150,14 +150,14 @@ namespace { return false; } if (decM < 0.0 || decM >= 60.0) { - LWARNING(fmt::format( + LWARNING(std::format( "Declination minutes '{}' is outside the allowed range of 0 to 60 " "minutes (exclusive)", decM )); return false; } if (decS < 0.0 || decS >= 60.0) { - LWARNING(fmt::format( + LWARNING(std::format( "Declination seconds '{}' is outside the allowed range of 0 to 60 " "seconds (exclusive)", decS )); @@ -206,7 +206,7 @@ glm::dvec3 icrsToGalacticCartesian(double ra, double dec, double distance) { // coordinates-of-stars glm::dvec2 icrsToDecimalDegrees(const std::string& ra, const std::string& dec) { if (ra.size() < 6 || dec.size() < 6) { - throw ghoul::lua::LuaRuntimeException(fmt::format( + throw ghoul::lua::LuaRuntimeException(std::format( "Ra '{}' or Dec '{}' format is incorrect. Correct format is: Ra 'XhYmZs', " "and Dec 'XdYmZs'", ra, dec )); @@ -233,7 +233,7 @@ glm::dvec2 icrsToDecimalDegrees(const std::string& ra, const std::string& dec) { ); if (!isValid) { - LWARNING(fmt::format( + LWARNING(std::format( "Ra '{}' or Dec '{}' is outside the allowed range, result may be incorrect", ra, dec )); @@ -289,7 +289,7 @@ glm::dvec3 galacticCartesianToIcrs(double x, double y, double z) { std::pair decimalDegreesToIcrs(double ra, double dec) { // Check input if (ra < 0.0 || ra > 360.0 || dec < -90.0 || dec > 90.0) { - LWARNING(fmt::format( + LWARNING(std::format( "Ra '{}' or Dec '{}' is outside the allowed range, result may be incorrect", ra, dec )); @@ -327,7 +327,7 @@ std::pair decimalDegreesToIcrs(double ra, double dec) ); if (!isValid) { - LWARNING(fmt::format( + LWARNING(std::format( "Resulting Ra '{}' or Dec '{}' is outside the allowed range, result may be " "incorrect", result.first, result.second )); diff --git a/src/util/httprequest.cpp b/src/util/httprequest.cpp index 1a56a7d4f0..6861cca777 100644 --- a/src/util/httprequest.cpp +++ b/src/util/httprequest.cpp @@ -123,7 +123,7 @@ bool HttpRequest::perform(std::chrono::milliseconds timeout) { if (responseCode >= 400) { LERRORC( "HttpRequest", - fmt::format("Failed download '{}' with code {}", _url, responseCode) + std::format("Failed download '{}' with code {}", _url, responseCode) ); success = false; } @@ -134,7 +134,7 @@ bool HttpRequest::perform(std::chrono::milliseconds timeout) { else { LERRORC( "HttpRequest", - fmt::format( + std::format( "Failed download '{}' with error {}", _url, curl_easy_strerror(res) ) ); @@ -189,7 +189,7 @@ void HttpDownload::start(std::chrono::milliseconds timeout) { _isDownloading = true; _downloadThread = std::thread([this, timeout]() { _isFinished = false; - LTRACEC("HttpDownload", fmt::format("Start download '{}'", _httpRequest.url())); + LTRACEC("HttpDownload", std::format("Start download '{}'", _httpRequest.url())); const bool setupSuccess = setup(); if (setupSuccess) { @@ -206,13 +206,13 @@ void HttpDownload::start(std::chrono::milliseconds timeout) { if (_isSuccessful) { LTRACEC( "HttpDownload", - fmt::format("Finished async download '{}'", _httpRequest.url()) + std::format("Finished async download '{}'", _httpRequest.url()) ); } else { LTRACEC( "HttpDownload", - fmt::format("Failed async download '{}'", _httpRequest.url()) + std::format("Failed async download '{}'", _httpRequest.url()) ); } @@ -258,7 +258,7 @@ HttpFileDownload::HttpFileDownload(std::string url, std::filesystem::path destin , _destination(std::move(destination)) { if (!overwrite && std::filesystem::is_regular_file(_destination)) { - throw ghoul::RuntimeError(fmt::format("File '{}' already exists", _destination)); + throw ghoul::RuntimeError(std::format("File '{}' already exists", _destination)); } } @@ -288,7 +288,7 @@ bool HttpFileDownload::setup() { // GetLastError() gives more details than errno. DWORD errorId = GetLastError(); if (errorId == 0) { - LERRORC("HttpFileDownload", fmt::format("Cannot open file '{}'", _destination)); + LERRORC("HttpFileDownload", std::format("Cannot open file '{}'", _destination)); return false; } std::array Buffer; @@ -306,7 +306,7 @@ bool HttpFileDownload::setup() { std::string message(Buffer.data(), size); LERRORC( "HttpFileDownload", - fmt::format("Cannot open file '{}': {}", _destination, message) + std::format("Cannot open file '{}': {}", _destination, message) ); return false; #else // ^^^ WIN32 / !WIN32 vvv @@ -315,7 +315,7 @@ bool HttpFileDownload::setup() { std::array buffer; LERRORC( "HttpFileDownload", - fmt::format( + std::format( "Cannot open file '{}': {}", _destination, std::string(strerror_r(errno, buffer.data(), sizeof(buffer))) @@ -325,7 +325,7 @@ bool HttpFileDownload::setup() { #else // ^^^ __unix__ / !__unix__ vvv LERRORC( "HttpFileDownload", - fmt::format( + std::format( "Cannot open file '{}': {}", _destination, std::string(strerror(errno)) ) ); @@ -333,7 +333,7 @@ bool HttpFileDownload::setup() { #endif // __unix__ } - LERRORC("HttpFileDownload", fmt::format("Cannot open file '{}'", _destination)); + LERRORC("HttpFileDownload", std::format("Cannot open file '{}'", _destination)); return false; #endif // WIN32 } diff --git a/src/util/json_helper.cpp b/src/util/json_helper.cpp index 644d294a11..4d32fb52b3 100644 --- a/src/util/json_helper.cpp +++ b/src/util/json_helper.cpp @@ -126,7 +126,7 @@ ghoul::Dictionary jsonToDictionary(const nlohmann::json& json) { for (int i = 0; i < j.size(); i++) { const nlohmann::json& value = j[i]; // We add 1 to the key to make Lua happy :-/ - addToDict(subDict, fmt::format("{}", i + 1), value); + addToDict(subDict, std::format("{}", i + 1), value); } dict.setValue(std::move(key), std::move(subDict)); break; diff --git a/src/util/keys.cpp b/src/util/keys.cpp index 0d4fd26aca..52dbfda6f7 100644 --- a/src/util/keys.cpp +++ b/src/util/keys.cpp @@ -59,7 +59,7 @@ KeyWithModifier stringToKey(const std::string& str) { } } if (key == Key::Unknown) { - throw ghoul::RuntimeError(fmt::format("Could not find key for '{}'", keyName)); + throw ghoul::RuntimeError(std::format("Could not find key for '{}'", keyName)); } KeyModifier m = KeyModifier::None; @@ -77,7 +77,7 @@ KeyWithModifier stringToKey(const std::string& str) { } } if (!found) { - throw ghoul::RuntimeError(fmt::format("Unknown modifier key '{}'", s)); + throw ghoul::RuntimeError(std::format("Unknown modifier key '{}'", s)); } } ); @@ -98,7 +98,7 @@ std::string keyToString(KeyWithModifier keyWithModifier) { // checks internally against != 0 if (hasKeyModifier(keyWithModifier.modifier, kmi.modifier)) { - modifier += fmt::format("{}+", kmi.identifier); + modifier += std::format("{}+", kmi.identifier); } } } @@ -145,7 +145,7 @@ std::string to_string(const openspace::KeyModifier& value) { // internally against != 0 if (hasKeyModifier(value, kmi.modifier)) { - result += fmt::format("{}+", kmi.name); + result += std::format("{}+", kmi.name); } } @@ -161,7 +161,7 @@ std::string to_string(const openspace::KeyWithModifier& value) { return to_string(value.key); } else { - return fmt::format("{}+{}", to_string(value.modifier), to_string(value.key)); + return std::format("{}+{}", to_string(value.modifier), to_string(value.key)); } } diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index 46f748fb8d..ab736d235e 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -56,7 +56,7 @@ void OpenSpaceModule::initialize(const ghoul::Dictionary& configuration) { std::filesystem::path path = modulePath(); if (!path.empty()) { - LDEBUG(fmt::format("Registering module path '{}' -> {}", moduleToken, path)); + LDEBUG(std::format("Registering module path '{}' -> {}", moduleToken, path)); FileSys.registerPathToken(std::move(moduleToken), std::move(path)); } diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index 03059610b0..b1766b6f44 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -34,6 +33,7 @@ #include #include #include +#include #include "SpiceUsr.h" #include "SpiceZpr.h" @@ -100,7 +100,7 @@ SpiceManager::AberrationCorrection::AberrationCorrection(const std::string& iden auto it = Mapping.find(identifier); ghoul_assert(!identifier.empty(), "Identifier may not be empty"); - ghoul_assert(it != Mapping.end(), fmt::format("Invalid identifer '{}'", identifier)); + ghoul_assert(it != Mapping.end(), std::format("Invalid identifer '{}'", identifier)); type = it->second.first; direction = it->second.second; @@ -218,11 +218,11 @@ SpiceManager::KernelHandle SpiceManager::loadKernel(std::string filePath) { ghoul_assert(!filePath.empty(), "Empty file path"); ghoul_assert( std::filesystem::is_regular_file(filePath), - fmt::format("File '{}' ({}) does not exist", filePath, absPath(filePath)) + std::format("File '{}' ({}) does not exist", filePath, absPath(filePath)) ); ghoul_assert( std::filesystem::is_directory(std::filesystem::path(filePath).parent_path()), - fmt::format( + std::format( "File '{}' exists, but directory '{}' does not", absPath(filePath), std::filesystem::path(filePath).parent_path() ) @@ -248,7 +248,7 @@ SpiceManager::KernelHandle SpiceManager::loadKernel(std::string filePath) { const std::filesystem::path p = path.parent_path(); std::filesystem::current_path(p); - LINFO(fmt::format("Loading SPICE kernel '{}'", path)); + LINFO(std::format("Loading SPICE kernel '{}'", path)); // Load the kernel furnsh_c(path.string().c_str()); @@ -287,14 +287,14 @@ void SpiceManager::unloadKernel(KernelHandle kernelId) { // If there was only one part interested in the kernel, we can unload it if (it->refCount == 1) { // No need to check for errors as we do not allow empty path names - LINFO(fmt::format("Unloading SPICE kernel '{}'", it->path)); + LINFO(std::format("Unloading SPICE kernel '{}'", it->path)); unload_c(it->path.c_str()); _loadedKernels.erase(it); } // Otherwise, we hold on to it, but reduce the reference counter by 1 else { it->refCount--; - LDEBUG(fmt::format("Reducing reference counter to: {}", it->refCount)); + LDEBUG(std::format("Reducing reference counter to: {}", it->refCount)); } } } @@ -313,7 +313,7 @@ void SpiceManager::unloadKernel(std::string filePath) { if (it == _loadedKernels.end()) { if (_useExceptions) { throw SpiceException( - fmt::format("'{}' did not correspond to a loaded kernel", path) + std::format("'{}' did not correspond to a loaded kernel", path) ); } else { @@ -323,14 +323,14 @@ void SpiceManager::unloadKernel(std::string filePath) { else { // If there was only one part interested in the kernel, we can unload it if (it->refCount == 1) { - LINFO(fmt::format("Unloading SPICE kernel '{}'", path)); + LINFO(std::format("Unloading SPICE kernel '{}'", path)); unload_c(path.string().c_str()); _loadedKernels.erase(it); } else { // Otherwise, we hold on to it, but reduce the reference counter by 1 it->refCount--; - LDEBUG(fmt::format("Reducing reference counter to: {}", it->refCount)); + LDEBUG(std::format("Reducing reference counter to: {}", it->refCount)); } } } @@ -494,7 +494,7 @@ int SpiceManager::naifId(const std::string& body) const { SpiceInt id = 0; bods2c_c(body.c_str(), &id, &success); if (!success && _useExceptions) { - throw SpiceException(fmt::format("Could not find NAIF ID of body '{}'", body)); + throw SpiceException(std::format("Could not find NAIF ID of body '{}'", body)); } return id; } @@ -515,7 +515,7 @@ int SpiceManager::frameId(const std::string& frame) const { SpiceInt id = 0; namfrm_c(frame.c_str(), &id); if (id == 0 && _useExceptions) { - throw SpiceException(fmt::format("Could not find NAIF ID of frame '{}'", frame)); + throw SpiceException(std::format("Could not find NAIF ID of frame '{}'", frame)); } return id; } @@ -540,7 +540,7 @@ void getValueInternal(const std::string& body, const std::string& value, int siz if (failed_c()) { throwSpiceError( - fmt::format("Error getting value '{}' for body '{}'", value, body) + std::format("Error getting value '{}' for body '{}'", value, body) ); } } @@ -586,7 +586,7 @@ double SpiceManager::spacecraftClockToET(const std::string& craft, double et = 0.0; sct2e_c(craftId, craftTicks, &et); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error transforming spacecraft clock of '{}' at time {}", craft, craftTicks )); } @@ -603,7 +603,7 @@ double SpiceManager::ephemerisTimeFromDate(const char* timeString) const { double et = 0.0; str2et_c(timeString, &et); if (failed_c()) { - throwSpiceError(fmt::format("Error converting date '{}'", timeString)); + throwSpiceError(std::format("Error converting date '{}'", timeString)); } return et; } @@ -616,7 +616,7 @@ std::string SpiceManager::dateFromEphemerisTime(double ephemerisTime, const char timout_c(ephemerisTime, format, BufferSize, Buffer.data()); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error converting ephemeris time '{}' to date with format '{}'", ephemerisTime, format )); @@ -646,7 +646,7 @@ glm::dvec3 SpiceManager::targetPosition(const std::string& target, if (!targetHasCoverage && !observerHasCoverage) { if (_useExceptions) { throw SpiceException( - fmt::format( + std::format( "Neither target '{}' nor observer '{}' has SPK coverage at time '{}'", target, observer, ephemerisTime ) @@ -668,7 +668,7 @@ glm::dvec3 SpiceManager::targetPosition(const std::string& target, &lightTime ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error getting position from '{}' to '{}' in frame '{}' at time '{}'", target, observer, referenceFrame, ephemerisTime )); @@ -736,7 +736,7 @@ glm::dmat3 SpiceManager::frameTransformationMatrix(const std::string& from, if (failed_c()) { throwSpiceError( - fmt::format("Error converting from frame '{}' to frame '{}' at time '{}'", + std::format("Error converting from frame '{}' to frame '{}' at time '{}'", from, to, ephemerisTime ) ); @@ -784,7 +784,7 @@ SpiceManager::SurfaceInterceptResult SpiceManager::surfaceIntercept( result.interceptFound = (found == SPICETRUE); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error retrieving surface intercept on target '{}' viewed from observer '{}' " "in reference frame '{}' at time '{}'", target, observer, referenceFrame, ephemerisTime @@ -821,7 +821,7 @@ bool SpiceManager::isTargetInFieldOfView(const std::string& target, ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Checking if target '{}' is in view of instrument '{}' failed", target, instrument )); @@ -856,7 +856,7 @@ SpiceManager::TargetStateResult SpiceManager::targetState(const std::string& tar ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error retrieving state of target '{}' viewed from observer '{}' in " "reference frame '{}' at time '{}'", target, observer, referenceFrame, ephemerisTime @@ -884,7 +884,7 @@ SpiceManager::TransformMatrix SpiceManager::stateTransformMatrix( reinterpret_cast(m.data()) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error retrieved state transform matrix from frame '{}' to frame '{}' at " "time '{}'", sourceFrame, destinationFrame, ephemerisTime @@ -942,7 +942,7 @@ glm::dmat3 SpiceManager::positionTransformMatrix(const std::string& sourceFrame, reinterpret_cast(glm::value_ptr(result)) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error retrieving position transform matrix from '{}' at time '{}' to frame " "'{}' at time '{}'", sourceFrame, ephemerisTimeFrom, destinationFrame, ephemerisTimeTo @@ -980,7 +980,7 @@ SpiceManager::FieldOfViewResult SpiceManager::fieldOfView(int instrument) const ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error getting field-of-view parameters for instrument '{}'", instrument )); return res; @@ -1039,7 +1039,7 @@ SpiceManager::TerminatorEllipseResult SpiceManager::terminatorEllipse( reinterpret_cast(res.terminatorPoints.data()) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error getting terminator ellipse for target '{}' from observer '{}' in " "frame '{}' with light source '{}' at time '{}'", target, observer, frame, lightSource, ephemerisTime @@ -1052,7 +1052,7 @@ void SpiceManager::findCkCoverage(const std::string& path) { ghoul_assert(!path.empty(), "Empty file path"); ghoul_assert( std::filesystem::is_regular_file(path), - fmt::format("File '{}' does not exist", path) + std::format("File '{}' does not exist", path) ); constexpr unsigned int MaxObj = 1024; @@ -1112,7 +1112,7 @@ void SpiceManager::findSpkCoverage(const std::string& path) { ghoul_assert(!path.empty(), "Empty file path"); ghoul_assert( std::filesystem::is_regular_file(path), - fmt::format("File '{}' does not exist", path) + std::format("File '{}' does not exist", path) ); constexpr unsigned int MaxObj = 1024; @@ -1193,7 +1193,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, if (_spkCoverageTimes.find(targetId) == _spkCoverageTimes.end()) { if (_useExceptions) { // no coverage - throw SpiceException(fmt::format("No position for '{}' at any time", target)); + throw SpiceException(std::format("No position for '{}' at any time", target)); } else { return glm::dvec3(0.0); @@ -1215,7 +1215,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, &lightTime ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating position for '{}' with observer '{}' in frame '{}'", target, observer, referenceFrame )); @@ -1234,7 +1234,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, &lightTime ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating position for '{}' with observer '{}' in frame '{}'", target, observer, referenceFrame )); @@ -1269,7 +1269,7 @@ glm::dvec3 SpiceManager::getEstimatedPosition(const std::string& target, ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating position for '{}' with observer '{}' in frame '{}'", target, observer, referenceFrame )); @@ -1294,7 +1294,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram if (_ckCoverageTimes.find(idFrame) == _ckCoverageTimes.end()) { if (_useExceptions) { // no coverage - throw SpiceException(fmt::format( + throw SpiceException(std::format( "No data available for transform matrix from '{}' to '{}' at any time", fromFrame, toFrame )); @@ -1315,7 +1315,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram reinterpret_cast(glm::value_ptr(result)) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating transform matrix from '{}' to from '{}' at time '{}'", fromFrame, toFrame, time )); @@ -1330,7 +1330,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram reinterpret_cast(glm::value_ptr(result)) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating transform matrix from frame '{}' to '{}' at time '{}'", fromFrame, toFrame, time )); @@ -1349,7 +1349,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram reinterpret_cast(glm::value_ptr(earlierTransform)) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating transform matrix from frame '{}' to '{}' at time '{}'", fromFrame, toFrame, time )); @@ -1363,7 +1363,7 @@ glm::dmat3 SpiceManager::getEstimatedTransformMatrix(const std::string& fromFram reinterpret_cast(glm::value_ptr(laterTransform)) ); if (failed_c()) { - throwSpiceError(fmt::format( + throwSpiceError(std::format( "Error estimating transform matrix from frame '{}' to '{}' at time '{}'", fromFrame, toFrame, time )); diff --git a/src/util/spicemanager_lua.inl b/src/util/spicemanager_lua.inl index 1322c43b6a..dec8e0df24 100644 --- a/src/util/spicemanager_lua.inl +++ b/src/util/spicemanager_lua.inl @@ -36,7 +36,7 @@ namespace { if (std::holds_alternative(kernel)) { std::string k = std::get(kernel); if (!std::filesystem::is_regular_file(k)) { - throw ghoul::lua::LuaError(fmt::format("Kernel file '{}' did not exist", k)); + throw ghoul::lua::LuaError(std::format("Kernel file '{}' did not exist", k)); } openspace::SpiceManager::ref().loadKernel(k); } @@ -44,7 +44,7 @@ namespace { std::vector ks = std::get>(kernel); for (const std::string& k : ks) { if (!std::filesystem::is_regular_file(k)) { - throw ghoul::lua::LuaError(fmt::format( + throw ghoul::lua::LuaError(std::format( "Kernel file '{}' did not exist", k )); } @@ -192,7 +192,7 @@ namespace { std::vector lines = ghoul::tokenizeString(contents, '\n'); const size_t nElements = lines.size() / 3; if (elementToExtract > nElements) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error loading {}. Element number {} requested, but only {} found", tle, nElements, elementToExtract )); @@ -203,14 +203,14 @@ namespace { // It should be 70, but we're removing the \n character at the end in the tokenization std::string line1 = lines[3 * elementToExtract + 1]; if (line1.size() != TLEColumnWidth - 1) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Illformed TLE file {}, expected {} characters per line, got {}", tle, TLEColumnWidth, line1.size() )); } std::string line2 = lines[3 * elementToExtract + 2]; if (line2.size() != TLEColumnWidth - 1) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Illformed TLE file {}, expected {} characters per line, got {}", tle, TLEColumnWidth, line2.size() )); @@ -235,7 +235,7 @@ namespace { // Extract the body id std::vector tokens = ghoul::tokenizeString(line2, ' '); if (tokens.size() < 2) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error parsing TLE file {}. Expected 8-9 elements in the second row, got {}", tle, tokens.size() )); @@ -248,7 +248,7 @@ namespace { // Write the elements to a new SPK file const SpiceInt nCommentCharacters = 0; - std::string internalFileName = fmt::format("Type 10 SPK for {}", tle); + std::string internalFileName = std::format("Type 10 SPK for {}", tle); std::string segmentId = "Segment"; if (std::filesystem::exists(spk)) { diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp index a6c25bb224..045e4680ce 100644 --- a/src/util/taskloader.cpp +++ b/src/util/taskloader.cpp @@ -58,7 +58,7 @@ std::vector> TaskLoader::tasksFromDictionary( const std::string& taskType = subTask.value("Type"); std::unique_ptr task = Task::createFromDictionary(subTask); if (!task) { - LERROR(fmt::format( + LERROR(std::format( "Failed to create a Task object of type '{}'", taskType )); } @@ -71,7 +71,7 @@ std::vector> TaskLoader::tasksFromDictionary( std::vector> TaskLoader::tasksFromFile(const std::string& path) { std::filesystem::path absTasksFile = absPath(path); if (!std::filesystem::is_regular_file(absTasksFile)) { - LERROR(fmt::format( + LERROR(std::format( "Could not load tasks file '{}'. File not found", absTasksFile )); return std::vector>(); @@ -82,7 +82,7 @@ std::vector> TaskLoader::tasksFromFile(const std::string& ghoul::lua::loadDictionaryFromFile(absTasksFile.string(), tasksDictionary); } catch (const ghoul::RuntimeError& e) { - LERROR(fmt::format( + LERROR(std::format( "Could not load tasks file '{}'. Lua error: ({}) {}", absTasksFile, e.message, e.component )); @@ -93,7 +93,7 @@ std::vector> TaskLoader::tasksFromFile(const std::string& return tasksFromDictionary(tasksDictionary); } catch (const documentation::SpecificationError& e) { - LERROR(fmt::format("Could not load tasks file '{}': {}", absTasksFile, e.what())); + LERROR(std::format("Could not load tasks file '{}': {}", absTasksFile, e.what())); logError(e); return std::vector>(); diff --git a/src/util/time.cpp b/src/util/time.cpp index 85f3259b25..51419dcc90 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -63,7 +63,7 @@ double Time::convertTime(const char* time) { std::string Time::currentWallTime() { const std::time_t t = std::time(nullptr); std::tm* utcTime = std::gmtime(&t); - const std::string time = fmt::format( + const std::string time = std::format( "{:04d}-{:02d}-{:02d}T{:02d}:{:02d}:{:02d}", utcTime->tm_year + 1900, utcTime->tm_mon + 1, utcTime->tm_mday, utcTime->tm_hour, utcTime->tm_min, utcTime->tm_sec @@ -177,7 +177,7 @@ std::string Time::advancedTime(const std::string& base, std::string change) { else if (uName == "M") { unit = TimeUnit::Month; } else if (uName == "y") { unit = TimeUnit::Year; } else { - throw ghoul::RuntimeError(fmt::format("Unknown unit '{}'", uName)); + throw ghoul::RuntimeError(std::format("Unknown unit '{}'", uName)); } dt = openspace::convertTime(value, unit, TimeUnit::Second); @@ -186,7 +186,7 @@ std::string Time::advancedTime(const std::string& base, std::string change) { } } catch (...) { - throw ghoul::RuntimeError(fmt::format( + throw ghoul::RuntimeError(std::format( "Error parsing relative time offset '{}'", change )); } diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 5cbd3c942d..811c808a13 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -329,7 +329,7 @@ namespace { } else { double v = std::get(change); - c = fmt::format("{}s", v); + c = std::format("{}s", v); } std::string res = openspace::Time::advancedTime(std::move(b), std::move(c)); diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index 74ac17eb4a..2f704f39a4 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -499,16 +499,16 @@ void TimeManager::addDeltaTimesKeybindings() { ); auto addDeltaTimeKeybind = [this](Key key, KeyModifier mod, double step) { - const std::string s = fmt::format("{:.0f}", step); + const std::string s = std::format("{:.0f}", step); - std::string identifier = fmt::format("{}.{}", DeltaTimeActionPrefix, s); + std::string identifier = std::format("{}.{}", DeltaTimeActionPrefix, s); interaction::Action action; action.identifier = identifier; - action.command = fmt::format("openspace.time.interpolateDeltaTime({})", s); - action.documentation = fmt::format( + action.command = std::format("openspace.time.interpolateDeltaTime({})", s); + action.documentation = std::format( "Setting the simulation speed to {} seconds per realtime second", s ); - action.name = fmt::format("Set: {}", s); + action.name = std::format("Set: {}", s); action.guiPath = DeltaTimeStepsGuiPath; action.isLocal = interaction::Action::IsLocal::Yes; global::actionManager->registerAction(std::move(action)); @@ -542,7 +542,7 @@ void TimeManager::addDeltaTimesKeybindings() { LINFO("Added keybindings for specified delta time steps"); const int maxKeyBinds = 3 * nKeys; if (nSteps > maxKeyBinds) { - LWARNING(fmt::format( + LWARNING(std::format( "Error settings delta time keys: Too many delta times, so not all could be " "mapped to a key. Total: {} steps, which is {} more than the number of " "available keybindings", @@ -567,9 +567,9 @@ void TimeManager::clearDeltaTimesKeybindings() { if (bindings.size() > 1) { std::string names; for (auto& b : bindings) { - names += fmt::format("'{}' ", b.second); + names += std::format("'{}' ", b.second); } - LWARNING(fmt::format( + LWARNING(std::format( "Updating keybindings for new delta time steps: More than one action " "was bound to key '{}'. The following actions are removed: {}", ghoul::to_string(kb), names diff --git a/src/util/versionchecker.cpp b/src/util/versionchecker.cpp index d4efdd8e9a..bbe89433c0 100644 --- a/src/util/versionchecker.cpp +++ b/src/util/versionchecker.cpp @@ -47,7 +47,7 @@ void VersionChecker::requestLatestVersion(const std::string& url) { std::string operatingSystem = SysCap.component().operatingSystemString(); operatingSystem = ghoul::encodeUrl(operatingSystem); - std::string fullUrl = fmt::format( + std::string fullUrl = std::format( "{}?client_version={}&commit_hash={}&operating_system={}", url, OPENSPACE_VERSION_NUMBER, OPENSPACE_GIT_COMMIT, operatingSystem ); @@ -100,7 +100,7 @@ void VersionChecker::cancel() { }; if (currentVersion < _latestVersion) { - LINFO(fmt::format( + LINFO(std::format( "Newer OpenSpace version {}.{}.{} is available. " "Currently running {}.{}.{}", _latestVersion->major, @@ -112,7 +112,7 @@ void VersionChecker::cancel() { )); } else { - LINFO(fmt::format( + LINFO(std::format( "OpenSpace version {}.{}.{} is up to date", currentVersion.major, currentVersion.minor, @@ -126,7 +126,7 @@ void VersionChecker::cancel() { _request->wait(); std::vector data = _request->downloadedData(); const std::string response = std::string(data.begin(), data.end()); - LWARNING(fmt::format( + LWARNING(std::format( "Failed to get OpenSpace version information from {}. Response: {}", _request->url(), response diff --git a/support/coding/codegen b/support/coding/codegen index 871a465402..8798d8a462 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 871a4654024fc1043cc2120a94d05fb3edc88887 +Subproject commit 8798d8a462d93dd5a2fd3b8dfa8917083e50a6ee diff --git a/tests/test_sgctedit.cpp b/tests/test_sgctedit.cpp index 0ac97f351d..283cbcf3ac 100644 --- a/tests/test_sgctedit.cpp +++ b/tests/test_sgctedit.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include