FIRStorageMetadata_Private.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 "FirebaseStorage/Sources/Public/FirebaseStorage/FIRStorageMetadata.h"
  17. #import "FirebaseStorage/Sources/FIRStorageConstants_Private.h"
  18. @class FIRIMPLStorageReference;
  19. NS_ASSUME_NONNULL_BEGIN
  20. @interface FIRIMPLStorageMetadata ()
  21. @property(readwrite, nonatomic) NSString *name;
  22. @property(readwrite, nonatomic) NSString *path;
  23. @property(readwrite, nonatomic) FIRIMPLStorageReference *reference;
  24. /**
  25. * The type of the object, either a "File" or a "Folder".
  26. */
  27. @property(readwrite) FIRStorageMetadataType type;
  28. /**
  29. * The original metadata representation received from the server or an empty dictionary
  30. * if the metadata object was initialized by the user.
  31. */
  32. @property(copy, nonatomic) NSDictionary *initialMetadata;
  33. /**
  34. * Recursively removes entries in 'metadata' that are unmodified from 'oldMetadata'.
  35. * Adds 'NSNull' for entries that only exist in oldMetadata.
  36. */
  37. + (void)removeMatchingMetadata:(NSMutableDictionary *)metadata
  38. oldMetadata:(NSDictionary *)oldMetadata;
  39. /**
  40. * Computes the updates between the state at initialization and the current state.
  41. * Returns a dictionary with only the updated data. Removed keys are set to NSNull.
  42. */
  43. - (NSDictionary *)updatedMetadata;
  44. /**
  45. * Returns an RFC3339 formatted date from a string.
  46. * @param dateString An NSString of the form: yyyy-MM-ddTHH:mm:ss.SSSZ.
  47. * @return An NSDate populated from the string or nil if conversion isn't possible.
  48. */
  49. - (nullable NSDate *)dateFromRFC3339String:(NSString *)dateString;
  50. /**
  51. * Returns an RFC3339 formatted string from an NSDate object.
  52. * @param date The NSDate object to be converted to a string.
  53. * @return An NSString of the form: yyyy-MM-ddTHH:mm:ss.SSSZ or nil if conversion isn't possible.
  54. */
  55. - (nullable NSString *)RFC3339StringFromDate:(NSDate *)date;
  56. @end
  57. NS_ASSUME_NONNULL_END