FSTDocumentKey.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright 2017 Google
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <Foundation/Foundation.h>
  17. #include <initializer_list>
  18. #include <string>
  19. #include "Firestore/core/src/firebase/firestore/model/resource_path.h"
  20. // Using forward declaration to avoid circular dependency (`document_key.h` includes this header).`
  21. namespace firebase {
  22. namespace firestore {
  23. namespace model {
  24. class DocumentKey;
  25. }
  26. }
  27. }
  28. NS_ASSUME_NONNULL_BEGIN
  29. /**
  30. * `FSTDocumentKey` is a thin wrapper over `DocumentKey`, necessary until full migration is
  31. * possible. Use the underlying `DocumentKey` for any operations.
  32. */
  33. @interface FSTDocumentKey : NSObject <NSCopying>
  34. + (instancetype)keyWithDocumentKey:(const firebase::firestore::model::DocumentKey &)documentKey;
  35. /** Gets the underlying C++ representation. */
  36. - (const firebase::firestore::model::DocumentKey &)key;
  37. @end
  38. /** The field path string that represents the document's key. */
  39. extern NSString *const kDocumentKeyPath;
  40. NS_ASSUME_NONNULL_END