summaryrefslogtreecommitdiff
path: root/src/lib/exceptions.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-07-09 22:53:27 +0200
committerCarl Hetherington <cth@carlh.net>2025-07-10 20:50:32 +0200
commit62c34b28567a097e8f22576e7d7891bd3dbe0ac0 (patch)
tree2a0440ed2bdb58c608582b75da6c877527dd6bda /src/lib/exceptions.h
parent2c499921a9f8615c8368d8161cb43c9a93c67311 (diff)
Replace String::compose with fmt.
sed -i "/Plural-Forms/n;/%100/n;/scanf/n;s/%[123456789]/{}/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc src/lib/po/*.po src/wx/po/*.po src/tools/po/*.po test/*.cc sed -i "s/String::compose */fmt::format/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc test/*.cc
Diffstat (limited to 'src/lib/exceptions.h')
-rw-r--r--src/lib/exceptions.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/exceptions.h b/src/lib/exceptions.h
index 17a00b276..bc14e3f2b 100644
--- a/src/lib/exceptions.h
+++ b/src/lib/exceptions.h
@@ -55,19 +55,19 @@ public:
{}
DecodeError (std::string function, std::string caller)
- : std::runtime_error (String::compose("%1 failed [%2]", function, caller))
+ : std::runtime_error (fmt::format("{} failed [{}]", function, caller))
{}
DecodeError (std::string function, std::string caller, int error)
- : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error))
+ : std::runtime_error (fmt::format("{} failed [{}] ({})", function, caller, error))
{}
DecodeError (std::string function, std::string caller, boost::filesystem::path file)
- : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, file.string()))
+ : std::runtime_error (fmt::format("{} failed [{}] ({})", function, caller, file.string()))
{}
DecodeError (std::string function, std::string caller, int error, boost::filesystem::path file)
- : std::runtime_error (String::compose("%1 failed [%2] (%3) (%4)", function, caller, error, file.string()))
+ : std::runtime_error (fmt::format("{} failed [{}] ({}) ({})", function, caller, error, file.string()))
{}
};
@@ -92,11 +92,11 @@ public:
{}
explicit EncodeError (std::string function, std::string caller)
- : std::runtime_error (String::compose("%1 failed [%2]", function, caller))
+ : std::runtime_error (fmt::format("{} failed [{}]", function, caller))
{}
explicit EncodeError (std::string function, std::string caller, int error)
- : std::runtime_error (String::compose("%1 failed [%2] (%3)", function, caller, error))
+ : std::runtime_error (fmt::format("{} failed [{}] ({})", function, caller, error))
{}
};
@@ -111,7 +111,7 @@ public:
* @param f Name of the file that this exception concerns.
*/
FileError (std::string m, boost::filesystem::path f)
- : std::runtime_error (String::compose("%1 with %2", m, f.string()))
+ : std::runtime_error (fmt::format("{} with {}", m, f.string()))
, _file (f)
{}
@@ -344,7 +344,7 @@ class CPLNotFoundError : public DCPError
{
public:
CPLNotFoundError(std::string id)
- : DCPError(String::compose("CPL %1 not found", id))
+ : DCPError(fmt::format("CPL {} not found", id))
{}
};
@@ -515,17 +515,17 @@ private:
std::string get_message(SQLiteDatabase& db, char const* s)
{
- return String::compose("%1 (in %2)", s, get_filename(db).string());
+ return fmt::format("{} (in {})", s, get_filename(db).string());
}
std::string get_message(SQLiteDatabase& db, int rc)
{
- return String::compose("%1 (in %2)", sqlite3_errstr(rc), get_filename(db).string());
+ return fmt::format("{} (in {})", sqlite3_errstr(rc), get_filename(db).string());
}
std::string get_message(SQLiteDatabase& db, int rc, std::string doing)
{
- return String::compose("%1 (while doing %2) (in %3)", sqlite3_errstr(rc), doing, get_filename(db).string());
+ return fmt::format("{} (while doing {}) (in {})", sqlite3_errstr(rc), doing, get_filename(db).string());
}
boost::filesystem::path _filename;