-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
249 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
FirebaseFirestoreInternal/FirebaseFirestore/FIRSnapshotListenOptions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#import <FirebaseFirestoreInternal/FIRSnapshotListenOptions.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import "FIRSnapshotListenOptions.h" | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
#include <cstdint> | ||
#include <string> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@implementation FIRSnapshotListenOptions | ||
|
||
// private method | ||
- (instancetype)initPrivateWithSource:(FIRListenSource)source | ||
includeMetadataChanges:(BOOL)includeMetadataChanges { | ||
self = [self initWithDefaultOptions]; | ||
if (self) { | ||
_source = source; | ||
_includeMetadataChanges = includeMetadataChanges; | ||
} | ||
return self; | ||
} | ||
|
||
- (instancetype)initWithDefaultOptions { | ||
self = [super init]; | ||
if (self) { | ||
_source = FIRListenSourceDefault; | ||
_includeMetadataChanges = NO; | ||
} | ||
return self; | ||
} | ||
|
||
- (FIRSnapshotListenOptions *)withIncludeMetadataChanges:(BOOL)includeMetadataChanges { | ||
FIRSnapshotListenOptions *newOptions = | ||
[[FIRSnapshotListenOptions alloc] initPrivateWithSource:self.source | ||
includeMetadataChanges:includeMetadataChanges]; | ||
return newOptions; | ||
} | ||
|
||
- (FIRSnapshotListenOptions *)withSource:(FIRListenSource)source { | ||
FIRSnapshotListenOptions *newOptions = | ||
[[FIRSnapshotListenOptions alloc] initPrivateWithSource:source | ||
includeMetadataChanges:self.includeMetadataChanges]; | ||
return newOptions; | ||
} | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
Firestore/Source/Public/FirebaseFirestore/FIRSnapshotListenOptions.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2023 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
typedef NS_ENUM(NSUInteger, FIRListenSource) { | ||
FIRListenSourceDefault, | ||
FIRListenSourceCache | ||
} NS_SWIFT_NAME(ListenSource); | ||
|
||
NS_SWIFT_NAME(SnapshotListenOptions) | ||
@interface FIRSnapshotListenOptions : NSObject | ||
|
||
@property(nonatomic, readonly) FIRListenSource source; | ||
@property(nonatomic, readonly) BOOL includeMetadataChanges; | ||
|
||
- (instancetype)init NS_UNAVAILABLE; | ||
- (instancetype)initWithDefaultOptions NS_DESIGNATED_INITIALIZER; | ||
|
||
- (FIRSnapshotListenOptions *)withIncludeMetadataChanges:(BOOL)includeMetadataChanges; | ||
- (FIRSnapshotListenOptions *)withSource:(FIRListenSource)source; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters