File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Firestore/core/src/firebase/firestore/util Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,11 @@ std::string ImmediateSuccessor(absl::string_view s) {
48
48
return out;
49
49
}
50
50
51
+ bool StartsWith (const std::string &value, const std::string &prefix) {
52
+ return prefix.size () <= value.size () &&
53
+ std::equal (prefix.begin (), prefix.end (), value.begin ());
54
+ }
55
+
51
56
} // namespace util
52
57
} // namespace firestore
53
58
} // namespace firebase
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ namespace firebase {
32
32
namespace firestore {
33
33
namespace util {
34
34
35
- /*
35
+ /* *
36
36
* Returns the smallest lexicographically larger string of equal or smaller
37
37
* length. Returns an empty string if there is no such successor (if the input
38
38
* is empty or consists entirely of 0xff bytes).
@@ -44,7 +44,7 @@ namespace util {
44
44
*/
45
45
std::string PrefixSuccessor (absl::string_view prefix);
46
46
47
- /*
47
+ /* *
48
48
* Returns the immediate lexicographically-following string. This is useful to
49
49
* turn an inclusive range into something that can be used with Bigtable's
50
50
* SetLimitRow():
@@ -65,6 +65,11 @@ std::string PrefixSuccessor(absl::string_view prefix);
65
65
*/
66
66
std::string ImmediateSuccessor (absl::string_view s);
67
67
68
+ /* *
69
+ * Returns true if the given value starts with the given prefix.
70
+ */
71
+ bool StartsWith (const std::string &value, const std::string &prefix);
72
+
68
73
} // namespace util
69
74
} // namespace firestore
70
75
} // namespace firebase
You can’t perform that action at this time.
0 commit comments