aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Local/FSTDocumentReference.mm
diff options
context:
space:
mode:
Diffstat (limited to 'Firestore/Source/Local/FSTDocumentReference.mm')
-rw-r--r--Firestore/Source/Local/FSTDocumentReference.mm21
1 files changed, 15 insertions, 6 deletions
diff --git a/Firestore/Source/Local/FSTDocumentReference.mm b/Firestore/Source/Local/FSTDocumentReference.mm
index 4310baa..3e755bc 100644
--- a/Firestore/Source/Local/FSTDocumentReference.mm
+++ b/Firestore/Source/Local/FSTDocumentReference.mm
@@ -16,20 +16,24 @@
#import "Firestore/Source/Local/FSTDocumentReference.h"
-#include "Firestore/core/src/firebase/firestore/util/comparison.h"
+#include <utility>
-#import "Firestore/Source/Model/FSTDocumentKey.h"
+#include "Firestore/core/src/firebase/firestore/model/document_key.h"
+#include "Firestore/core/src/firebase/firestore/util/comparison.h"
+using firebase::firestore::model::DocumentKey;
using firebase::firestore::util::WrapCompare;
NS_ASSUME_NONNULL_BEGIN
-@implementation FSTDocumentReference
+@implementation FSTDocumentReference {
+ DocumentKey _key;
+}
-- (instancetype)initWithKey:(FSTDocumentKey *)key ID:(int32_t)ID {
+- (instancetype)initWithKey:(DocumentKey)key ID:(int32_t)ID {
self = [super init];
if (self) {
- _key = key;
+ _key = std::move(key);
_ID = ID;
}
return self;
@@ -51,7 +55,8 @@ NS_ASSUME_NONNULL_BEGIN
}
- (NSString *)description {
- return [NSString stringWithFormat:@"<FSTDocumentReference: key=%@, ID=%d>", self.key, self.ID];
+ return [NSString stringWithFormat:@"<FSTDocumentReference: key=%s, ID=%d>",
+ self.key.ToString().c_str(), self.ID];
}
- (id)copyWithZone:(nullable NSZone *)zone {
@@ -59,6 +64,10 @@ NS_ASSUME_NONNULL_BEGIN
return self;
}
+- (const firebase::firestore::model::DocumentKey &)key {
+ return _key;
+}
+
@end
#pragma mark Comparators