From 27fbc85d157b845132132327b309effaa9e5a670 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 28 Mar 2019 21:22:22 +0100 Subject: [PATCH] helpers: fix formatting of trim functions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9e1818062c3d965d224ec9c30d590ab635d6c03b Author: vanhofen Date: 2019-03-28 (Thu, 28 Mar 2019) Origin message was: ------------------ - helpers: fix formatting of trim functions --- src/system/helpers.cpp | 8 ++++---- src/system/helpers.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index e101cc8b9..1a9eb11b9 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -613,16 +613,16 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) return result.erase(0, result.find_first_not_of(trimChars)); } -std::string ltrim(std::string& str, const std::string& trimChars) +std::string ltrim(std::string &str, const std::string &trimChars) { str.erase(0, str.find_first_not_of(trimChars)); return str; } -std::string rtrim(std::string& str, const std::string& trimChars) +std::string rtrim(std::string &str, const std::string &trimChars) { - str.erase(str.find_last_not_of(trimChars) + 1); - return str; + str.erase(str.find_last_not_of(trimChars) + 1); + return str; } std::string cutString(const std::string str, int msgFont, const int width) diff --git a/src/system/helpers.h b/src/system/helpers.h index e5d8cd3a8..0afbeea09 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -71,9 +71,9 @@ std::string getBaseName(std::string &path); std::string getFileName(std::string &file); std::string getFileExt(std::string &file); std::string getNowTimeStr(const char* format); -std::string trim(std::string& str, const std::string& trimChars = " \n\r\t"); -std::string ltrim(std::string& str, const std::string& trimChars = " \n\r\t"); -std::string rtrim(std::string& str, const std::string& trimChars = " \n\r\t"); +std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); +std::string ltrim(std::string &str, const std::string &trimChars = " \n\r\t"); +std::string rtrim(std::string &str, const std::string &trimChars = " \n\r\t"); std::string cutString(const std::string str, int msgFont, const int width); std::string strftime(const char *format, const struct tm *tm); std::string strftime(const char *format, time_t when, bool gm = false);