From 38c25bb50d76409193db2438db60369f3868edf9 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sun, 19 Feb 2023 13:45:56 +0000 Subject: Added a crash reporter --- src/helpers/MiscFunctions.cpp | 9 +++++++++ src/helpers/MiscFunctions.hpp | 6 ++---- 2 files changed, 11 insertions(+), 4 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp index 40121de3..dcc1efbd 100644 --- a/src/helpers/MiscFunctions.cpp +++ b/src/helpers/MiscFunctions.cpp @@ -549,4 +549,13 @@ double normalizeAngleRad(double ang) { } return ang; +} + +std::string replaceInString(std::string subject, const std::string& search, const std::string& replace) { + size_t pos = 0; + while ((pos = subject.find(search, pos)) != std::string::npos) { + subject.replace(pos, search.length(), replace); + pos += replace.length(); + } + return subject; } \ No newline at end of file diff --git a/src/helpers/MiscFunctions.hpp b/src/helpers/MiscFunctions.hpp index 43cfb944..a5f21313 100644 --- a/src/helpers/MiscFunctions.hpp +++ b/src/helpers/MiscFunctions.hpp @@ -16,9 +16,7 @@ void logSystemInfo(); std::string execAndGet(const char*); int64_t getPPIDof(int64_t pid); int64_t configStringToInt(const std::string&); - float getPlusMinusKeywordResult(std::string in, float relative); - void matrixProjection(float mat[9], int w, int h, wl_output_transform tr); - -double normalizeAngleRad(double ang); \ No newline at end of file +double normalizeAngleRad(double ang); +std::string replaceInString(std::string subject, const std::string& search, const std::string& replace); \ No newline at end of file -- cgit v1.2.3