Differences From Artifact [0d44e2d4f4]:
- File
src/OFFile.h
— part of check-in
[a0fd103a0b]
at
2021-03-07 02:36:04
on branch trunk
— Style change: Allow more than 1 argument per line
This is only migrating some places, others will be migrated as they are
touched. (user: js, size: 5771) [annotate] [blame] [check-ins using] [more...]
To Artifact [db0bb12b6a]:
- File src/OFFile.h — part of check-in [94ebfb3671] at 2021-04-17 14:36:08 on branch new-naming-convention — of_file_handle_t -> OFFileHandle (user: js, size: 5745) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
15 16 17 18 19 20 21 | #import "OFSeekableStream.h" #import "OFKernelEventObserver.h" #ifndef OF_AMIGAOS # define OF_FILE_HANDLE_IS_FD # define OF_INVALID_FILE_HANDLE (-1) | | | | | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #import "OFSeekableStream.h" #import "OFKernelEventObserver.h" #ifndef OF_AMIGAOS # define OF_FILE_HANDLE_IS_FD # define OF_INVALID_FILE_HANDLE (-1) typedef int OFFileHandle; #else # define OF_INVALID_FILE_HANDLE NULL typedef struct OFFileHandle *OFFileHandle; #endif OF_ASSUME_NONNULL_BEGIN @class OFURL; /** * @class OFFile OFFile.h ObjFW/OFFile.h * * @brief A class which provides methods to read and write files. */ OF_SUBCLASSING_RESTRICTED @interface OFFile: OFSeekableStream #ifdef OF_FILE_HANDLE_IS_FD <OFReadyForReadingObserving, OFReadyForWritingObserving> #endif { OFFileHandle _handle; bool _atEndOfStream; } /** * @brief Creates a new OFFile with the specified path and mode. * * @param path The path to the file to open as a string |
︙ | ︙ | |||
89 90 91 92 93 94 95 | * @brief Creates a new OFFile with the specified native file handle. * * @param handle A native file handle. If OF_FILE_HANDLE_IS_FD is defined, this * is a file descriptor. The handle is closed when the OFFile * object is deallocated! * @return A new autoreleased OFFile */ | | | 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | * @brief Creates a new OFFile with the specified native file handle. * * @param handle A native file handle. If OF_FILE_HANDLE_IS_FD is defined, this * is a file descriptor. The handle is closed when the OFFile * object is deallocated! * @return A new autoreleased OFFile */ + (instancetype)fileWithHandle: (OFFileHandle)handle; - (instancetype)init OF_UNAVAILABLE; /** * @brief Initializes an already allocated OFFile. * * @param path The path to the file to open as a string |
︙ | ︙ | |||
149 150 151 152 153 154 155 | * @brief Initializes an already allocated OFFile. * * @param handle A native file handle. If OF_FILE_HANDLE_IS_FD is defined, this * is a file descriptor. The handle is closed when the OFFile * object is deallocated! * @return An initialized OFFile */ | | < | 149 150 151 152 153 154 155 156 157 158 159 | * @brief Initializes an already allocated OFFile. * * @param handle A native file handle. If OF_FILE_HANDLE_IS_FD is defined, this * is a file descriptor. The handle is closed when the OFFile * object is deallocated! * @return An initialized OFFile */ - (instancetype)initWithHandle: (OFFileHandle)handle OF_DESIGNATED_INITIALIZER; @end OF_ASSUME_NONNULL_END |