@@ -180,22 +180,18 @@ @throw [OFInitializationFailedException exceptionWithClass: self]; #endif } -+ (instancetype)fileWithPath: (OFString *)path - mode: (OFString *)mode ++ (instancetype)fileWithPath: (OFString *)path mode: (OFString *)mode { - return [[[self alloc] initWithPath: path - mode: mode] autorelease]; + return [[[self alloc] initWithPath: path mode: mode] autorelease]; } -+ (instancetype)fileWithURL: (OFURL *)URL - mode: (OFString *)mode ++ (instancetype)fileWithURL: (OFURL *)URL mode: (OFString *)mode { - return [[[self alloc] initWithURL: URL - mode: mode] autorelease]; + return [[[self alloc] initWithURL: URL mode: mode] autorelease]; } + (instancetype)fileWithHandle: (of_file_handle_t)handle { return [[[self alloc] initWithHandle: handle] autorelease]; @@ -204,12 +200,11 @@ - (instancetype)init { OF_INVALID_INIT_METHOD } -- (instancetype)initWithPath: (OFString *)path - mode: (OFString *)mode +- (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode { of_file_handle_t handle; @try { void *pool = objc_autoreleasePoolPush(); @@ -324,12 +319,11 @@ } return self; } -- (instancetype)initWithURL: (OFURL *)URL - mode: (OFString *)mode +- (instancetype)initWithURL: (OFURL *)URL mode: (OFString *)mode { void *pool = objc_autoreleasePoolPush(); OFString *fileSystemRepresentation; @try { @@ -337,12 +331,11 @@ } @catch (id e) { [self release]; @throw e; } - self = [self initWithPath: fileSystemRepresentation - mode: mode]; + self = [self initWithPath: fileSystemRepresentation mode: mode]; objc_autoreleasePoolPop(pool); return self; } @@ -362,12 +355,11 @@ @throw [OFNotOpenException exceptionWithObject: self]; return _atEndOfStream; } -- (size_t)lowlevelReadIntoBuffer: (void *)buffer - length: (size_t)length +- (size_t)lowlevelReadIntoBuffer: (void *)buffer length: (size_t)length { ssize_t ret; if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; @@ -399,12 +391,11 @@ _atEndOfStream = true; return ret; } -- (size_t)lowlevelWriteBuffer: (const void *)buffer - length: (size_t)length +- (size_t)lowlevelWriteBuffer: (const void *)buffer length: (size_t)length { if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self]; #if defined(OF_WINDOWS) @@ -458,12 +449,11 @@ #endif return (size_t)bytesWritten; } -- (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset - whence: (int)whence +- (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset whence: (int)whence { of_offset_t ret; if (_handle == OF_INVALID_FILE_HANDLE) @throw [OFNotOpenException exceptionWithObject: self];