Skip to content

Commit 411a21c

Browse files
wilhuffCorrob
authored andcommitted
Don't use using statements in Objective-C headers ... (#2827)
use namespace aliases instead. This makes the Objective-C code much more like what it's going to end up being like when translated to C++: headers will include classes declared in a namespace relative to firebase::firestore so everything else will be named relative to firebase::firestore. Meanwhile the using statements in the headers were causing us to miss adding using statements in source files which was moving us away from where we wanted to be.
1 parent bbdf7f6 commit 411a21c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+391
-331
lines changed

Firestore/Example/Tests/API/FIRQuerySnapshotTests.mm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#include "Firestore/core/src/firebase/firestore/util/string_apple.h"
3636

3737
namespace util = firebase::firestore::util;
38+
using firebase::firestore::api::DocumentChange;
39+
using firebase::firestore::api::DocumentSnapshot;
40+
using firebase::firestore::api::Firestore;
41+
using firebase::firestore::api::SnapshotMetadata;
3842
using firebase::firestore::core::DocumentViewChange;
3943
using firebase::firestore::core::ViewSnapshot;
4044
using firebase::firestore::model::DocumentKeySet;

Firestore/Example/Tests/API/FSTAPIHelpers.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
namespace testutil = firebase::firestore::testutil;
4242
namespace util = firebase::firestore::util;
43+
using firebase::firestore::api::SnapshotMetadata;
4344
using firebase::firestore::core::DocumentViewChange;
4445
using firebase::firestore::core::ViewSnapshot;
4546
using firebase::firestore::model::DocumentKeySet;

Firestore/Example/Tests/Core/FSTEventManagerTests.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
using firebase::firestore::core::EventListener;
3939
using firebase::firestore::core::ListenOptions;
40+
using firebase::firestore::core::QueryListener;
4041
using firebase::firestore::core::ViewSnapshot;
4142
using firebase::firestore::model::DocumentKeySet;
4243
using firebase::firestore::model::DocumentSet;

Firestore/Example/Tests/Core/FSTQueryListenerTests.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
using firebase::firestore::core::DocumentViewChange;
4646
using firebase::firestore::core::EventListener;
4747
using firebase::firestore::core::ListenOptions;
48+
using firebase::firestore::core::QueryListener;
4849
using firebase::firestore::core::ViewSnapshot;
4950
using firebase::firestore::model::DocumentKeySet;
5051
using firebase::firestore::model::DocumentSet;

Firestore/Example/Tests/Integration/FSTDatastoreTests.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
using firebase::firestore::model::DatabaseId;
5656
using firebase::firestore::model::DocumentKey;
5757
using firebase::firestore::model::DocumentKeySet;
58+
using firebase::firestore::model::FieldValue;
5859
using firebase::firestore::model::Precondition;
5960
using firebase::firestore::model::OnlineState;
6061
using firebase::firestore::model::TargetId;

Firestore/Example/Tests/Model/FSTDocumentTests.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
namespace testutil = firebase::firestore::testutil;
2929
using firebase::firestore::model::DocumentKey;
30+
using firebase::firestore::model::FieldValue;
3031
using firebase::firestore::model::SnapshotVersion;
3132

3233
NS_ASSUME_NONNULL_BEGIN

Firestore/Example/Tests/Remote/FSTSerializerBetaTests.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
using firebase::firestore::model::DatabaseId;
6666
using firebase::firestore::model::FieldMask;
6767
using firebase::firestore::model::FieldTransform;
68+
using firebase::firestore::model::FieldValue;
6869
using firebase::firestore::model::Precondition;
6970
using firebase::firestore::model::SnapshotVersion;
7071
using firebase::firestore::remote::DocumentWatchChange;

Firestore/Example/Tests/SpecTests/FSTSyncEngineTestDriver.mm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
using firebase::firestore::auth::User;
6262
using firebase::firestore::core::DatabaseInfo;
6363
using firebase::firestore::core::ListenOptions;
64+
using firebase::firestore::core::QueryListener;
6465
using firebase::firestore::core::ViewSnapshot;
6566
using firebase::firestore::model::DatabaseId;
6667
using firebase::firestore::model::DocumentKey;

Firestore/Source/API/FIRCollectionReference+Internal.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818

1919
#include "Firestore/core/src/firebase/firestore/model/resource_path.h"
2020

21+
namespace model = firebase::firestore::model;
22+
2123
NS_ASSUME_NONNULL_BEGIN
2224

2325
/** Internal FIRCollectionReference API we don't want exposed in our public header files. */
2426
@interface FIRCollectionReference (Internal)
25-
+ (instancetype)referenceWithPath:(const firebase::firestore::model::ResourcePath &)path
27+
+ (instancetype)referenceWithPath:(const model::ResourcePath &)path
2628
firestore:(FIRFirestore *)firestore;
2729
@end
2830

Firestore/Source/API/FIRDocumentChange+Internal.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020

2121
#include "Firestore/core/src/firebase/firestore/api/document_change.h"
2222

23-
using firebase::firestore::api::DocumentChange;
23+
namespace api = firebase::firestore::api;
2424

2525
NS_ASSUME_NONNULL_BEGIN
2626

2727
@interface FIRDocumentChange (/* Init */)
2828

29-
- (instancetype)initWithDocumentChange:(DocumentChange &&)documentChange NS_DESIGNATED_INITIALIZER;
29+
- (instancetype)initWithDocumentChange:(api::DocumentChange &&)documentChange
30+
NS_DESIGNATED_INITIALIZER;
3031

3132
@end
3233

0 commit comments

Comments
 (0)