From b395243d378c5193088d38fd6333dba490085585 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 27 Feb 2020 15:55:53 +0800 Subject: [PATCH] Garden all the private headers with description and null-ability annotation --- SDWebImage/Private/SDAsyncBlockOperation.h | 1 + SDWebImage/Private/SDDeviceHelper.h | 1 + SDWebImage/Private/SDDisplayLink.h | 5 ++--- SDWebImage/Private/SDFileAttributeHelper.h | 11 ++++++----- SDWebImage/Private/SDImageAssetManager.h | 4 ++-- SDWebImage/Private/SDImageCachesManagerOperation.h | 2 +- SDWebImage/Private/SDWeakProxy.h | 1 + 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/SDWebImage/Private/SDAsyncBlockOperation.h b/SDWebImage/Private/SDAsyncBlockOperation.h index ecc68be8..a3480deb 100644 --- a/SDWebImage/Private/SDAsyncBlockOperation.h +++ b/SDWebImage/Private/SDAsyncBlockOperation.h @@ -11,6 +11,7 @@ @class SDAsyncBlockOperation; typedef void (^SDAsyncBlock)(SDAsyncBlockOperation * __nonnull asyncOperation); +/// A async block operation, success after you call `completer` (not like `NSBlockOperation` which is for sync block, success on return) @interface SDAsyncBlockOperation : NSOperation - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block; diff --git a/SDWebImage/Private/SDDeviceHelper.h b/SDWebImage/Private/SDDeviceHelper.h index 740fb2e3..5d5676b1 100644 --- a/SDWebImage/Private/SDDeviceHelper.h +++ b/SDWebImage/Private/SDDeviceHelper.h @@ -9,6 +9,7 @@ #import #import "SDWebImageCompat.h" +/// Device information helper methods @interface SDDeviceHelper : NSObject + (NSUInteger)totalMemory; diff --git a/SDWebImage/Private/SDDisplayLink.h b/SDWebImage/Private/SDDisplayLink.h index 60d4e80e..3ee8c6fd 100644 --- a/SDWebImage/Private/SDDisplayLink.h +++ b/SDWebImage/Private/SDDisplayLink.h @@ -9,9 +9,8 @@ #import #import "SDWebImageCompat.h" -// Cross-platform display link wrapper. Do not retain the target -// Use `CADisplayLink` on iOS/tvOS, `CVDisplayLink` on macOS, `NSTimer` on watchOS - +/// Cross-platform display link wrapper. Do not retain the target +/// Use `CADisplayLink` on iOS/tvOS, `CVDisplayLink` on macOS, `NSTimer` on watchOS @interface SDDisplayLink : NSObject @property (readonly, nonatomic, weak, nullable) id target; diff --git a/SDWebImage/Private/SDFileAttributeHelper.h b/SDWebImage/Private/SDFileAttributeHelper.h index 1e66ded7..b5594e95 100644 --- a/SDWebImage/Private/SDFileAttributeHelper.h +++ b/SDWebImage/Private/SDFileAttributeHelper.h @@ -7,12 +7,13 @@ #import +/// File Extended Attribute (xattr) helper methods @interface SDFileAttributeHelper : NSObject -+ (NSArray*)extendedAttributeNamesAtPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; -+ (BOOL)hasExtendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; -+ (NSData*)extendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; -+ (BOOL)setExtendedAttribute:(NSString*)name value:(NSData*)value atPath:(NSString*)path traverseLink:(BOOL)follow overwrite:(BOOL)overwrite error:(NSError**)err; -+ (BOOL)removeExtendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err; ++ (nullable NSArray *)extendedAttributeNamesAtPath:(nonnull NSString*)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; ++ (BOOL)hasExtendedAttribute:(nonnull NSString *)name atPath:(nonnull NSString*)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; ++ (nullable NSData *)extendedAttribute:(nonnull NSString*)name atPath:(nonnull NSString*)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; ++ (BOOL)setExtendedAttribute:(nonnull NSString*)name value:(nonnull NSData *)value atPath:(nonnull NSString*)path traverseLink:(BOOL)follow overwrite:(BOOL)overwrite error:(NSError * _Nullable * _Nullable)err; ++ (BOOL)removeExtendedAttribute:(nonnull NSString*)name atPath:(nonnull NSString*)path traverseLink:(BOOL)follow error:(NSError * _Nullable * _Nullable)err; @end diff --git a/SDWebImage/Private/SDImageAssetManager.h b/SDWebImage/Private/SDImageAssetManager.h index 68184187..88dee489 100644 --- a/SDWebImage/Private/SDImageAssetManager.h +++ b/SDWebImage/Private/SDImageAssetManager.h @@ -9,8 +9,8 @@ #import #import "SDWebImageCompat.h" -// Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :) - +/// A Image-Asset manager to work like UIKit/AppKit's image cache behavior +/// Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :) @interface SDImageAssetManager : NSObject @property (nonatomic, strong, nonnull) NSMapTable *imageTable; diff --git a/SDWebImage/Private/SDImageCachesManagerOperation.h b/SDWebImage/Private/SDImageCachesManagerOperation.h index fddf78c1..0debe6ca 100644 --- a/SDWebImage/Private/SDImageCachesManagerOperation.h +++ b/SDWebImage/Private/SDImageCachesManagerOperation.h @@ -9,7 +9,7 @@ #import #import "SDWebImageCompat.h" -// This is used for operation management, but not for operation queue execute +/// This is used for operation management, but not for operation queue execute @interface SDImageCachesManagerOperation : NSOperation @property (nonatomic, assign, readonly) NSUInteger pendingCount; diff --git a/SDWebImage/Private/SDWeakProxy.h b/SDWebImage/Private/SDWeakProxy.h index 4fd16228..d92c682b 100644 --- a/SDWebImage/Private/SDWeakProxy.h +++ b/SDWebImage/Private/SDWeakProxy.h @@ -9,6 +9,7 @@ #import #import "SDWebImageCompat.h" +/// A weak proxy which forward all the message to the target @interface SDWeakProxy : NSProxy @property (nonatomic, weak, readonly, nullable) id target;