summaryrefslogtreecommitdiff
path: root/include/o3tl
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-01 12:07:47 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-03-01 21:32:11 +0100
commitb871d057c45fdd231aa5e1d2b94e7d0a039f4292 (patch)
tree31ed7faa9558a171c6bcf0c2ed5a60a6fd5240ca /include/o3tl
parent2960d4128710afd3e0c090960d281e69b44e69eb (diff)
use OUStringBuffer for a string that's modified often (tdf#145862)
SvParser::aToken was OUString despite being a buffer where the parsed result is collected. Change-Id: Id24c842738ea0f6f1836f77d855069963ac5ae55 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130763 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include/o3tl')
-rw-r--r--include/o3tl/string_view.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx
index 74f15bf33b54..848143f189ed 100644
--- a/include/o3tl/string_view.hxx
+++ b/include/o3tl/string_view.hxx
@@ -31,6 +31,12 @@ inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2
== 0;
};
+// Like OUString::compareToIgnoreAsciiCase, but for two std::u16string_view:
+inline int compareToIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
+{
+ return rtl_ustr_compareIgnoreAsciiCase_WithLength(s1.data(), s1.size(), s2.data(), s2.size());
+};
+
// Similar to OString::getToken, returning the first token of a std::string_view, starting at a
// given position (and if needed, it can be turned into a template to also cover std::u16string_view
// etc., or extended to return the n'th token instead of just the first, or support an initial