diff options
Diffstat (limited to 'include/o3tl')
-rw-r--r-- | include/o3tl/string_view.hxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/o3tl/string_view.hxx b/include/o3tl/string_view.hxx index 026dc5e167ae..cea4f272b947 100644 --- a/include/o3tl/string_view.hxx +++ b/include/o3tl/string_view.hxx @@ -27,6 +27,13 @@ inline bool equalsAscii(std::u16string_view s1, const char* s2) return rtl_ustr_ascii_compare_WithLength(s1.data(), s1.size(), s2) == 0; } +// Like OUString::equalsAsciiL +inline bool equalsAscii(std::u16string_view s1, std::string_view s2) +{ + return rtl_ustr_ascii_shortenedCompare_WithLength(s1.data(), s1.size(), s2.data(), s2.size()) + == 0; +} + // Like OUString::equalsIgnoreAsciiCase, but for two std::u16string_view: inline bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2) { |