Skip to content

Commit 9d9b7c2

Browse files
committed
refactor part of code
1 parent e880583 commit 9d9b7c2

39 files changed

+98
-256
lines changed

FirebaseFirestoreInternal.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
3030
# framework.
3131
s.public_header_files = [
3232
'Firestore/Source/Public/FirebaseFirestore/*.h',
33-
'Firestore/core/swift/include/*.h'
33+
'Firestore/core/interfaceForSwift/api/*.h'
3434
]
3535

3636
# source_files contains most of the header and source files for the project.
@@ -55,7 +55,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
5555
'Firestore/core/include/**/*.{cc,mm}',
5656
'Firestore/core/src/**/*.{cc,mm}',
5757
'FirebaseAuth/Interop/**/*.h',
58-
'Firestore/core/swift/**/*.{cc,h}',
58+
'Firestore/core/interfaceForSwift/**/*.{cc,h}',
5959
]
6060

6161
# Internal headers that aren't necessarily globally unique. Most C++ internal

Firestore/Example/Firestore.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,8 +2184,8 @@
21842184
files = (
21852185
6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */,
21862186
6003F58E195388D20070C39A /* Foundation.framework in Frameworks */,
2187-
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
21882187
DFA186FE5BBFB484C2A60439 /* Pods_Firestore_Example_iOS.framework in Frameworks */,
2188+
6003F592195388D20070C39A /* UIKit.framework in Frameworks */,
21892189
);
21902190
runOnlyForDeploymentPostprocessing = 0;
21912191
};
@@ -2194,9 +2194,9 @@
21942194
buildActionMask = 2147483647;
21952195
files = (
21962196
6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */,
2197+
45CA70C602DD3DDAEF05DCAA /* Pods_Firestore_Tests_iOS.framework in Frameworks */,
21972198
6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */,
21982199
6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */,
2199-
45CA70C602DD3DDAEF05DCAA /* Pods_Firestore_Tests_iOS.framework in Frameworks */,
22002200
);
22012201
runOnlyForDeploymentPostprocessing = 0;
22022202
};
@@ -2205,9 +2205,9 @@
22052205
buildActionMask = 2147483647;
22062206
files = (
22072207
6EDD3B4620BF247500C33877 /* Foundation.framework in Frameworks */,
2208+
0E24350AA378A5A8D9927B9D /* Pods_Firestore_FuzzTests_iOS.framework in Frameworks */,
22082209
6EDD3B4820BF247500C33877 /* UIKit.framework in Frameworks */,
22092210
6EDD3B4920BF247500C33877 /* XCTest.framework in Frameworks */,
2210-
0E24350AA378A5A8D9927B9D /* Pods_Firestore_FuzzTests_iOS.framework in Frameworks */,
22112211
);
22122212
runOnlyForDeploymentPostprocessing = 0;
22132213
};
@@ -2224,9 +2224,9 @@
22242224
buildActionMask = 2147483647;
22252225
files = (
22262226
DE03B2D61F2149D600A30B9C /* Foundation.framework in Frameworks */,
2227+
8F59A2CC5A9E99BB2DEA7F91 /* Pods_Firestore_IntegrationTests_iOS.framework in Frameworks */,
22272228
DE03B2D51F2149D600A30B9C /* UIKit.framework in Frameworks */,
22282229
DE03B2D41F2149D600A30B9C /* XCTest.framework in Frameworks */,
2229-
8F59A2CC5A9E99BB2DEA7F91 /* Pods_Firestore_IntegrationTests_iOS.framework in Frameworks */,
22302230
);
22312231
runOnlyForDeploymentPostprocessing = 0;
22322232
};
@@ -2623,8 +2623,6 @@
26232623
children = (
26242624
6003F58F195388D20070C39A /* CoreGraphics.framework */,
26252625
6003F58D195388D20070C39A /* Foundation.framework */,
2626-
6003F591195388D20070C39A /* UIKit.framework */,
2627-
6003F5AF195388D20070C39A /* XCTest.framework */,
26282626
8F598CD89DBDF6EE959C7F82 /* Pods_Firestore_Benchmarks_iOS.framework */,
26292627
27A5406BD14580197A127B93 /* Pods_Firestore_Example_iOS.framework */,
26302628
75532670EC61672D0CF0D743 /* Pods_Firestore_Example_macOS.framework */,
@@ -2636,6 +2634,8 @@
26362634
BAAC6F56A47F795224077898 /* Pods_Firestore_Tests_iOS.framework */,
26372635
11DF548295F98F22C70127D8 /* Pods_Firestore_Tests_macOS.framework */,
26382636
46E38E88A7A020F4E721E373 /* Pods_Firestore_Tests_tvOS.framework */,
2637+
6003F591195388D20070C39A /* UIKit.framework */,
2638+
6003F5AF195388D20070C39A /* XCTest.framework */,
26392639
);
26402640
name = Frameworks;
26412641
sourceTree = "<group>";

Firestore/Example/Tests/API/FIRAggregateQueryUnitTests.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ @interface FIRAggregateQueryUnitTests : XCTestCase
4040
@implementation FIRAggregateQueryUnitTests
4141

