From cf630bfee60694f9bf1577972df169badda0b6e0 Mon Sep 17 00:00:00 2001 From: Gil Date: Wed, 21 Mar 2018 18:43:29 -0700 Subject: Port FSTLevelDBKey to C++ (#937) --- Firestore/core/src/firebase/firestore/util/string_util.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'Firestore/core/src/firebase/firestore/util') diff --git a/Firestore/core/src/firebase/firestore/util/string_util.h b/Firestore/core/src/firebase/firestore/util/string_util.h index 3de177d..96ba0b0 100644 --- a/Firestore/core/src/firebase/firestore/util/string_util.h +++ b/Firestore/core/src/firebase/firestore/util/string_util.h @@ -32,7 +32,7 @@ namespace firebase { namespace firestore { namespace util { -/* +/** * Returns the smallest lexicographically larger string of equal or smaller * length. Returns an empty string if there is no such successor (if the input * is empty or consists entirely of 0xff bytes). @@ -44,7 +44,7 @@ namespace util { */ std::string PrefixSuccessor(absl::string_view prefix); -/* +/** * Returns the immediate lexicographically-following string. This is useful to * turn an inclusive range into something that can be used with Bigtable's * SetLimitRow(): @@ -65,6 +65,11 @@ std::string PrefixSuccessor(absl::string_view prefix); */ std::string ImmediateSuccessor(absl::string_view s); +/** + * Returns true if the given value starts with the given prefix. + */ +bool StartsWith(const std::string &value, const std::string &prefix); + } // namespace util } // namespace firestore } // namespace firebase -- cgit v1.2.3