From 1c40e7aada6b32bbc621f06fb5f380149606a58d Mon Sep 17 00:00:00 2001 From: zxu Date: Mon, 5 Mar 2018 11:30:59 -0500 Subject: add converters and port paths to FSTQuery (#869) * add converters and fix FSTQuery.{h,m} only * address changes * a change forget to address * add a dummy function to make inline-only-library buildable --- Firestore/core/src/firebase/firestore/model/base_path.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Firestore/core/src/firebase/firestore/model') diff --git a/Firestore/core/src/firebase/firestore/model/base_path.h b/Firestore/core/src/firebase/firestore/model/base_path.h index accce27..73ac611 100644 --- a/Firestore/core/src/firebase/firestore/model/base_path.h +++ b/Firestore/core/src/firebase/firestore/model/base_path.h @@ -159,6 +159,19 @@ class BasePath { return segments_ >= rhs.segments_; } +#if defined(__OBJC__) + // For Objective-C++ hash; to be removed after migration. + // Do NOT use in C++ code. + uint64_t Hash() const { + std::hash hash_fn; + uint64_t hash_result = 0; + for (const std::string& segment : segments_) { + hash_result = hash_result * 31u + hash_fn(segment); + } + return hash_result; + } +#endif // defined(__OBJC__) + protected: BasePath() = default; template -- cgit v1.2.3