mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-10 22:45:59 +05:45
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.
89 lines
3.0 KiB
Objective-C
89 lines
3.0 KiB
Objective-C
/*
|
|
* Copyright 2017 Google
|
|
*
|
|
* 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>
|
|
|
|
#include <vector>
|
|
|
|
#include "Firestore/core/src/firebase/firestore/core/user_data.h"
|
|
#include "Firestore/core/src/firebase/firestore/model/database_id.h"
|
|
#include "Firestore/core/src/firebase/firestore/model/document_key.h"
|
|
#include "Firestore/core/src/firebase/firestore/model/field_mask.h"
|
|
#include "Firestore/core/src/firebase/firestore/model/field_transform.h"
|
|
#include "Firestore/core/src/firebase/firestore/model/precondition.h"
|
|
|
|
@class FSTObjectValue;
|
|
@class FSTFieldValue;
|
|
@class FSTMutation;
|
|
|
|
namespace core = firebase::firestore::core;
|
|
namespace model = firebase::firestore::model;
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
/**
|
|
* An internal representation of FIRDocumentReference, representing a key in a specific database.
|
|
* This is necessary because keys assume a database from context (usually the current one).
|
|
* FSTDocumentKeyReference binds a key to a specific databaseID.
|
|
*
|
|
* TODO(b/64160088): Make DocumentKey aware of the specific databaseID it is tied to.
|
|
*/
|
|
@interface FSTDocumentKeyReference : NSObject
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
|
|
- (instancetype)initWithKey:(model::DocumentKey)key
|
|
databaseID:(const model::DatabaseId *)databaseID NS_DESIGNATED_INITIALIZER;
|
|
|
|
- (const model::DocumentKey &)key;
|
|
|
|
// Does not own the DatabaseId instance.
|
|
@property(nonatomic, assign, readonly) const model::DatabaseId *databaseID;
|
|
|
|
@end
|
|
|
|
/**
|
|
* An interface that allows arbitrary pre-converting of user data.
|
|
*
|
|
* Returns the converted value (can return back the input to act as a no-op).
|
|
*/
|
|
typedef id _Nullable (^FSTPreConverterBlock)(id _Nullable);
|
|
|
|
/**
|
|
* Helper for parsing raw user input (provided via the API) into internal model classes.
|
|
*/
|
|
@interface FSTUserDataConverter : NSObject
|
|
|
|
- (instancetype)init NS_UNAVAILABLE;
|
|
- (instancetype)initWithDatabaseID:(const model::DatabaseId *)databaseID
|
|
preConverter:(FSTPreConverterBlock)preConverter NS_DESIGNATED_INITIALIZER;
|
|
|
|
/** Parse document data from a non-merge setData call.*/
|
|
- (core::ParsedSetData)parsedSetData:(id)input;
|
|
|
|
/** Parse document data from a setData call with `merge:YES`. */
|
|
- (core::ParsedSetData)parsedMergeData:(id)input fieldMask:(nullable NSArray<id> *)fieldMask;
|
|
|
|
/** Parse update data from an updateData call. */
|
|
- (core::ParsedUpdateData)parsedUpdateData:(id)input;
|
|
|
|
/** Parse a "query value" (e.g. value in a where filter or a value in a cursor bound). */
|
|
- (FSTFieldValue *)parsedQueryValue:(id)input;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|