From e729abb0e2020acce814a22ad34cdf2254a5ca35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Wed, 26 Jan 2022 15:45:23 +0100 Subject: BLI_string_ref: Add back missing rfind() Must have been removed in a bad merge or something. --- source/blender/blenlib/BLI_string_ref.hh | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source') diff --git a/source/blender/blenlib/BLI_string_ref.hh b/source/blender/blenlib/BLI_string_ref.hh index 3769e711a50..e3dd8afd588 100644 --- a/source/blender/blenlib/BLI_string_ref.hh +++ b/source/blender/blenlib/BLI_string_ref.hh @@ -337,6 +337,18 @@ constexpr int64_t StringRefBase::find(StringRef str, int64_t pos) const return index_or_npos_to_int64(std::string_view(*this).find(str, static_cast(pos))); } +constexpr int64_t StringRefBase::rfind(char c, int64_t pos) const +{ + BLI_assert(pos >= 0); + return index_or_npos_to_int64(std::string_view(*this).rfind(c, static_cast(pos))); +} + +constexpr int64_t StringRefBase::rfind(StringRef str, int64_t pos) const +{ + BLI_assert(pos >= 0); + return index_or_npos_to_int64(std::string_view(*this).rfind(str, static_cast(pos))); +} + constexpr int64_t StringRefBase::find_first_of(StringRef chars, int64_t pos) const { BLI_assert(pos >= 0); -- cgit v1.2.3