diff options
author | zxu <zxu@google.com> | 2018-03-14 08:57:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-14 08:57:31 -0400 |
commit | 9e815620e9f7f43b42e03db4e5118d7ad03ddee7 (patch) | |
tree | 86f362bad99281325fca7ee3ae116b6a0f36d511 /Firestore/Source/Local/FSTLevelDBKey.h | |
parent | d4d73ea53ecdf1e8ade3d00921419645dd5d66f7 (diff) |
grand PR to port the remaining paths (FieldPath and ResourcePath). (#865)
* naively remove FSTPath import and source/test files.
* port FieldPath, part I
* port FieldPath, part II
* port ResourcePath, part I
* port ResourcePath, part II
* the grand commit to fix build errors
* use testutil:: helper instead of those from FSTHelpers
* fix test and lint
* use c_str in errmsg directly
* fix
* fix
* make code clean
* fix integration test I missed
* fix to avoid naming collision in preprocessor
* address changes
* address changes
* address changes
* fix: fieldMask are actually shared with different context.
* address changes
* address changes
Diffstat (limited to 'Firestore/Source/Local/FSTLevelDBKey.h')
-rw-r--r-- | Firestore/Source/Local/FSTLevelDBKey.h | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/Firestore/Source/Local/FSTLevelDBKey.h b/Firestore/Source/Local/FSTLevelDBKey.h index f3f4bcf..c7a64ee 100644 --- a/Firestore/Source/Local/FSTLevelDBKey.h +++ b/Firestore/Source/Local/FSTLevelDBKey.h @@ -19,8 +19,9 @@ #import "Firestore/Source/Core/FSTTypes.h" #import "Firestore/Source/Local/StringView.h" +#include "Firestore/core/src/firebase/firestore/model/resource_path.h" + @class FSTDocumentKey; -@class FSTResourcePath; NS_ASSUME_NONNULL_BEGIN @@ -34,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN // document_mutations: // - tableName: string = "document_mutation" // - userID: string -// - path: FSTResourcePath +// - path: ResourcePath // - batchID: FSTBatchID // // mutation_queues: @@ -56,16 +57,16 @@ NS_ASSUME_NONNULL_BEGIN // target_documents: // - tableName: string = "target_document" // - targetID: FSTTargetID -// - path: FSTResourcePath +// - path: ResourcePath // // document_targets: // - tableName: string = "document_target" -// - path: FSTResourcePath +// - path: ResourcePath // - targetID: FSTTargetID // // remote_documents: // - tableName: string = "remote_document" -// - path: FSTResourcePath +// - path: ResourcePath /** Helpers for any LevelDB key. */ @interface FSTLevelDBKey : NSObject @@ -128,12 +129,12 @@ NS_ASSUME_NONNULL_BEGIN /** * Creates a key prefix that points just before the first key for the userID and resource path. * - * Note that this uses an FSTResourcePath rather than an FSTDocumentKey in order to allow prefix + * Note that this uses a ResourcePath rather than an FSTDocumentKey in order to allow prefix * scans over a collection. However a naive scan over those results isn't useful since it would * match both immediate children of the collection and any subcollections. */ + (std::string)keyPrefixWithUserID:(Firestore::StringView)userID - resourcePath:(FSTResourcePath *)resourcePath; + resourcePath:(const firebase::firestore::model::ResourcePath &)resourcePath; /** Creates a complete key that points to a specific userID, document key, and batchID. */ + (std::string)keyWithUserID:(Firestore::StringView)userID @@ -291,7 +292,8 @@ NS_ASSUME_NONNULL_BEGIN + (std::string)keyPrefix; /** Creates a key that points to the first document-target association for document. */ -+ (std::string)keyPrefixWithResourcePath:(FSTResourcePath *)resourcePath; ++ (std::string)keyPrefixWithResourcePath: + (const firebase::firestore::model::ResourcePath &)resourcePath; /** Creates a key that points to a specific document-target entry. */ + (std::string)keyWithDocumentKey:(FSTDocumentKey *)documentKey targetID:(FSTTargetID)targetID; @@ -328,7 +330,8 @@ NS_ASSUME_NONNULL_BEGIN * a document key prefix will match the document itself and any documents that exist in its * subcollections. */ -+ (std::string)keyPrefixWithResourcePath:(FSTResourcePath *)resourcePath; ++ (std::string)keyPrefixWithResourcePath: + (const firebase::firestore::model::ResourcePath &)resourcePath; /** * Decodes the contents of a remote document key into properties on this instance. This can only |