FBRuntimeUtils.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * Copyright (c) 2015-present, Facebook, Inc.
  3. * All rights reserved.
  4. *
  5. * This source code is licensed under the BSD-style license found in the
  6. * LICENSE file in the root directory of this source tree. An additional grant
  7. * of patent rights can be found in the PATENTS file in the same directory.
  8. */
  9. #import <Foundation/Foundation.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. /**
  12. Returns array of classes that conforms to given protocol
  13. */
  14. NSArray<Class> *FBClassesThatConformsToProtocol(Protocol *protocol);
  15. /**
  16. Method used to retrieve pointer for given symbol 'name' from given 'binary'
  17. @param binary path to binary we want to retrieve symbols pointer from
  18. @param name name of the symbol
  19. @return pointer to symbol
  20. */
  21. void *FBRetrieveSymbolFromBinary(const char *binary, const char *name);
  22. /**
  23. Get the compiler SDK version as string.
  24. @return SDK version as string, for example "10.0" or nil if it cannot be received
  25. */
  26. NSString * _Nullable FBSDKVersion(void);
  27. /**
  28. Check if the compiler SDK version is less than the given version.
  29. The current iOS version is taken instead if SDK version cannot be retrieved.
  30. @param expected the expected version to compare with, for example '10.3'
  31. @return YES if the given version is less than the SDK version used for WDA compilation
  32. */
  33. BOOL isSDKVersionLessThan(NSString *expected);
  34. /**
  35. Check if the compiler SDK version is less or equal to the given version.
  36. The current iOS version is taken instead if SDK version cannot be retrieved.
  37. @param expected the expected version to compare with, for example '10.3'
  38. @return YES if the given version is less or equal to the SDK version used for WDA compilation
  39. */
  40. BOOL isSDKVersionLessThanOrEqualTo(NSString *expected);
  41. /**
  42. Check if the compiler SDK version is equal to the given version.
  43. The current iOS version is taken instead if SDK version cannot be retrieved.
  44. @param expected the expected version to compare with, for example '10.3'
  45. @return YES if the given version is equal to the SDK version used for WDA compilation
  46. */
  47. BOOL isSDKVersionEqualTo(NSString *expected);
  48. /**
  49. Check if the compiler SDK version is greater or equal to the given version.
  50. The current iOS version is taken instead if SDK version cannot be retrieved.
  51. @param expected the expected version to compare with, for example '10.3'
  52. @return YES if the given version is greater or equal to the SDK version used for WDA compilation
  53. */
  54. BOOL isSDKVersionGreaterThanOrEqualTo(NSString *expected);
  55. /**
  56. Check if the compiler SDK version is greater than the given version.
  57. The current iOS version is taken instead if SDK version cannot be retrieved.
  58. @param expected the expected version to compare with, for example '10.3'
  59. @return YES if the given version is greater than the SDK version used for WDA compilation
  60. */
  61. BOOL isSDKVersionGreaterThan(NSString *expected);
  62. NS_ASSUME_NONNULL_END