mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-28 15:09:36 -06:00
Remove fmt::format and replace with std::format
This commit is contained in:
@@ -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
|
||||
);
|
||||
|
||||
@@ -140,7 +140,7 @@ std::shared_ptr<DownloadManager::FileFuture> 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::FileFuture> 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::FileFuture> 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::MemoryFile> 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::MemoryFile> 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
|
||||
|
||||
@@ -97,7 +97,7 @@ void ModuleEngine::initializeGL() {
|
||||
|
||||
LDEBUG("Initializing OpenGL of modules");
|
||||
for (std::unique_ptr<OpenSpaceModule>& 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<OpenSpaceModule> 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));
|
||||
}
|
||||
|
||||
|
||||
@@ -236,11 +236,11 @@ void OpenSpaceEngine::registerPathTokens() {
|
||||
using T = std::string;
|
||||
for (const std::pair<const T, T>& 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<OCC>().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<std::string> 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<int>(error))
|
||||
std::format("Unknown error code: {0:x}", static_cast<int>(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<uint16_t>(k.key.key))
|
||||
));
|
||||
|
||||
@@ -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<DownloadManager::FileFuture> 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<std::vector<std::string>> 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);
|
||||
|
||||
@@ -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
|
||||
));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user