diff options
author | zxu <zxu@google.com> | 2018-03-16 15:42:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-16 15:42:05 -0400 |
commit | 4e7296b080b9c8cea13e5e5eeee65f4312fb5e8a (patch) | |
tree | 87f175b1e1ac74632fee2ff7c52ccb9b5bc78014 /Firestore/core/src/firebase/firestore/model | |
parent | 1395c8202b236188b9e4e1bfc2a3e00244179593 (diff) |
port `DocumentKey` to non-container types of `Model/*` (#930)
* 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
* add converter function between two DocumentKey implementations
* add unit test
* address changes
* fix lint
* using DocumentKey in model except for the container types `FSTDocumentDictionary`, `FSTDocumentKeySet`, and `FSTDocumentVersionDictionary`
* change other place w.r.t. the use of `DocumentKey` in model
* update parameter of test helpers from NSString to string_view
* revert a temporary change used in debug
* address changes
Diffstat (limited to 'Firestore/core/src/firebase/firestore/model')
-rw-r--r-- | Firestore/core/src/firebase/firestore/model/document_key.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Firestore/core/src/firebase/firestore/model/document_key.h b/Firestore/core/src/firebase/firestore/model/document_key.h index 8e590d8..134bda5 100644 --- a/Firestore/core/src/firebase/firestore/model/document_key.h +++ b/Firestore/core/src/firebase/firestore/model/document_key.h @@ -55,6 +55,10 @@ class DocumentKey { operator FSTDocumentKey*() const { return [FSTDocumentKey keyWithPath:path()]; } + + std::string ToString() const { + return path().CanonicalString(); + } #endif /** @@ -83,11 +87,6 @@ class DocumentKey { return path_ ? *path_ : Empty().path(); } -#if defined(__OBJC__) - // Helper function to convert to FSTDocumentKey during the C++ migration. - FSTDocumentKey* ToFSTDocumentKey() const; -#endif // defined(__OBJC__) - private: // This is an optimization to make passing DocumentKey around cheaper (it's // copied often). |