4242
- (void)testEquals {
43-
std::shared_ptr<api::Firestore> firestore = FSTTestFirestore().wrapped;
43+
std::shared_ptr<api::Firestore> firestore = FSTTestFirestore().cppFirestorePtr;
4444
FIRAggregateQuery *queryFoo =
4545
[[FIRQuery alloc] initWithQuery:Query("foo") firestore:firestore].count;
4646
FIRAggregateQuery *queryFooDup =

Firestore/Example/Tests/API/FIRQuerySnapshotTests.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ - (void)testIncludeMetadataChanges {
9999
DocumentViewChange(doc2New, DocumentViewChange::Type::Modified),
100100
};
101101

102-
std::shared_ptr<Firestore> firestore = FSTTestFirestore().wrapped;
102+
std::shared_ptr<Firestore> firestore = FSTTestFirestore().cppFirestorePtr;
103103
core::Query query = Query("foo");
104104
ViewSnapshot viewSnapshot(query, newDocuments, oldDocuments, std::move(documentChanges),
105105
/*mutated_keys=*/DocumentKeySet(),

Firestore/Example/Tests/API/FIRQueryUnitTests.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ @interface FIRQueryUnitTests : XCTestCase
3838
@implementation FIRQueryUnitTests
3939

4040
- (void)testEquals {
41-
std::shared_ptr<api::Firestore> firestore = FSTTestFirestore().wrapped;
41+
std::shared_ptr<api::Firestore> firestore = FSTTestFirestore().cppFirestorePtr;
4242
FIRQuery *queryFoo = [[FIRQuery alloc] initWithQuery:Query("foo") firestore:firestore];
4343
FIRQuery *queryFooDup = [[FIRQuery alloc] initWithQuery:Query("foo") firestore:firestore];
4444
FIRQuery *queryBar = [[FIRQuery alloc] initWithQuery:Query("bar") firestore:firestore];
@@ -58,7 +58,7 @@ - (void)testEquals {
5858
}
5959

6060
- (void)testFilteringWithPredicate {
61-
std::shared_ptr<api::Firestore> firestore = FSTTestFirestore().wrapped;
61+
std::shared_ptr<api::Firestore> firestore = FSTTestFirestore().cppFirestorePtr;
6262
FIRQuery *query = [[FIRQuery alloc] initWithQuery:Query("foo") firestore:firestore];
6363
FIRQuery *query1 = [query queryWhereField:@"f" isLessThanOrEqualTo:@1];
6464
FIRQuery *query2 = [query queryFilteredUsingPredicate:[NSPredicate predicateWithFormat:@"f<=1"]];

Firestore/Example/Tests/API/FSTAPIHelpers.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,12 @@
103103

104104
FIRCollectionReference *FSTTestCollectionRef(const char *path) {
105105
return [[FIRCollectionReference alloc] initWithPath:Resource(path)
106-
firestore:FSTTestFirestore().wrapped];
106+
firestore:FSTTestFirestore().cppFirestorePtr];
107107
}
108108

109109
FIRDocumentReference *FSTTestDocRef(const char *path) {
110110
return [[FIRDocumentReference alloc] initWithPath:Resource(path)
111-
firestore:FSTTestFirestore().wrapped];
111+
firestore:FSTTestFirestore().cppFirestorePtr];
112112
}
113113

114114
/** A convenience method for creating a query snapshots for tests. */
@@ -157,7 +157,7 @@
157157
/*sync_state_changed=*/true,
158158
/*excludes_metadata_changes=*/false,
159159
static_cast<bool>(hasCachedResults)};
160-
return [[FIRQuerySnapshot alloc] initWithFirestore:FSTTestFirestore().wrapped
160+
return [[FIRQuerySnapshot alloc] initWithFirestore:FSTTestFirestore().cppFirestorePtr
161161
originalQuery:Query(path)
162162
snapshot:std::move(viewSnapshot)
163163
metadata:std::move(metadata)];

Firestore/Example/Tests/Integration/API/FIRDatabaseTests.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1523,7 +1523,7 @@ - (void)testAppDeleteLeadsToFirestoreTermination {
15231523

15241524
[self deleteApp:app];
15251525

1526-
XCTAssertTrue(firestore.wrapped->client()->is_terminated());
1526+
XCTAssertTrue(firestore.cppFirestorePtr->client()->is_terminated());
15271527
}
15281528

15291529
// Ensures b/172958106 doesn't regress.

Firestore/Source/API/FIRAggregateQuerySnapshot.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ - (id)valueForAggregateField:(FIRAggregateField *)aggregateField {
9292
[aggregateField name], path);
9393
}
9494
FSTUserDataWriter *dataWriter =
95-
[[FSTUserDataWriter alloc] initWithFirestore:_query.query.firestore.wrapped
95+
[[FSTUserDataWriter alloc] initWithFirestore:_query.query.firestore.cppFirestorePtr
9696
serverTimestampBehavior:serverTimestampBehavior];
9797
return [dataWriter convertedValue:*fieldValue];
9898
}

Firestore/Source/API/FIRDocumentSnapshot.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ - (instancetype)initWithFirestore:(FIRFirestore *)firestore
8787
DocumentSnapshot wrapped;
8888
if (document.has_value()) {
8989
wrapped =
90-
DocumentSnapshot::FromDocument(firestore.wrapped, document.value(), std::move(metadata));
90+
DocumentSnapshot::FromDocument(firestore.cppFirestorePtr, document.value(), std::move(metadata));
9191
} else {
92-
wrapped = DocumentSnapshot::FromNoDocument(firestore.wrapped, std::move(documentKey),
92+
wrapped = DocumentSnapshot::FromNoDocument(firestore.cppFirestorePtr, std::move(documentKey),
9393
std::move(metadata));
9494
}
9595
_serializer.reset(new Serializer(firestore.databaseID));

Firestore/Source/API/FIRFirestore.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ - (void)getQueryNamed:(NSString *)name completion:(void (^)(FIRQuery *_Nullable
531531

532532
@implementation FIRFirestore (Internal)
533533

534-
- (std::shared_ptr<Firestore>)wrapped {
534+
- (std::shared_ptr<Firestore>)cppFirestorePtr {
535535
return _firestore;
536536
}
537537

0 commit comments

Comments
 (0)