FSnapshotUtilities.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #import "FNode.h"
  18. @class FImmutableSortedDictionary;
  19. @class FCompoundWrite;
  20. @class FLeafNode;
  21. @protocol FNode;
  22. typedef NS_ENUM(NSInteger, FDataHashVersion) {
  23. FDataHashVersionV1,
  24. FDataHashVersionV2,
  25. };
  26. @interface FSnapshotUtilities : NSObject
  27. + (id<FNode>) nodeFrom:(id)val;
  28. + (id<FNode>) nodeFrom:(id)val priority:(id)priority;
  29. + (id<FNode>) nodeFrom:(id)val withValidationFrom:(NSString *)fn;
  30. + (id<FNode>) nodeFrom:(id)val priority:(id)priority withValidationFrom:(NSString *)fn;
  31. + (FCompoundWrite *) compoundWriteFromDictionary:(NSDictionary *)values withValidationFrom:(NSString *)fn;
  32. + (void) validatePriorityNode:(id<FNode>)priorityNode;
  33. + (void)appendHashRepresentationForLeafNode:(FLeafNode *)val
  34. toString:(NSMutableString *)string
  35. hashVersion:(FDataHashVersion)hashVersion;
  36. + (void)appendHashV2RepresentationForString:(NSString *)string toString:(NSMutableString *)mutableString;
  37. + (NSUInteger)estimateSerializedNodeSize:(id<FNode>)node;
  38. @end