From 8f9174a952caa3b17e8a4fd1b0621bdd7fb4b253 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 11 Mar 2020 12:19:10 +0800 Subject: [PATCH] Coding Style fix --- SDWebImage/Private/SDFileAttributeHelper.h | 10 +++++----- SDWebImage/Private/SDFileAttributeHelper.m | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/SDWebImage/Private/SDFileAttributeHelper.h b/SDWebImage/Private/SDFileAttributeHelper.h index b5594e95..3ce6bade 100644 --- a/SDWebImage/Private/SDFileAttributeHelper.h +++ b/SDWebImage/Private/SDFileAttributeHelper.h @@ -10,10 +10,10 @@ /// File Extended Attribute (xattr) helper methods @interface SDFileAttributeHelper : NSObject -+ (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; ++ (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/SDFileAttributeHelper.m b/SDWebImage/Private/SDFileAttributeHelper.m index fcb8ad47..45c015e0 100644 --- a/SDWebImage/Private/SDFileAttributeHelper.m +++ b/SDWebImage/Private/SDFileAttributeHelper.m @@ -10,7 +10,7 @@ @implementation SDFileAttributeHelper -+ (NSArray*)extendedAttributeNamesAtPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err { ++ (NSArray*)extendedAttributeNamesAtPath:(NSString *)path traverseLink:(BOOL)follow error:(NSError **)err { int flags = follow? 0 : XATTR_NOFOLLOW; // get size of name list @@ -39,7 +39,7 @@ return [NSArray arrayWithArray:names]; } -+ (BOOL)hasExtendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err { ++ (BOOL)hasExtendedAttribute:(NSString *)name atPath:(NSString *)path traverseLink:(BOOL)follow error:(NSError **)err { int flags = follow? 0 : XATTR_NOFOLLOW; // get size of name list @@ -67,7 +67,7 @@ return NO; } -+ (NSData*)extendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err { ++ (NSData *)extendedAttribute:(NSString *)name atPath:(NSString *)path traverseLink:(BOOL)follow error:(NSError **)err { int flags = follow? 0 : XATTR_NOFOLLOW; // get length ssize_t attrLen = getxattr([path fileSystemRepresentation], [name UTF8String], NULL, 0, 0, flags); @@ -85,12 +85,12 @@ } // get attribute data - NSMutableData * attrData = [NSMutableData dataWithLength:attrLen]; + NSMutableData *attrData = [NSMutableData dataWithLength:attrLen]; getxattr([path fileSystemRepresentation], [name UTF8String], [attrData mutableBytes], attrLen, 0, flags); return attrData; } -+ (BOOL)setExtendedAttribute:(NSString*)name value:(NSData*)value atPath:(NSString*)path traverseLink:(BOOL)follow overwrite:(BOOL)overwrite error:(NSError**)err { ++ (BOOL)setExtendedAttribute:(NSString *)name value:(NSData *)value atPath:(NSString *)path traverseLink:(BOOL)follow overwrite:(BOOL)overwrite error:(NSError **)err { int flags = (follow? 0 : XATTR_NOFOLLOW) | (overwrite? 0 : XATTR_CREATE); if (0 == setxattr([path fileSystemRepresentation], [name UTF8String], [value bytes], [value length], 0, flags)) return YES; // error @@ -108,7 +108,7 @@ return NO; } -+ (BOOL)removeExtendedAttribute:(NSString*)name atPath:(NSString*)path traverseLink:(BOOL)follow error:(NSError**)err { ++ (BOOL)removeExtendedAttribute:(NSString *)name atPath:(NSString *)path traverseLink:(BOOL)follow error:(NSError **)err { int flags = (follow? 0 : XATTR_NOFOLLOW); if (0 == removexattr([path fileSystemRepresentation], [name UTF8String], flags)) return YES; // error