summaryrefslogtreecommitdiff
path: root/src/stringutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/stringutils.cpp')
-rw-r--r--src/stringutils.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/stringutils.cpp b/src/stringutils.cpp
index 05e6a01..d750165 100644
--- a/src/stringutils.cpp
+++ b/src/stringutils.cpp
@@ -631,6 +631,16 @@ bool strStartWith(const std::string &restrict str1,
return str1.substr(0, sz2) == str2;
}
+bool strEndWith(const std::string &restrict str1,
+ const std::string &restrict str2)
+{
+ const size_t sz1 = str1.size();
+ const size_t sz2 = str2.size();
+ if (sz1 < sz2)
+ return false;
+ return str1.substr(sz1 - sz2, sz2) == str2;
+}
+
std::string getDateString()
{
char buffer[80];