Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-01-26 17:45:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-01-26 20:10:59 +0300
commite729abb0e2020acce814a22ad34cdf2254a5ca35 (patch)
treede5f2cc6e61d029e76bdf42caba6c29e01ae1d94
parent74afc86d4bf1a559e5b7a0cf5cea29cb508a3e99 (diff)
BLI_string_ref: Add back missing rfind()
Must have been removed in a bad merge or something.
-rw-r--r--source/blender/blenlib/BLI_string_ref.hh12
1 files changed, 12 insertions, 0 deletions
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<size_t>(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<size_t>(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<size_t>(pos)));
+}
+
constexpr int64_t StringRefBase::find_first_of(StringRef chars, int64_t pos) const
{
BLI_assert(pos >= 0);