aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/API/FIRFirestore.mm
diff options
context:
space:
mode:
authorGravatar zxu <zxu@google.com>2018-03-14 08:57:31 -0400
committerGravatar GitHub <noreply@github.com>2018-03-14 08:57:31 -0400
commit9e815620e9f7f43b42e03db4e5118d7ad03ddee7 (patch)
tree86f362bad99281325fca7ee3ae116b6a0f36d511 /Firestore/Source/API/FIRFirestore.mm
parentd4d73ea53ecdf1e8ade3d00921419645dd5d66f7 (diff)
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
Diffstat (limited to 'Firestore/Source/API/FIRFirestore.mm')
-rw-r--r--Firestore/Source/API/FIRFirestore.mm11
1 files changed, 6 insertions, 5 deletions
diff --git a/Firestore/Source/API/FIRFirestore.mm b/Firestore/Source/API/FIRFirestore.mm
index eff0605..f3769ed 100644
--- a/Firestore/Source/API/FIRFirestore.mm
+++ b/Firestore/Source/API/FIRFirestore.mm
@@ -34,7 +34,6 @@
#import "Firestore/Source/Core/FSTFirestoreClient.h"
#import "Firestore/Source/Model/FSTDocumentKey.h"
-#import "Firestore/Source/Model/FSTPath.h"
#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/Source/Util/FSTDispatchQueue.h"
#import "Firestore/Source/Util/FSTLogger.h"
@@ -44,6 +43,7 @@
#include "Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h"
#include "Firestore/core/src/firebase/firestore/core/database_info.h"
#include "Firestore/core/src/firebase/firestore/model/database_id.h"
+#include "Firestore/core/src/firebase/firestore/model/resource_path.h"
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
#include "absl/memory/memory.h"
@@ -52,6 +52,7 @@ using firebase::firestore::auth::CredentialsProvider;
using firebase::firestore::auth::FirebaseCredentialsProvider;
using firebase::firestore::core::DatabaseInfo;
using firebase::firestore::model::DatabaseId;
+using firebase::firestore::model::ResourcePath;
NS_ASSUME_NONNULL_BEGIN
@@ -141,9 +142,9 @@ extern "C" NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
}
if (!database) {
FSTThrowInvalidArgument(
- @"database identifier may not be nil. Use '%@' if you want the default "
+ @"database identifier may not be nil. Use '%s' if you want the default "
"database",
- util::WrapNSStringNoCopy(DatabaseId::kDefault));
+ DatabaseId::kDefault);
}
// Note: If the key format changes, please change the code that detects FIRApps being deleted
@@ -261,7 +262,7 @@ extern "C" NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
FSTThrowInvalidArgument(@"Collection path cannot be nil.");
}
[self ensureClientConfigured];
- FSTResourcePath *path = [FSTResourcePath pathWithString:collectionPath];
+ const ResourcePath path = ResourcePath::FromString(util::MakeStringView(collectionPath));
return [FIRCollectionReference referenceWithPath:path firestore:self];
}
@@ -270,7 +271,7 @@ extern "C" NSString *const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain";
FSTThrowInvalidArgument(@"Document path cannot be nil.");
}
[self ensureClientConfigured];
- FSTResourcePath *path = [FSTResourcePath pathWithString:documentPath];
+ const ResourcePath path = ResourcePath::FromString(util::MakeStringView(documentPath));
return [FIRDocumentReference referenceWithPath:path firestore:self];
}