From 9e815620e9f7f43b42e03db4e5118d7ad03ddee7 Mon Sep 17 00:00:00 2001 From: zxu Date: Wed, 14 Mar 2018 08:57:31 -0400 Subject: grand PR to port the remaining paths (FieldPath and ResourcePath). (#865) * naively remove FSTPath import and source/test files. * port FieldPath, part I * port FieldPath, part II * port ResourcePath, part I * port ResourcePath, part II * the grand commit to fix build errors * use testutil:: helper instead of those from FSTHelpers * fix test and lint * use c_str in errmsg directly * fix * fix * make code clean * fix integration test I missed * fix to avoid naming collision in preprocessor * address changes * address changes * address changes * fix: fieldMask are actually shared with different context. * address changes * address changes --- Firestore/core/src/firebase/firestore/util/string_apple.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Firestore/core/src/firebase/firestore/util') diff --git a/Firestore/core/src/firebase/firestore/util/string_apple.h b/Firestore/core/src/firebase/firestore/util/string_apple.h index 3f6b814..73388be 100644 --- a/Firestore/core/src/firebase/firestore/util/string_apple.h +++ b/Firestore/core/src/firebase/firestore/util/string_apple.h @@ -22,6 +22,8 @@ #import +#include + #include "absl/strings/string_view.h" namespace firebase { @@ -57,6 +59,12 @@ inline absl::string_view MakeStringView(NSString* str) { [str UTF8String], [str lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); } +// Creates a std::string wrapper for the contents of the given NSString. +inline std::string MakeString(NSString* str) { + return std::string([str UTF8String], + [str lengthOfBytesUsingEncoding:NSUTF8StringEncoding]); +} + } // namespace util } // namespace firestore } // namespace firebase -- cgit v1.2.3