[Bf-blender-cvs] [519b2f937f3] master: BLI: add index_range method for StringRef

Jacques Lucke noreply at git.blender.org
Thu Sep 3 16:27:11 CEST 2020


Commit: 519b2f937f3281031d8970cbfc0d26c3acf308a5
Author: Jacques Lucke
Date:   Thu Sep 3 16:13:34 2020 +0200
Branches: master
https://developer.blender.org/rB519b2f937f3281031d8970cbfc0d26c3acf308a5

BLI: add index_range method for StringRef

===================================================================

M	source/blender/blenlib/BLI_string_ref.hh

===================================================================

diff --git a/source/blender/blenlib/BLI_string_ref.hh b/source/blender/blenlib/BLI_string_ref.hh
index e30eccca891..be18848fbf4 100644
--- a/source/blender/blenlib/BLI_string_ref.hh
+++ b/source/blender/blenlib/BLI_string_ref.hh
@@ -122,6 +122,11 @@ class StringRefBase {
     return data_ + size_;
   }
 
+  IndexRange index_range() const
+  {
+    return IndexRange(size_);
+  }
+
   /**
    * Copy the string into a buffer. The buffer has to be one byte larger than the size of the
    * string, because the copied string will be null-terminated. Only use this when you are



More information about the Bf-blender-cvs mailing list