-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.54..v0.2.55 changeset StringUtils.cpp
Garret Voltz edited this page Aug 14, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/util/StringUtils.cpp b/hoot-core/src/main/cpp/hoot/core/util/StringUtils.cpp
index 59597e4..bf87365 100644
--- a/hoot-core/src/main/cpp/hoot/core/util/StringUtils.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/util/StringUtils.cpp
@@ -185,6 +185,30 @@ bool StringUtils::containsSubstring(const QStringList& input, const QString& sub
return input.filter(substring, Qt::CaseInsensitive).size() > 0;
}
+bool StringUtils::containsSubstrings(const QStringList& input, const QStringList& substrings)
+{
+ for (int i = 0; i < substrings.size(); i++)
+ {
+ if (input.filter(substrings.at(i), Qt::CaseInsensitive).size() > 0)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+int StringUtils::indexOfSubstring(const QStringList& input, const QString& substring)
+{
+ for (int i = 0; i < input.size(); i++)
+ {
+ if (input.at(i).contains(substring))
+ {
+ return i;
+ }
+ }
+ return -1;
+}
+
void StringUtils::removeAll(QStringList& input, const QStringList& toRemove)
{
for (int i = 0; i < toRemove.size(); i++)