Comment: | Convert methods to properties where appropriate
This improves Swift compatibility. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
f3ccf144611b4f3309c6043c1a03699a |
User & Date: | js on 2017-10-29 21:58:14 |
Other Links: | manifest | tags |
2017-10-29
| ||
22:22 | macros.h: Add OF_SWIFT_NAME check-in: 68b3d08ac1 user: js tags: trunk | |
21:58 | Convert methods to properties where appropriate check-in: f3ccf14461 user: js tags: trunk | |
15:23 | OFURL: Properties store unencoded strings now check-in: c1c9443c1a user: js tags: trunk | |
Modified src/OFApplication.h from [45023093c6] to [5c5c92ace5].
︙ | ︙ | |||
149 150 151 152 153 154 155 156 157 158 159 160 161 162 | /*! * The environment of the application. */ @property (readonly, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *) *environment; /*! * @brief Returns the only OFApplication instance in the application. * * @return The only OFApplication instance in the application */ + (nullable OFApplication *)sharedApplication; | > > > > > > | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | /*! * The environment of the application. */ @property (readonly, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *) *environment; /*! * The delegate of the application. */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id <OFApplicationDelegate> delegate; /*! * @brief Returns the only OFApplication instance in the application. * * @return The only OFApplication instance in the application */ + (nullable OFApplication *)sharedApplication; |
︙ | ︙ | |||
211 212 213 214 215 216 217 | * * @param argc A pointer where a pointer to argc should be stored * @param argv A pointer where a pointer to argv should be stored */ - (void)getArgumentCount: (int *_Nonnull *_Nonnull)argc andArgumentValues: (char *_Nonnull *_Nonnull *_Nonnull[_Nonnull])argv; | < < < < < < < < < < < < < < | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | * * @param argc A pointer where a pointer to argc should be stored * @param argv A pointer where a pointer to argv should be stored */ - (void)getArgumentCount: (int *_Nonnull *_Nonnull)argc andArgumentValues: (char *_Nonnull *_Nonnull *_Nonnull[_Nonnull])argv; /*! * @brief Terminates the application. */ - (void)terminate OF_NO_RETURN; /*! * @brief Terminates the application with the specified status. |
︙ | ︙ |
Modified src/OFArray.h from [0a6a732f59] to [420b1d0ef7].
︙ | ︙ | |||
131 132 133 134 135 136 137 138 139 140 141 142 143 144 | * @param count The length of the C array * @return A new autoreleased OFArray */ + (instancetype) arrayWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; /*! * @brief Initializes an OFArray with the specified object. * * @param object An object * @return An initialized OFArray */ - (instancetype)initWithObject: (ObjectType)object; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 | * @param count The length of the C array * @return A new autoreleased OFArray */ + (instancetype) arrayWithObjects: (ObjectType const _Nonnull *_Nonnull)objects count: (size_t)count; /*! * The objects of the array as a C array. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. */ @property (readonly, nonatomic) ObjectType const __unsafe_unretained _Nonnull *_Nonnull objects; /*! * The first object of the array or `nil`. * * @warning The returned object is *not* retained and autoreleased for * performance reasons! */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType firstObject; /*! * The last object of the array or `nil`. * * @warning The returned object is *not* retained and autoreleased for * performance reasons! */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType lastObject; /*! * The array sorted in ascending order. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *sortedArray; /*! * The array with the order reversed. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *reversedArray; /*! * @brief Initializes an OFArray with the specified object. * * @param object An object * @return An initialized OFArray */ - (instancetype)initWithObject: (ObjectType)object; |
︙ | ︙ | |||
228 229 230 231 232 233 234 | * * @param buffer The buffer to copy the objects to * @param range The range to copy */ - (void)getObjects: (ObjectType __unsafe_unretained _Nonnull *_Nonnull)buffer inRange: (of_range_t)range; | < < < < < < < | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | * * @param buffer The buffer to copy the objects to * @param range The range to copy */ - (void)getObjects: (ObjectType __unsafe_unretained _Nonnull *_Nonnull)buffer inRange: (of_range_t)range; /*! * @brief Returns the index of the first object that is equivalent to the * specified object or `OF_NOT_FOUND` if it was not found. * * @param object The object whose index is returned * @return The index of the first object equivalent to the specified object * or `OF_NOT_FOUND` if it was not found |
︙ | ︙ | |||
274 275 276 277 278 279 280 | * * @param object The object which is checked for being in the array * @return A boolean whether the array contains an object with the specified * address */ - (bool)containsObjectIdenticalTo: (ObjectType)object; | < < < < < < < < < < < < < < < < < < < < | 303 304 305 306 307 308 309 310 311 312 313 314 315 316 | * * @param object The object which is checked for being in the array * @return A boolean whether the array contains an object with the specified * address */ - (bool)containsObjectIdenticalTo: (ObjectType)object; /*! * @brief Returns the objects in the specified range as a new OFArray. * * @param range The range for the subarray * @return The subarray as a new autoreleased OFArray */ - (OFArray OF_GENERIC(ObjectType) *)objectsInRange: (of_range_t)range; |
︙ | ︙ | |||
370 371 372 373 374 375 376 | * @param selector The selector to perform on all objects in the array * @param object The object to perform the selector with on all objects in the * array */ - (void)makeObjectsPerformSelector: (SEL)selector withObject: (nullable id)object; | < < < < < < < | 379 380 381 382 383 384 385 386 387 388 389 390 391 392 | * @param selector The selector to perform on all objects in the array * @param object The object to perform the selector with on all objects in the * array */ - (void)makeObjectsPerformSelector: (SEL)selector withObject: (nullable id)object; /*! * @brief Returns a copy of the array sorted using the specified selector and * options. * * @param selector The selector to use to sort the array. It's signature * should be the same as that of @ref compare:. * @param options The options to use when sorting the array.@n |
︙ | ︙ | |||
411 412 413 414 415 416 417 | * @return A sorted copy of the array */ - (OFArray OF_GENERIC(ObjectType) *) sortedArrayUsingComparator: (of_comparator_t)comparator options: (int)options; #endif | < < < < < < < | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | * @return A sorted copy of the array */ - (OFArray OF_GENERIC(ObjectType) *) sortedArrayUsingComparator: (of_comparator_t)comparator options: (int)options; #endif /*! * @brief Creates a new array with the specified object added. * * @param object The object to add * @return A new array with the specified object added */ - (OFArray OF_GENERIC(ObjectType) *)arrayByAddingObject: (ObjectType)object; |
︙ | ︙ | |||
443 444 445 446 447 448 449 | * @brief Creates a new array with the specified object removed. * * @param object The object to remove * @return A new array with the specified object removed */ - (OFArray OF_GENERIC(ObjectType) *)arrayByRemovingObject: (ObjectType)object; | < < < < < < < < | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | * @brief Creates a new array with the specified object removed. * * @param object The object to remove * @return A new array with the specified object removed */ - (OFArray OF_GENERIC(ObjectType) *)arrayByRemovingObject: (ObjectType)object; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each object. * * @param block The block to execute for each object */ - (void)enumerateObjectsUsingBlock: (of_array_enumeration_block_t)block; |
︙ | ︙ |
Modified src/OFCollection.h from [835760a641] to [6da8efa84a].
︙ | ︙ | |||
21 22 23 24 25 26 27 | /*! * @protocol OFCollection OFCollection.h ObjFW/OFCollection.h * * @brief A protocol with methods common for all collections. */ @protocol OFCollection <OFEnumerating, OFFastEnumeration> /*! | < < | | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | /*! * @protocol OFCollection OFCollection.h ObjFW/OFCollection.h * * @brief A protocol with methods common for all collections. */ @protocol OFCollection <OFEnumerating, OFFastEnumeration> /*! * @return The number of objects in the collection */ @property (readonly, nonatomic) size_t count; /*! * @brief Checks whether the collection contains an object equal to the * specified object. * * @param object The object which is checked for being in the collection * @return A boolean whether the collection contains the specified object */ - (bool)containsObject: (id)object; @end OF_ASSUME_NONNULL_END |
Modified src/OFCryptoHash.h from [c3a8ed0de1] to [ab2417692f].
︙ | ︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | */ @protocol OFCryptoHash <OFObject, OFCopying> /*! * A boolean whether the hash has already been calculated. */ @property (readonly, nonatomic, getter=isCalculated) bool calculated; /*! * @brief Creates a new cryptographic hash. * * @return A new autoreleased OFCryptoHash */ + (instancetype)cryptoHash; | > > > > > > > > > | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | */ @protocol OFCryptoHash <OFObject, OFCopying> /*! * A boolean whether the hash has already been calculated. */ @property (readonly, nonatomic, getter=isCalculated) bool calculated; /*! * A buffer containing the cryptographic hash. * * The size of the buffer depends on the hash used. The buffer is part of the * receiver's memory pool. */ @property (readonly, nonatomic) const unsigned char *digest OF_RETURNS_INNER_POINTER; /*! * @brief Creates a new cryptographic hash. * * @return A new autoreleased OFCryptoHash */ + (instancetype)cryptoHash; |
︙ | ︙ | |||
59 60 61 62 63 64 65 | * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ - (void)updateWithBuffer: (const void *)buffer length: (size_t)length; | < < < < < < < < < < | 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ - (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Resets all state so that a new hash can be calculated. * * @warning This invalidates any pointer previously returned by @ref digest. If * you are still interested in the previous digest, you need to memcpy * it yourself before calling @ref reset! */ - (void)reset; @end OF_ASSUME_NONNULL_END |
Modified src/OFData+CryptoHashing.h from [04b637648a] to [0008631388].
︙ | ︙ | |||
26 27 28 29 30 31 32 | extern int _OFData_CryptoHashing_reference; #ifdef __cplusplus } #endif @interface OFData (CryptoHashing) /*! | < < | | < < < | | < < | | < < < | | < < < | | < < < | | < < < | | | 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | extern int _OFData_CryptoHashing_reference; #ifdef __cplusplus } #endif @interface OFData (CryptoHashing) /*! * The MD5 hash of the data as a string. */ @property (readonly, nonatomic) OFString *MD5Hash; /*! * The RIPEMD-160 hash of the data as a string. */ @property (readonly, nonatomic) OFString *RIPEMD160Hash; /*! * The SHA-1 hash of the data as a string. */ @property (readonly, nonatomic) OFString *SHA1Hash; /*! * The SHA-224 hash of the data as a string. */ @property (readonly, nonatomic) OFString *SHA224Hash; /*! * The SHA-256 hash of the data as a string. */ @property (readonly, nonatomic) OFString *SHA256Hash; /*! * The SHA-384 hash of the data as a string. */ @property (readonly, nonatomic) OFString *SHA384Hash; /*! * @return The SHA-512 hash of the data as a string. */ @property (readonly, nonatomic) OFString *SHA512Hash; @end OF_ASSUME_NONNULL_END |
Modified src/OFData+MessagePackValue.h from [1003ac6c46] to [7771c81a20].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFData_MessagePackValue_reference; #ifdef __cplusplus } #endif @interface OFData (MessagePackValue) /*! | < < | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | extern int _OFData_MessagePackValue_reference; #ifdef __cplusplus } #endif @interface OFData (MessagePackValue) /*! * The data interpreted as MessagePack representation and parsed as an object. */ @property (readonly, nonatomic) id messagePackValue; /*! * @brief Parses the MessagePack representation and returns it as an object. * * @param depthLimit The maximum depth the parser should accept (defaults to 32 * if not specified, 0 means no limit (insecure!)) * @return The MessagePack representation as an object */ - (id)messagePackValueWithDepthLimit: (size_t)depthLimit; @end OF_ASSUME_NONNULL_END |
Modified src/OFData.h from [3a6c360dd5] to [d1decb9e79].
︙ | ︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | } /*! * The size of a single item in the OFData in bytes. */ @property (readonly, nonatomic) size_t itemSize; /*! * @brief Creates a new OFData with the specified `count` items of size 1. * * @param items The items to store in the OFData * @param count The number of items * @return A new autoreleased OFData */ | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | } /*! * The size of a single item in the OFData in bytes. */ @property (readonly, nonatomic) size_t itemSize; /*! * The number of items in the OFData. */ @property (readonly, nonatomic) size_t count; /*! * All elements of the OFData as a C array. * * @warning The pointer is only valid until the OFData is changed! * */ @property (readonly, nonatomic) const void *items OF_RETURNS_INNER_POINTER; /*! * The first item of the OFData or NULL. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) const void *firstItem OF_RETURNS_INNER_POINTER; /*! * The last item of the OFData or NULL. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) const void *lastItem OF_RETURNS_INNER_POINTER; /*! * The string representation of the data. * * The string representation is a hex dump of the data, grouped by itemSize * bytes. */ @property (readonly, nonatomic) OFString *stringRepresentation; /*! * A string containing the data in Base64 encoding. */ @property (readonly, nonatomic) OFString *stringByBase64Encoding; /*! * @brief Creates a new OFData with the specified `count` items of size 1. * * @param items The items to store in the OFData * @param count The number of items * @return A new autoreleased OFData */ |
︙ | ︙ | |||
231 232 233 234 235 236 237 | * containing the data of the Base64-encoded string. * * @param string The string with the Base64-encoded data * @return An initialized OFData */ - (instancetype)initWithBase64EncodedString: (OFString *)string; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 | * containing the data of the Base64-encoded string. * * @param string The string with the Base64-encoded data * @return An initialized OFData */ - (instancetype)initWithBase64EncodedString: (OFString *)string; /*! * @brief Returns a specific item of the OFData. * * @param index The number of the item to return * @return The specified item of the OFData */ - (const void *)itemAtIndex: (size_t)index OF_RETURNS_INNER_POINTER; #ifdef OF_HAVE_FILES /*! * @brief Writes the OFData into the specified file. * * @param path The path of the file to write to */ - (void)writeToFile: (OFString *)path; |
︙ | ︙ |
Modified src/OFDate.h from [728f213f2d] to [c8a7ef20f0].
︙ | ︙ | |||
28 29 30 31 32 33 34 35 36 37 38 39 40 41 | * @brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> { of_time_interval_t _seconds; } /*! * @brief Creates a new OFDate with the current date and time. * * @return A new, autoreleased OFDate with the current date and time */ + (instancetype)date; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | * @brief A class for storing, accessing and comparing dates. */ @interface OFDate: OFObject <OFCopying, OFComparing, OFSerialization> { of_time_interval_t _seconds; } /*! * The microsecond of the date. */ @property (readonly, nonatomic) uint32_t microsecond; /*! * The second of the date. */ @property (readonly, nonatomic) uint8_t second; /*! * The minute of the date. */ @property (readonly, nonatomic) uint8_t minute; /*! * The minute of the date in local time. */ @property (readonly, nonatomic) uint8_t localMinute; /*! * The hour of the date. */ @property (readonly, nonatomic) uint8_t hour; /*! * The hour of the date in local time. */ @property (readonly, nonatomic) uint8_t localHour; /*! * The day of the month of the date. */ @property (readonly, nonatomic) uint8_t dayOfMonth; /*! * The day of the month of the date in local time. */ @property (readonly, nonatomic) uint8_t localDayOfMonth; /*! * The month of the year of the date. */ @property (readonly, nonatomic) uint8_t monthOfYear; /*! * The month of the year of the date in local time. */ @property (readonly, nonatomic) uint8_t localMonthOfYear; /*! * The year of the date. */ @property (readonly, nonatomic) uint16_t year; /*! * The year of the date in local time. */ @property (readonly, nonatomic) uint16_t localYear; /*! * The day of the week of the date. */ @property (readonly, nonatomic) uint8_t dayOfWeek; /*! * The day of the week of the date in local time. */ @property (readonly, nonatomic) uint8_t localDayOfWeek; /*! * The day of the year of the date. */ @property (readonly, nonatomic) uint16_t dayOfYear; /*! * The day of the year of the date in local time. */ @property (readonly, nonatomic) uint16_t localDayOfYear; /*! * The seconds since 1970-01-01T00:00:00Z. */ @property (readonly, nonatomic) of_time_interval_t timeIntervalSince1970; /*! * The seconds the date is in the future. */ @property (readonly, nonatomic) of_time_interval_t timeIntervalSinceNow; /*! * @brief Creates a new OFDate with the current date and time. * * @return A new, autoreleased OFDate with the current date and time */ + (instancetype)date; |
︙ | ︙ | |||
163 164 165 166 167 168 169 | * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time */ - (instancetype)initWithLocalDateString: (OFString *)string format: (OFString *)format; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | * @param string The string describing the date * @param format The format of the string describing the date * @return An initialized OFDate with the specified date and time */ - (instancetype)initWithLocalDateString: (OFString *)string format: (OFString *)format; /*! * @brief Creates a string of the date with the specified format. * * See the man page for `strftime` for information on the format. * * @param format The format for the date string * @return A new, autoreleased OFString |
︙ | ︙ | |||
315 316 317 318 319 320 321 | * If the argument is `nil`, it returns the receiver. * * @param otherDate Another date * @return The later date of the two dates */ - (OFDate *)laterDate: (nullable OFDate *)otherDate; | < < < < < < < < < < < < < < | 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | * If the argument is `nil`, it returns the receiver. * * @param otherDate Another date * @return The later date of the two dates */ - (OFDate *)laterDate: (nullable OFDate *)otherDate; /*! * @brief Returns the seconds the receiver is after the date. * * @param otherDate Date date to generate the difference with receiver * @return The seconds the receiver is after the date. */ - (of_time_interval_t)timeIntervalSinceDate: (OFDate *)otherDate; /*! * @brief Creates a new date with the specified time interval added. * * @param seconds The seconds after the date * @return A new, autoreleased OFDate */ - (OFDate *)dateByAddingTimeInterval: (of_time_interval_t)seconds; @end OF_ASSUME_NONNULL_END |
Modified src/OFDictionary.h from [72d79ae93c] to [d4aab8a73d].
︙ | ︙ | |||
113 114 115 116 117 118 119 120 121 122 123 124 125 126 | * * @param firstKey The first key * @return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithKeysAndObjects: (KeyType)firstKey, ... OF_SENTINEL; /*! * @brief Initializes an already allocated OFDictionary with the specified * OFDictionary. * * @param dictionary An OFDictionary * @return An initialized OFDictionary */ | > > > > > > > > > > > > > > > | 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | * * @param firstKey The first key * @return A new autoreleased OFDictionary */ + (instancetype)dictionaryWithKeysAndObjects: (KeyType)firstKey, ... OF_SENTINEL; /*! * An array of all keys. */ @property (readonly, nonatomic) OFArray OF_GENERIC(KeyType) *allKeys; /*! * An array of all objects. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; /*! * A URL-encoded string with the contents of the dictionary. */ @property (readonly, nonatomic) OFString *stringByURLEncoding; /*! * @brief Initializes an already allocated OFDictionary with the specified * OFDictionary. * * @param dictionary An OFDictionary * @return An initialized OFDictionary */ |
︙ | ︙ | |||
239 240 241 242 243 244 245 | * * @param object The object which is checked for being in the dictionary * @return A boolean whether the dictionary contains an object with the * specified address */ - (bool)containsObjectIdenticalTo: (ObjectType)object; | < < < < < < < < < < < < < < < < < < < < < | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | * * @param object The object which is checked for being in the dictionary * @return A boolean whether the dictionary contains an object with the * specified address */ - (bool)containsObjectIdenticalTo: (ObjectType)object; /*! * @brief Returns an OFEnumerator to enumerate through the dictionary's keys. * * @return An OFEnumerator to enumerate through the dictionary's keys */ - (OFEnumerator OF_GENERIC(KeyType) *)keyEnumerator; |
︙ | ︙ |
Modified src/OFEnumerator.h from [fe479ba326] to [ba066f3027].
︙ | ︙ | |||
27 28 29 30 31 32 33 | * @brief A protocol for getting an enumerator for the object. */ @protocol OFEnumerating /*! * @brief Returns an OFEnumerator to enumerate through all objects of the * collection. * | | > > > > > | < < < < < < < | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | * @brief A protocol for getting an enumerator for the object. */ @protocol OFEnumerating /*! * @brief Returns an OFEnumerator to enumerate through all objects of the * collection. * * @return An OFEnumerator to enumerate through all objects of the collection */ - (OFEnumerator *)objectEnumerator; @end /*! * @class OFEnumerator OFEnumerator.h ObjFW/OFEnumerator.h * * @brief A class which provides methods to enumerate through collections. */ @interface OFEnumerator OF_GENERIC(ObjectType): OFObject #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif /*! * An array of all remaining objects in the collection. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; /*! * Returns the next object or `nil` if there is none left. * * @return The next object or `nil` if there is none left */ - (nullable ObjectType)nextObject; /*! * @brief Resets the enumerator, so the next call to nextObject returns the * first object again. */ - (void)reset; #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType |
︙ | ︙ |
Modified src/OFFileManager.h from [a89fad782a] to [b207ab823b].
︙ | ︙ | |||
39 40 41 42 43 44 45 46 47 48 49 50 | /*! * @class OFFileManager OFFileManager.h ObjFW/OFFileManager.h * * @brief A class which provides management for files, e.g. reading contents of * directories, deleting files, renaming files, etc. */ @interface OFFileManager: OFObject /*! * @brief Returns the default file manager. */ + (OFFileManager *)defaultManager; | > > > > > > > > > > < < < < < < < < < < < < < < | 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | /*! * @class OFFileManager OFFileManager.h ObjFW/OFFileManager.h * * @brief A class which provides management for files, e.g. reading contents of * directories, deleting files, renaming files, etc. */ @interface OFFileManager: OFObject /*! * The path of the current working directory. */ @property (readonly, nonatomic) OFString *currentDirectoryPath; /*! * The URL of the current working directory. */ @property (readonly, nonatomic) OFURL *currentDirectoryURL; /*! * @brief Returns the default file manager. */ + (OFFileManager *)defaultManager; /*! * @brief Checks whether a file exists at the specified path. * * @param path The path to check * @return A boolean whether there is a file at the specified path */ - (bool)fileExistsAtPath: (OFString *)path; |
︙ | ︙ |
Modified src/OFHMAC.h from [aaa867eca5] to [0c8ac23177].
︙ | ︙ | |||
28 29 30 31 32 33 34 | { Class <OFCryptoHash> _hashClass; id <OFCryptoHash> _Nullable _outerHash, _innerHash; id <OFCryptoHash> _Nullable _outerHashCopy, _innerHashCopy; bool _calculated; } | > | > > > > > > > > > > > > > > > | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | { Class <OFCryptoHash> _hashClass; id <OFCryptoHash> _Nullable _outerHash, _innerHash; id <OFCryptoHash> _Nullable _outerHashCopy, _innerHashCopy; bool _calculated; } /*! * The class for the cryptographic hash used by the HMAC. */ @property (readonly, nonatomic) Class <OFCryptoHash> hashClass; /*! * A buffer containing the HMAC. * * The size of the buffer depends on the hash used. The buffer is part of the * receiver's memory pool. */ @property (readonly, nonatomic) const unsigned char *digest OF_RETURNS_INNER_POINTER; /*! * The size of the digest. */ @property (readonly, nonatomic) size_t digestSize; /*! * @brief Returns a new OFHMAC with the specified hashing algorithm. * * @param hashClass The class of the hashing algorithm * @return A new, autoreleased OFHMAC */ + (instancetype)HMACWithHashClass: (Class <OFCryptoHash>)hashClass; |
︙ | ︙ | |||
75 76 77 78 79 80 81 | * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ - (void)updateWithBuffer: (const void *)buffer length: (size_t)length; | < < < < < < < < < < < < < < < < < | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 | * * @param buffer The buffer which should be included into the calculation * @param length The length of the buffer */ - (void)updateWithBuffer: (const void *)buffer length: (size_t)length; /*! * @brief Resets the HMAC so that it can be calculated for a new message. * * @note This does not reset the key so that a new HMAC with the same key can * be calculated efficiently. If you want to reset both, use * @ref setKey:length:. * |
︙ | ︙ |
Modified src/OFHTTPRequest.h from [c4033f68e4] to [0bad35c687].
︙ | ︙ | |||
77 78 79 80 81 82 83 84 85 86 87 88 89 90 | } /*! * The URL of the HTTP request. */ @property (copy, nonatomic) OFURL *URL; /*! * The request method of the HTTP request. */ @property (nonatomic) of_http_request_method_t method; /*! * The headers for the HTTP request. | > > > > > > > > > > | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | } /*! * The URL of the HTTP request. */ @property (copy, nonatomic) OFURL *URL; /*! * The protocol version of the HTTP request. */ @property (nonatomic) of_http_request_protocol_version_t protocolVersion; /*! * The protocol version of the HTTP request as a string. */ @property (readonly, nonatomic) OFString *protocolVersionString; /*! * The request method of the HTTP request. */ @property (nonatomic) of_http_request_method_t method; /*! * The headers for the HTTP request. |
︙ | ︙ | |||
121 122 123 124 125 126 127 | * @brief Initializes an already allocated OFHTTPRequest with the specified URL. * * @param URL The URL for the request * @return An initialized OFHTTPRequest */ - (instancetype)initWithURL: (OFURL *)URL; | < < < < < < < < < < < < < < < < < < < < < | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | * @brief Initializes an already allocated OFHTTPRequest with the specified URL. * * @param URL The URL for the request * @return An initialized OFHTTPRequest */ - (instancetype)initWithURL: (OFURL *)URL; /*! * @brief Sets the protocol version of the HTTP request to the version * described by the specified string. * * @param string A string describing an HTTP version */ - (void)setProtocolVersionFromString: (OFString *)string; /*! * @brief Sets the entity body of the HTTP request to the specified string * encoded in UTF-8. * * @param string The string to use for the entity body */ - (void)setBodyFromString: (OFString *)string; |
︙ | ︙ |
Modified src/OFHTTPResponse.h from [50360976c1] to [60a317d162].
︙ | ︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | @interface OFHTTPResponse: OFStream { of_http_request_protocol_version_t _protocolVersion; short _statusCode; OFDictionary OF_GENERIC(OFString *, OFString *) *_headers; } /*! * The status code of the reply to the HTTP request. */ @property (nonatomic) short statusCode; /*! * The headers of the reply to the HTTP request. */ @property (copy, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *) *headers; /*! | > > > > > > > > > > | < < < | < < < < < < < < < < < < < < < < < < < < | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | @interface OFHTTPResponse: OFStream { of_http_request_protocol_version_t _protocolVersion; short _statusCode; OFDictionary OF_GENERIC(OFString *, OFString *) *_headers; } /*! * The protocol version of the HTTP request reply. */ @property (nonatomic) of_http_request_protocol_version_t protocolVersion; /*! * The protocol version of the HTTP request reply as a string. */ @property (readonly, nonatomic) OFString *protocolVersionString; /*! * The status code of the reply to the HTTP request. */ @property (nonatomic) short statusCode; /*! * The headers of the reply to the HTTP request. */ @property (copy, nonatomic) OFDictionary OF_GENERIC(OFString *, OFString *) *headers; /*! * The reply as a string, trying to detect the encoding. */ @property (readonly, nonatomic) OFString *string; /*! * @brief Sets the protocol version of the HTTP request reply to the version * described by the specified string. * * @param string A string describing an HTTP version */ - (void)setProtocolVersionFromString: (OFString *)string; /*! * @brief Returns the reply as a string, trying to detect the encoding and * falling back to the specified encoding if not detectable. * * @return The reply as a string */ - (OFString *)stringWithEncoding: (of_string_encoding_t)encoding; @end OF_ASSUME_NONNULL_END |
Modified src/OFIntrospection.h from [5b3e73bb9a] to [b6e5a88492].
︙ | ︙ | |||
69 70 71 72 73 74 75 | * @class OFProperty OFIntrospection.h ObjFW/OFIntrospection.h * * @brief A class for describing a property. */ @interface OFProperty: OFObject { OFString *_name; | | | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | * @class OFProperty OFIntrospection.h ObjFW/OFIntrospection.h * * @brief A class for describing a property. */ @interface OFProperty: OFObject { OFString *_name; unsigned int _attributes; OFString *_Nullable _getter, *_Nullable _setter; } /*! * The name of the property. */ @property (readonly, nonatomic) OFString *name; |
︙ | ︙ | |||
95 96 97 98 99 100 101 | * OF_PROPERTY_COPY | The property is declared `copy` * OF_PROPERTY_NONATOMIC | The property is declared `nonatomic` * OF_PROPERTY_ATOMIC | The property is declared `atomic` * OF_PROPERTY_WEAK | The property is declared `weak` * OF_PROPERTY_SYNTHESIZED | The property is synthesized * OF_PROPERTY_DYNAMIC | The property is dynamic */ | | | 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | * OF_PROPERTY_COPY | The property is declared `copy` * OF_PROPERTY_NONATOMIC | The property is declared `nonatomic` * OF_PROPERTY_ATOMIC | The property is declared `atomic` * OF_PROPERTY_WEAK | The property is declared `weak` * OF_PROPERTY_SYNTHESIZED | The property is synthesized * OF_PROPERTY_DYNAMIC | The property is dynamic */ @property (readonly, nonatomic) unsigned int attributes; /*! * The name of the getter. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *getter; /*! |
︙ | ︙ |
Modified src/OFJSONRepresentation.h from [e14744365e] to [48d477f9f2].
︙ | ︙ | |||
33 34 35 36 37 38 39 | * * @warning Although this method can be called directly on classes other than * OFArray and OFDictionary, this will generate invalid JSON, as JSON * requires all data to be encapsulated in an array or a dictionary! */ @protocol OFJSONRepresentation /*! | < < | | | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | * * @warning Although this method can be called directly on classes other than * OFArray and OFDictionary, this will generate invalid JSON, as JSON * requires all data to be encapsulated in an array or a dictionary! */ @protocol OFJSONRepresentation /*! * The JSON representation of the object as a string. */ @property (readonly, nonatomic) OFString *JSONRepresentation; /*! * @brief Returns the JSON representation of the object as a string. * * @param options The options to use when creating a JSON representation.@n * Possible values are: * Value | Description |
︙ | ︙ |
Modified src/OFKernelEventObserver.h from [aeb3ba4046] to [81ef5bf556].
︙ | ︙ | |||
65 66 67 68 69 70 71 | * OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h * * @brief This protocol is implemented by classes which can be observed for * readiness for reading by OFKernelEventObserver. */ @protocol OFReadyForReadingObserving <OFObject> /*! | < < < | | | < < < | | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | * OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h * * @brief This protocol is implemented by classes which can be observed for * readiness for reading by OFKernelEventObserver. */ @protocol OFReadyForReadingObserving <OFObject> /*! * The file descriptor for reading that should be checked by the * OFKernelEventObserver. */ @property (readonly, nonatomic) int fileDescriptorForReading; @end /*! * @protocol OFReadyForWritingObserving * OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h * * @brief This protocol is implemented by classes which can be observed for * readiness for writing by OFKernelEventObserver. */ @protocol OFReadyForWritingObserving <OFObject> /*! * The file descriptor for writing that should be checked by the * OFKernelEventObserver. */ @property (readonly, nonatomic) int fileDescriptorForWriting; @end /*! * @class OFKernelEventObserver * OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h * * @brief A class that can observe multiple kernel events (e.g. streams being |
︙ | ︙ |
Modified src/OFList.h from [9a9431e042] to [767ebca506].
︙ | ︙ | |||
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | /*! * The first list object of the list. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) of_list_object_t *firstListObject; /*! * The last list object of the list. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) of_list_object_t *lastListObject; /*! * @brief Creates a new OFList. * * @return A new autoreleased OFList */ + (instancetype)list; | > > > > > > > > > > > > > > > > | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | /*! * The first list object of the list. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) of_list_object_t *firstListObject; /*! * The first object of the list or `nil`. * * @warning The returned object is *not* retained and autoreleased for * performance reasons! */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType firstObject; /*! * The last list object of the list. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) of_list_object_t *lastListObject; /*! * The last object of the list or `nil`. * * @warning The returned object is *not* retained and autoreleased for * performance reasons! */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType lastObject; /*! * @brief Creates a new OFList. * * @return A new autoreleased OFList */ + (instancetype)list; |
︙ | ︙ | |||
142 143 144 145 146 147 148 | * * @param object The object which is checked for being in the list * @return A boolean whether the list contains an object with the specified * address */ - (bool)containsObjectIdenticalTo: (ObjectType)object; | < < < < < < < < < < < < < < < < < < < < < < < < < < < | 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | * * @param object The object which is checked for being in the list * @return A boolean whether the list contains an object with the specified * address */ - (bool)containsObjectIdenticalTo: (ObjectType)object; /*! * @brief Removes all objects from the list. */ - (void)removeAllObjects; #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # undef ObjectType #endif |
︙ | ︙ |
Modified src/OFMapTable.h from [df99b8af7c] to [36496cd646].
︙ | ︙ | |||
84 85 86 87 88 89 90 91 92 93 94 95 96 97 | @property (readonly, nonatomic) of_map_table_functions_t keyFunctions; /*! * The object functions used by the map table. */ @property (readonly, nonatomic) of_map_table_functions_t objectFunctions; /*! * @brief Creates a new OFMapTable with the specified key and object functions. * * @param keyFunctions A structure of functions for handling keys * @param objectFunctions A structure of functions for handling objects * @return A new autoreleased OFMapTable */ | > > > > > | 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | @property (readonly, nonatomic) of_map_table_functions_t keyFunctions; /*! * The object functions used by the map table. */ @property (readonly, nonatomic) of_map_table_functions_t objectFunctions; /*! * The number of objects in the map table. */ @property (readonly, nonatomic) size_t count; /*! * @brief Creates a new OFMapTable with the specified key and object functions. * * @param keyFunctions A structure of functions for handling keys * @param objectFunctions A structure of functions for handling objects * @return A new autoreleased OFMapTable */ |
︙ | ︙ | |||
138 139 140 141 142 143 144 | * @return An initialized OFMapTable */ - (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions objectFunctions: (of_map_table_functions_t)objectFunctions capacity: (size_t)capacity OF_DESIGNATED_INITIALIZER; | < < < < < < < | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | * @return An initialized OFMapTable */ - (instancetype)initWithKeyFunctions: (of_map_table_functions_t)keyFunctions objectFunctions: (of_map_table_functions_t)objectFunctions capacity: (size_t)capacity OF_DESIGNATED_INITIALIZER; /*! * @brief Returns the object for the given key or NULL if the key was not found. * * @param key The key whose object should be returned * @return The object for the given key or NULL if the key was not found */ - (nullable void *)objectForKey: (void *)key; |
︙ | ︙ |
Modified src/OFMessagePackRepresentation.h from [90f8ea281b] to [3923f91f5a].
︙ | ︙ | |||
25 26 27 28 29 30 31 | * OFMessagePackRepresentation.h ObjFW/OFMessagePackRepresentation.h * * @brief A protocol implemented by classes that support encoding to a * MessagePack representation. */ @protocol OFMessagePackRepresentation /*! | < < | | 25 26 27 28 29 30 31 32 33 34 35 36 37 | * OFMessagePackRepresentation.h ObjFW/OFMessagePackRepresentation.h * * @brief A protocol implemented by classes that support encoding to a * MessagePack representation. */ @protocol OFMessagePackRepresentation /*! * @return The MessagePack representation of the object as OFData. */ @property (readonly, nonatomic) OFData *messagePackRepresentation; @end OF_ASSUME_NONNULL_END |
Modified src/OFMutableData.h from [f022240c55] to [277ddc5595].
︙ | ︙ | |||
193 194 195 196 197 198 199 | * @brief Converts the mutable URL to an immutable URL. */ - (void)makeImmutable; @end @interface OFMutableData (MutableRetrieving) /*! | | > > | > > > > > > > > > > | > > > > | < < < < < < < < < < < < < < < < < < < < | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | * @brief Converts the mutable URL to an immutable URL. */ - (void)makeImmutable; @end @interface OFMutableData (MutableRetrieving) /*! * All items of the OFMutableData as a C array. * * @warning The pointer is only valid until the OFMutableData is changed! * * Modifying the returned array directly is allowed and will change the contents * of the data array. */ @property (readonly, nonatomic) void *items OF_RETURNS_INNER_POINTER; /*! * The first item of the OFMutableData or NULL. * * Modifying the returned item directly is allowed and will change the contents * of the data array. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) void *firstItem OF_RETURNS_INNER_POINTER; /*! * Last item of the OFMutableData or NULL. * * Modifying the returned item directly is allowed and will change the contents * of the data array. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) void *lastItem OF_RETURNS_INNER_POINTER; /*! * @brief Returns a specific item of the OFMutableData. * * Modifying the returned item directly is allowed and will change the contents * of the data array. * * @param index The number of the item to return * @return The specified item of the OFMutableData */ - (void *)itemAtIndex: (size_t)index OF_RETURNS_INNER_POINTER; @end OF_ASSUME_NONNULL_END |
Modified src/OFNumber.h from [8625e9c54a] to [0a882a919b].
︙ | ︙ | |||
152 153 154 155 156 157 158 159 160 161 162 163 164 165 | } /*! * The type of the number. */ @property (readonly, nonatomic) of_number_type_t type; /*! * @brief Creates a new OFNumber with the specified bool. * * @param bool_ A bool which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithBool: (bool)bool_; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | } /*! * The type of the number. */ @property (readonly, nonatomic) of_number_type_t type; /*! * Returns the OFNumber as a bool. */ @property (readonly, nonatomic) bool boolValue; /*! * The OFNumber as a signed char. */ @property (readonly, nonatomic) signed char charValue; /*! * The OFNumber as a signed short. */ @property (readonly, nonatomic) signed short shortValue; /*! * The OFNumber as a signed int. */ @property (readonly, nonatomic) signed int intValue; /*! * The OFNumber as a signed long. */ @property (readonly, nonatomic) signed long longValue; /*! * The OFNumber as a signed long long. */ @property (readonly, nonatomic) signed long long longLongValue; /*! * The OFNumber as an unsigned char. */ @property (readonly, nonatomic) unsigned char unsignedCharValue; /*! * The OFNumber as an unsigned short. */ @property (readonly, nonatomic) unsigned short unsignedShortValue; /*! * The OFNumber as an unsigned int. */ @property (readonly, nonatomic) unsigned int unsignedIntValue; /*! * The OFNumber as an unsigned long. */ @property (readonly, nonatomic) unsigned long unsignedLongValue; /*! * The OFNumber as an unsigned long long. */ @property (readonly, nonatomic) unsigned long long unsignedLongLongValue; /*! * The OFNumber as an int8_t. */ @property (readonly, nonatomic) int8_t int8Value; /*! * The OFNumber as an int16_t. */ @property (readonly, nonatomic) int16_t int16Value; /*! * The OFNumber as an int32_t. */ @property (readonly, nonatomic) int32_t int32Value; /*! * The OFNumber as an int64_t. */ @property (readonly, nonatomic) int64_t int64Value; /*! * The OFNumber as a uint8_t. */ @property (readonly, nonatomic) uint8_t uInt8Value; /*! * The OFNumber as a uint16_t. */ @property (readonly, nonatomic) uint16_t uInt16Value; /*! * The OFNumber as a uint32_t. */ @property (readonly, nonatomic) uint32_t uInt32Value; /*! * The OFNumber as a uint64_t. */ @property (readonly, nonatomic) uint64_t uInt64Value; /*! * The OFNumber as a size_t. */ @property (readonly, nonatomic) size_t sizeValue; /*! * The OFNumber as an ssize_t. */ @property (readonly, nonatomic) ssize_t sSizeValue; /*! * The OFNumber as an intmax_t. */ @property (readonly, nonatomic) intmax_t intMaxValue; /*! * The OFNumber as a uintmax_t. */ @property (readonly, nonatomic) uintmax_t uIntMaxValue; /*! * The OFNumber as a ptrdiff_t. */ @property (readonly, nonatomic) ptrdiff_t ptrDiffValue; /*! * The OFNumber as an intptr_t. */ @property (readonly, nonatomic) intptr_t intPtrValue; /*! * The OFNumber as a uintptr_t. */ @property (readonly, nonatomic) uintptr_t uIntPtrValue; /*! * The OFNumber as a float. */ @property (readonly, nonatomic) float floatValue; /*! * The OFNumber as a double. */ @property (readonly, nonatomic) double doubleValue; /*! * @brief Creates a new OFNumber with the specified bool. * * @param bool_ A bool which the OFNumber should contain * @return A new autoreleased OFNumber */ + (instancetype)numberWithBool: (bool)bool_; |
︙ | ︙ | |||
614 615 616 617 618 619 620 | /*! * @brief Initializes an already allocated OFNumber with the specified double. * * @param double_ A double which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithDouble: (double)double_; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 | /*! * @brief Initializes an already allocated OFNumber with the specified double. * * @param double_ A double which the OFNumber should contain * @return An initialized OFNumber */ - (instancetype)initWithDouble: (double)double_; @end OF_ASSUME_NONNULL_END #if !defined(NSINTEGER_DEFINED) && !__has_feature(modules) /* Required for number literals to work */ @compatibility_alias NSNumber OFNumber; #endif |
Modified src/OFObject+Serialization.h from [26f370712f] to [f8a88520ac].
︙ | ︙ | |||
26 27 28 29 30 31 32 | extern int _OFObject_Serialization_reference; #ifdef __cplusplus } #endif @interface OFObject (OFSerialization) /*! | < < | | | 26 27 28 29 30 31 32 33 34 35 36 37 38 | extern int _OFObject_Serialization_reference; #ifdef __cplusplus } #endif @interface OFObject (OFSerialization) /*! * The object serialized as a string. */ @property (readonly, nonatomic) OFString *stringBySerializing; @end OF_ASSUME_NONNULL_END |
Modified src/OFObject.h from [39e5e50197] to [1f2c48e5a0].
︙ | ︙ | |||
195 196 197 198 199 200 201 | /*! * @protocol OFObject OFObject.h ObjFW/OFObject.h * * @brief The protocol which all root classes implement. */ @protocol OFObject /*! | | > > | > | | > > > > > > > > > > | > > | > | > > > | > > > > | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | /*! * @protocol OFObject OFObject.h ObjFW/OFObject.h * * @brief The protocol which all root classes implement. */ @protocol OFObject /*! * The class of the object. */ @property (readonly, nonatomic) Class class; /*! * The superclass of the object. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) Class superclass; /*! * A 32 bit hash for the object. * * Classes containing data (like strings, arrays, lists etc.) should reimplement * this! * * @warning If you reimplement this, you also need to reimplement @ref isEqual: * to behave in a way compatible to your reimplementation of this * method! */ @property (readonly, nonatomic) uint32_t hash; /*! * The retain count. */ @property (readonly, nonatomic) unsigned int retainCount; /*! * Whether the object is a proxy object. */ @property (readonly, nonatomic) bool isProxy; /*! * Whether the object allows weak references. */ @property (readonly, nonatomic) bool allowsWeakReference; /*! * @brief Returns a boolean whether the object of the specified kind. * * @param class_ The class whose kind is checked * @return A boolean whether the object is of the specified kind */ |
︙ | ︙ | |||
334 335 336 337 338 339 340 | * return the same hash for objects which are equal! * * @param object The object which should be tested for equality * @return A boolean whether the object is equal to the specified object */ - (bool)isEqual: (nullable id)object; | < < < < < < < < < < < < < < < < < < < < < | 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 | * return the same hash for objects which are equal! * * @param object The object which should be tested for equality * @return A boolean whether the object is equal to the specified object */ - (bool)isEqual: (nullable id)object; /*! * @brief Increases the retain count. * * Each time an object is released, the retain count gets decreased and the * object deallocated if it reaches 0. */ - (instancetype)retain; /*! * @brief Decreases the retain count. * * Each time an object is released, the retain count gets decreased and the * object deallocated if it reaches 0. */ - (void)release; |
︙ | ︙ | |||
386 387 388 389 390 391 392 | /*! * @brief Returns the receiver. * * @return The receiver */ - (instancetype)self; | < < < < < < < < < < < < < < | 388 389 390 391 392 393 394 395 396 397 398 399 400 401 | /*! * @brief Returns the receiver. * * @return The receiver */ - (instancetype)self; /*! * @brief Retain a weak reference to this object. * * @return Whether a weak reference to this object has been retained */ - (bool)retainWeakReference; @end |
︙ | ︙ | |||
424 425 426 427 428 429 430 431 432 433 434 435 436 437 | #ifndef __clang_analyzer__ Class _isa; #else Class _isa __attribute__((__unused__)); #endif } /*! * @brief A method which is called once when the class is loaded into the * runtime. * * Derived classes can override this to execute their own code when the class * is loaded. */ | > > > > > > > > > > > > > | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | #ifndef __clang_analyzer__ Class _isa; #else Class _isa __attribute__((__unused__)); #endif } /*! * The name of the object's class. */ @property (readonly, nonatomic) OFString *className; /*! * A description for the object. * * This is used when the object is used in a format string and for debugging * purposes. */ @property (readonly, nonatomic) OFString *description; /*! * @brief A method which is called once when the class is loaded into the * runtime. * * Derived classes can override this to execute their own code when the class * is loaded. */ |
︙ | ︙ | |||
648 649 650 651 652 653 654 | * * @param selector The selector for which the method signature should be * returned * @return The method signature for the specified selector */ - (nullable OFMethodSignature *)methodSignatureForSelector: (SEL)selector; | < < < < < < < < < < < < < < < < | 649 650 651 652 653 654 655 656 657 658 659 660 661 662 | * * @param selector The selector for which the method signature should be * returned * @return The method signature for the specified selector */ - (nullable OFMethodSignature *)methodSignatureForSelector: (SEL)selector; /*! * @brief Allocates memory and stores it in the object's memory pool. * * It will be freed automatically when the object is deallocated. * * @param size The size of the memory to allocate * @return A pointer to the allocated memory. May return NULL if the specified |
︙ | ︙ |
Modified src/OFOptionsParser.h from [77474cff80] to [c6cbbc43b2].
︙ | ︙ | |||
105 106 107 108 109 110 111 112 113 114 115 116 117 118 | /*! * The argument for the last parsed option, or `nil` if the last parsed option * takes no argument. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *argument; /*! * @brief Creates a new OFOptionsParser which accepts the specified options. * * @param options An array of @ref of_options_parser_option_t specifying all * accepted options, terminated with an option whose short * option is `\0` and long option is `nil`. * | > > > > > > | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | /*! * The argument for the last parsed option, or `nil` if the last parsed option * takes no argument. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *argument; /*! * The arguments following the last option. */ @property (readonly, nonatomic) OFArray OF_GENERIC(OFString *) *remainingArguments; /*! * @brief Creates a new OFOptionsParser which accepts the specified options. * * @param options An array of @ref of_options_parser_option_t specifying all * accepted options, terminated with an option whose short * option is `\0` and long option is `nil`. * |
︙ | ︙ | |||
150 151 152 153 154 155 156 | * @note You need to call @ref nextOption repeatedly until it returns `\0` to * make sure all options have been parsed, even if you only rely on the * optional pointers specified and don't do any parsing yourself. * * @return The next option */ - (of_unichar_t)nextOption; | < < < < < < < | 156 157 158 159 160 161 162 163 164 165 | * @note You need to call @ref nextOption repeatedly until it returns `\0` to * make sure all options have been parsed, even if you only rely on the * optional pointers specified and don't do any parsing yourself. * * @return The next option */ - (of_unichar_t)nextOption; @end OF_ASSUME_NONNULL_END |
Modified src/OFSerialization.h from [678a1fbe4d] to [4ac25035a0].
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | /*! * @protocol OFSerialization OFSerialization.h ObjFW/OFSerialization.h * * @brief A protocol for serializing objects. */ @protocol OFSerialization /*! * @brief Initializes the object with the specified XML element serialization. * * @param element An OFXMLElement with the serialized object * @return An initialized object */ - (instancetype)initWithSerialization: (OFXMLElement *)element; | > > > > > < < < < < < < | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | /*! * @protocol OFSerialization OFSerialization.h ObjFW/OFSerialization.h * * @brief A protocol for serializing objects. */ @protocol OFSerialization /*! * The object serialized into an XML element. */ @property (readonly, nonatomic) OFXMLElement *XMLElementBySerializing; /*! * @brief Initializes the object with the specified XML element serialization. * * @param element An OFXMLElement with the serialized object * @return An initialized object */ - (instancetype)initWithSerialization: (OFXMLElement *)element; @end OF_ASSUME_NONNULL_END |
Modified src/OFSet.h from [6c82eb5230] to [62a20daa00].
︙ | ︙ | |||
61 62 63 64 65 66 67 68 69 70 71 72 73 74 | * objects in a set breaks the internal representation of the set! */ @interface OFSet OF_GENERIC(ObjectType): OFObject <OFCollection, OFCopying, OFMutableCopying, OFSerialization> #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif /*! * @brief Creates a new set. * * @return A new, autoreleased set */ + (instancetype)set; | > > > > > > > > > > | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | * objects in a set breaks the internal representation of the set! */ @interface OFSet OF_GENERIC(ObjectType): OFObject <OFCollection, OFCopying, OFMutableCopying, OFSerialization> #if !defined(OF_HAVE_GENERICS) && !defined(DOXYGEN) # define ObjectType id #endif /*! * An array of all objects in the set. */ @property (readonly, nonatomic) OFArray OF_GENERIC(ObjectType) *allObjects; /*! * @return An arbitrary object in the set. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) ObjectType anyObject; /*! * @brief Creates a new set. * * @return A new, autoreleased set */ + (instancetype)set; |
︙ | ︙ | |||
190 191 192 193 194 195 196 | * specified set. * * @param set The set to create the union with */ - (OFSet OF_GENERIC(ObjectType) *)setByAddingSet: (OFSet OF_GENERIC(ObjectType) *)set; | < < < < < < < < < < < < < < | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | * specified set. * * @param set The set to create the union with */ - (OFSet OF_GENERIC(ObjectType) *)setByAddingSet: (OFSet OF_GENERIC(ObjectType) *)set; /*! * @brief Checks whether the set contains an object equal to the specified * object. * * @param object The object which is checked for being in the set * @return A boolean whether the set contains the specified object */ |
︙ | ︙ | |||
244 245 246 247 248 249 250 | * * @param value The value for the specified key * @param key The key of the value to set */ - (void)setValue: (id)value forKey: (OFString *)key; | < < < < < < < | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | * * @param value The value for the specified key * @param key The key of the value to set */ - (void)setValue: (id)value forKey: (OFString *)key; #ifdef OF_HAVE_BLOCKS /*! * @brief Executes a block for each object in the set. * * @param block The block to execute for each object in the set */ - (void)enumerateObjectsUsingBlock: (of_set_enumeration_block_t)block; |
︙ | ︙ |
Modified src/OFStdIOStream.h from [4a5715f270] to [32be342324].
︙ | ︙ | |||
42 43 44 45 46 47 48 | #else BPTR _handle; bool _closable; #endif bool _atEndOfStream; } | < < < < | | | < < | | > | > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #else BPTR _handle; bool _closable; #endif bool _atEndOfStream; } /*! * The number of columns, or -1 if there is no underlying terminal or the * number of columns could not be queried. */ @property (readonly, nonatomic) int columns; /*! * The number of rows, or -1 if there is no underlying terminal or the number * of rows could not be queried */ @property (readonly, nonatomic) int rows; - (instancetype)init OF_UNAVAILABLE; @end #ifdef __cplusplus extern "C" { #endif /*! @file */ |
︙ | ︙ |
Modified src/OFStream.h from [af410db94f] to [7eb7553262].
︙ | ︙ | |||
118 119 120 121 122 123 124 | size_t _readBufferLength, _writeBufferLength; bool _writeBuffered, _waitingForDelimiter; @protected bool _blocking; } /*! | | > > | > > > > | > > > | > > > > > > > > > > > > > > > > > | 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | size_t _readBufferLength, _writeBufferLength; bool _writeBuffered, _waitingForDelimiter; @protected bool _blocking; } /*! * Whether the end of the stream has been reached. */ @property (readonly, nonatomic, getter=isAtEndOfStream) bool atEndOfStream; /*! * Whether writes are buffered. */ @property (nonatomic, nonatomic, getter=isWriteBuffered) bool writeBuffered; /*! * Whether data is present in the internal read buffer. */ @property (readonly, nonatomic) bool hasDataInReadBuffer; /*! * Whether the stream is in blocking mode. * * By default, a stream is in blocking mode. * On Win32, setting this currently only works for sockets! */ @property (readonly, nonatomic, getter=isBlocking) bool blocking; /*! * The file descriptor for the read end of the stream. */ @property (readonly, nonatomic) int fileDescriptorForReading; /*! * The file descriptor for the write end of the stream. */ @property (readonly, nonatomic) int fileDescriptorForWriting; /*! * @brief Reads *at most* size bytes from the stream into a buffer. * * On network streams, this might read less than the specified number of bytes. * If you want to read exactly the specified number of bytes, use * @ref readIntoBuffer:exactLength:. Note that a read can even return 0 bytes - |
︙ | ︙ | |||
773 774 775 776 777 778 779 | * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ - (nullable OFString *)tryReadTillDelimiter: (OFString *)delimiter encoding: (of_string_encoding_t)encoding; | < < < < < < < < < < < < < < | 799 800 801 802 803 804 805 806 807 808 809 810 811 812 | * @param encoding The encoding used by the stream * @return The line that was read, autoreleased, or `nil` if the end of the * stream has been reached. */ - (nullable OFString *)tryReadTillDelimiter: (OFString *)delimiter encoding: (of_string_encoding_t)encoding; /*! * @brief Writes everything in the write buffer to the stream. */ - (void)flushWriteBuffer; /*! * @brief Writes from a buffer into the stream. |
︙ | ︙ | |||
1121 1122 1123 1124 1125 1126 1127 | * @param format A string used as format * @param arguments The arguments used in the format string * @return The number of bytes written */ - (size_t)writeFormat: (OFConstantString *)format arguments: (va_list)arguments; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 | * @param format A string used as format * @param arguments The arguments used in the format string * @return The number of bytes written */ - (size_t)writeFormat: (OFConstantString *)format arguments: (va_list)arguments; #ifdef OF_HAVE_SOCKETS /*! * @brief Cancels all pending asynchronous requests on the stream. */ - (void)cancelAsyncRequests; #endif |
︙ | ︙ |
Modified src/OFString+CryptoHashing.h from [f63a3a4a9b] to [60e0201519].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFString_CryptoHashing_reference; #ifdef __cplusplus } #endif @interface OFString (CryptoHashing) /*! | < < | | < < | | < < | | < < | | < < | | < < | | < < | | | 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | extern int _OFString_CryptoHashing_reference; #ifdef __cplusplus } #endif @interface OFString (CryptoHashing) /*! * The MD5 hash of the string as a string. */ @property (readonly, nonatomic) OFString *MD5Hash; /*! * The RIPEMD-160 hash of the string as a string. */ @property (readonly, nonatomic) OFString *RIPEMD160Hash; /*! * The SHA-1 hash of the string as a string. */ @property (readonly, nonatomic) OFString *SHA1Hash; /*! * The SHA-224 hash of the string as a string. */ @property (readonly, nonatomic) OFString *SHA224Hash; /*! * The SHA-256 hash of the string as a string. */ @property (readonly, nonatomic) OFString *SHA256Hash; /*! * The SHA-384 hash of the string as a string. */ @property (readonly, nonatomic) OFString *SHA384Hash; /*! * The SHA-512 hash of the string as a string. */ @property (readonly, nonatomic) OFString *SHA512Hash; @end OF_ASSUME_NONNULL_END |
Modified src/OFString+JSONValue.h from [e98963daf6] to [1672f0f914].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFString_JSONValue_reference; #ifdef __cplusplus } #endif @interface OFString (JSONValue) /*! | | < < | | 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 51 52 | extern int _OFString_JSONValue_reference; #ifdef __cplusplus } #endif @interface OFString (JSONValue) /*! * The string interpreted as JSON and parsed as an object. * * @note This also allows parsing JSON5, an extension of JSON. See * http://json5.org/ for more details. * * @warning Although not specified by the JSON specification, this can also * return primitives like strings and numbers. The rationale behind * this is that most JSON parsers allow JSON data just consisting of a * single primitive, leading to real world JSON files sometimes only * consisting of a single primitive. Therefore, you should not make any * assumptions about the object returned by this method if you don't * want your program to terminate due to a message not understood, but * instead check the returned object using @ref isKindOfClass:. */ @property (readonly, nonatomic) id JSONValue; /*! * @brief Creates an object from the JSON value of the string. * * @note This also allows parsing JSON5, an extension of JSON. See * http://json5.org/ for more details. * |
︙ | ︙ |
Modified src/OFString+Serialization.h from [ced555ab9d] to [76573f3900].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFString_Serialization_reference; #ifdef __cplusplus } #endif @interface OFString (Serialization) /*! | | < < | | 24 25 26 27 28 29 30 31 32 33 34 35 36 | extern int _OFString_Serialization_reference; #ifdef __cplusplus } #endif @interface OFString (Serialization) /*! * The string interpreted as serialization and parsed as an object. */ @property (readonly, nonatomic) id objectByDeserializing; @end OF_ASSUME_NONNULL_END |
Modified src/OFString+URLEncoding.h from [f16f9f6de1] to [c9eff89f3c].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFString_URLEncoding_reference; #ifdef __cplusplus } #endif @interface OFString (URLEncoding) /*! | | | > | > > | < < < < < < < | 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 51 | extern int _OFString_URLEncoding_reference; #ifdef __cplusplus } #endif @interface OFString (URLEncoding) /*! * The string as an URL encoded string for use in a URL. */ @property (readonly, nonatomic) OFString *stringByURLEncoding; /*! * The string as an URL decoded string. */ @property (readonly, nonatomic) OFString *stringByURLDecoding; /*! * @brief Encodes a string for use in a URL, but does not escape the specified * ignored characters. * * @param allowed A C string of characters that should not be escaped * * @return A new autoreleased string */ - (OFString *)stringByURLEncodingWithAllowedCharacters: (const char *)allowed; @end OF_ASSUME_NONNULL_END |
Modified src/OFString+XMLEscaping.h from [54cf47bc37] to [6735941add].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFString_XMLEscaping_reference; #ifdef __cplusplus } #endif @interface OFString (XMLEscaping) /*! | | < < | | 24 25 26 27 28 29 30 31 32 33 34 35 36 | extern int _OFString_XMLEscaping_reference; #ifdef __cplusplus } #endif @interface OFString (XMLEscaping) /*! * The string in a form escaped for use in an XML document. */ @property (readonly, nonatomic) OFString *stringByXMLEscaping; @end OF_ASSUME_NONNULL_END |
Modified src/OFString+XMLUnescaping.h from [48a186039b] to [8f5669758e].
︙ | ︙ | |||
62 63 64 65 66 67 68 | */ - (nullable OFString *)string: (OFString *)string containsUnknownEntityNamed: (OFString *)entity; @end @interface OFString (XMLUnescaping) /*! | | | | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | */ - (nullable OFString *)string: (OFString *)string containsUnknownEntityNamed: (OFString *)entity; @end @interface OFString (XMLUnescaping) /*! * The string with XML entities unescapted. */ @property (readonly, nonatomic) OFString *stringByXMLUnescaping; /*! * @brief Unescapes XML in the string and uses the specified delegate for * unknown entities. * * @param delegate An OFXMLUnescapingDelegate as a handler for unknown entities */ |
︙ | ︙ |
Modified src/OFString.h from [54b5ea6d82] to [37d4036ea2].
︙ | ︙ | |||
109 110 111 112 113 114 115 116 117 118 119 120 121 122 | /*! * @class OFString OFString.h ObjFW/OFString.h * * @brief A class for handling strings. */ @interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing, OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation> /*! * @brief Creates a new OFString. * * @return A new, autoreleased OFString */ + (instancetype)string; | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | /*! * @class OFString OFString.h ObjFW/OFString.h * * @brief A class for handling strings. */ @interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing, OFSerialization, OFJSONRepresentation, OFMessagePackRepresentation> /*! * The length of the string in Unicode codepoints. */ @property (readonly, nonatomic) size_t length; /*! * The OFString as a UTF-8 encoded C string. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. */ @property (readonly, nonatomic) const char *UTF8String OF_RETURNS_INNER_POINTER; /*! * The number of bytes the string needs in UTF-8 encoding. */ @property (readonly, nonatomic) size_t UTF8StringLength; /*! * The components of the string when interpreted as a path. */ @property (readonly, nonatomic) OFArray OF_GENERIC(OFString *) *pathComponents; /*! * The last path component of the string when interpreted as a path. */ @property (readonly, nonatomic) OFString *lastPathComponent; /*! * The file extension of string when interpreted as a path. */ @property (readonly, nonatomic) OFString *pathExtension; /*! * The string in uppercase. */ @property (readonly, nonatomic) OFString *uppercaseString; /*! * The string in lowercase. */ @property (readonly, nonatomic) OFString *lowercaseString; /*! * The string in capitalized form. * * @note This only considers spaces, tabs and newlines to be word delimiters! * Also note that this might change in the future to all word delimiters * specified by Unicode! */ @property (readonly, nonatomic) OFString *capitalizedString; /*! * The decimal value of the string as an `intmax_t`. * * Leading and trailing whitespaces are ignored. * * If the string contains any non-number characters, an * @ref OFInvalidEncodingException is thrown. * * If the number is too big to fit into an `intmax_t`, an * @ref OFOutOfRangeException is thrown. */ @property (readonly, nonatomic) intmax_t decimalValue; /*! * The hexadecimal value of the string as an `uintmax_t`. * * Leading and trailing whitespaces are ignored. * * If the string contains any non-number characters, an * @ref OFInvalidEncodingException is thrown. * * If the number is too big to fit into an `uintmax_t`, an * @ref OFOutOfRangeException is thrown. */ @property (readonly, nonatomic) uintmax_t hexadecimalValue; /*! * The octal value of the string as an `uintmax_t`. * * Leading and trailing whitespaces are ignored. * * If the string contains any non-number characters, an * @ref OFInvalidEncodingException is thrown. * * If the number is too big to fit into an `uintmax_t`, an * @ref OFOutOfRangeException is thrown. */ @property (readonly, nonatomic) uintmax_t octalValue; /*! * The float value of the string as a float. * * If the string contains any non-number characters, an * @ref OFInvalidEncodingException is thrown. */ @property (readonly, nonatomic) float floatValue; /*! * The double value of the string as a double. * * If the string contains any non-number characters, an * OFInvalidEncodingException is thrown. */ @property (readonly, nonatomic) double doubleValue; /*! * The directory name of the string when interpreted as a path. */ @property (readonly, nonatomic) OFString *stringByDeletingLastPathComponent; /*! * The string with the file extension of the path removed. */ @property (readonly, nonatomic) OFString *stringByDeletingPathExtension; /*! * The string interpreted as a path with relative sub paths resolved. */ @property (readonly, nonatomic) OFString *stringByStandardizingPath; /*! * The string interpreted as a URL path with relative sub paths resolved. * * This works similar to @ref stringByStandardizingPath, but is intended for * standardization of paths that are part of a URL. */ @property (readonly, nonatomic) OFString *stringByStandardizingURLPath; /*! * The string as an array of Unicode characters. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. */ @property (readonly, nonatomic) const of_unichar_t *characters OF_RETURNS_INNER_POINTER; /*! * The string in UTF-16 encoding with native byte order. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. */ @property (readonly, nonatomic) const char16_t *UTF16String OF_RETURNS_INNER_POINTER; /*! * The length of the string in UTF-16 characters. */ @property (readonly, nonatomic) size_t UTF16StringLength; /*! * The string in UTF-32 encoding with native byte order. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. */ @property (readonly, nonatomic) const char32_t *UTF32String OF_RETURNS_INNER_POINTER; /*! * The string with leading whitespaces deleted. */ @property (readonly, nonatomic) OFString *stringByDeletingLeadingWhitespaces; /*! * The string with trailing whitespaces deleted. */ @property (readonly, nonatomic) OFString *stringByDeletingTrailingWhitespaces; /*! * The string with leading and trailing whitespaces deleted. */ @property (readonly, nonatomic) OFString *stringByDeletingEnclosingWhitespaces; #ifdef OF_HAVE_UNICODE_TABLES /*! * The string in Unicode Normalization Form D (NFD). */ @property (readonly, nonatomic) OFString *decomposedStringWithCanonicalMapping; /*! * The string in Unicode Normalization Form KD (NFKD). */ @property (readonly, nonatomic) OFString *decomposedStringWithCompatibilityMapping; #endif /*! * @brief Creates a new OFString. * * @return A new, autoreleased OFString */ + (instancetype)string; |
︙ | ︙ | |||
667 668 669 670 671 672 673 | * * @param encoding The encoding for the C string * @return The OFString as a C string in the specified encoding */ - (const char *)lossyCStringWithEncoding: (of_string_encoding_t)encoding OF_RETURNS_INNER_POINTER; | < < < < < < < < < < < < < < < < < < < < < < < < < | 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 | * * @param encoding The encoding for the C string * @return The OFString as a C string in the specified encoding */ - (const char *)lossyCStringWithEncoding: (of_string_encoding_t)encoding OF_RETURNS_INNER_POINTER; /*! * @brief Returns the number of bytes the string needs in the specified * encoding. * * @param encoding The encoding for the string * @return The number of bytes the string needs in the specified encoding. */ - (size_t)cStringLengthWithEncoding: (of_string_encoding_t)encoding; /*! * @brief Compares the OFString to another OFString without caring about the * case. * * @param otherString A string to compare with * @return An of_comparison_result_t */ |
︙ | ︙ | |||
855 856 857 858 859 860 861 | * @return A new string with the occurrences of the specified string replaced */ - (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string withString: (OFString *)replacement options: (int)options range: (of_range_t)range; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | * @return A new string with the occurrences of the specified string replaced */ - (OFString *)stringByReplacingOccurrencesOfString: (OFString *)string withString: (OFString *)replacement options: (int)options range: (of_range_t)range; /*! * @brief Checks whether the string has the specified prefix. * * @param prefix The prefix to check for * @return A boolean whether the string has the specified prefix */ - (bool)hasPrefix: (OFString *)prefix; |
︙ | ︙ | |||
942 943 944 945 946 947 948 | * `OF_STRING_SKIP_EMPTY` | Skip empty components * @return An autoreleased OFArray with the separated string */ - (OFArray OF_GENERIC(OFString *) *) componentsSeparatedByString: (OFString *)delimiter options: (int)options; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 | * `OF_STRING_SKIP_EMPTY` | Skip empty components * @return An autoreleased OFArray with the separated string */ - (OFArray OF_GENERIC(OFString *) *) componentsSeparatedByString: (OFString *)delimiter options: (int)options; /*! * @brief Returns the string in UTF-16 encoding with the specified byte order. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. * * @param byteOrder The byte order for the UTF-16 encoding * @return The string in UTF-16 encoding with the specified byte order */ - (const char16_t *)UTF16StringWithByteOrder: (of_byte_order_t)byteOrder OF_RETURNS_INNER_POINTER; /*! * @brief Returns the string in UTF-32 encoding with the specified byte order. * * The result is valid until the autorelease pool is released. If you want to * use the result outside the scope of the current autorelease pool, you have to * copy it. * |
︙ | ︙ | |||
1133 1134 1135 1136 1137 1138 1139 | * @brief Returns the string as OFData with the specified encoding. * * @param encoding The encoding to use for the returned OFData * @return The string as OFData with the specified encoding */ - (OFData *)dataWithEncoding: (of_string_encoding_t)encoding; | < < < < < < < < < < < < < < < < | 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 | * @brief Returns the string as OFData with the specified encoding. * * @param encoding The encoding to use for the returned OFData * @return The string as OFData with the specified encoding */ - (OFData *)dataWithEncoding: (of_string_encoding_t)encoding; #ifdef OF_HAVE_FILES /*! * @brief Writes the string into the specified file using UTF-8 encoding. * * @param path The path of the file to write to */ - (void)writeToFile: (OFString *)path; |
︙ | ︙ |
Modified src/OFTCPSocket.h from [a227914da5] to [710f0fdfb9].
︙ | ︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 | OFString *_Nullable _SOCKS5Host; uint16_t _SOCKS5Port; #ifdef OF_WII uint16_t _port; #endif } /*! * The host to use as a SOCKS5 proxy. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *SOCKS5Host; /*! * The port to use on the SOCKS5 proxy. | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | OFString *_Nullable _SOCKS5Host; uint16_t _SOCKS5Port; #ifdef OF_WII uint16_t _port; #endif } /*! * Whether the socket is a listening socket. */ @property (readonly, nonatomic, getter=isListening) bool listening; /*! * The remote address as a string * * @note This only works for accepted sockets! */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *remoteAddress; #if !defined(OF_WII) && !defined(OF_NINTENDO_3DS) /*! * Whether keep alives are enabled for the connection. * * @warning This is not available on the Wii or Nintendo 3DS! */ @property (nonatomic, getter=isKeepAliveEnabled) bool keepAliveEnabled; #endif #ifndef OF_WII /*! * Whether TCP_NODELAY is enabled for the connection * * @warning This is not available on the Wii! */ @property (nonatomic, getter=isTCPNoDelayEnabled) bool TCPNoDelayEnabled; #endif /*! * The host to use as a SOCKS5 proxy. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *SOCKS5Host; /*! * The port to use on the SOCKS5 proxy. |
︙ | ︙ | |||
203 204 205 206 207 208 209 | * * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ - (void)asyncAcceptWithBlock: (of_tcp_socket_async_accept_block_t)block; #endif | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | * * @param block The block to execute when a new connection has been accepted. * Returns whether the next incoming connection should be accepted * by the specified block as well. */ - (void)asyncAcceptWithBlock: (of_tcp_socket_async_accept_block_t)block; #endif @end #ifdef __cplusplus extern "C" { #endif extern Class _Nullable of_tls_socket_class; #ifdef __cplusplus } #endif OF_ASSUME_NONNULL_END |
Modified src/OFTarArchive.h from [c8036d2b06] to [e55df33ec2].
︙ | ︙ | |||
34 35 36 37 38 39 40 41 42 43 44 45 46 47 | OF_TAR_ARCHIVE_MODE_READ, OF_TAR_ARCHIVE_MODE_WRITE, OF_TAR_ARCHIVE_MODE_APPEND } _mode; OF_KINDOF(OFStream *) _Nullable _lastReturnedStream; } /*! * @brief Creates a new OFTarArchive object with the specified stream. * * @param stream A stream from which the tar archive will be read. * For append mode, this needs to be an OFSeekableStream. * @param mode The mode for the tar file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing | > > > > > > > | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | OF_TAR_ARCHIVE_MODE_READ, OF_TAR_ARCHIVE_MODE_WRITE, OF_TAR_ARCHIVE_MODE_APPEND } _mode; OF_KINDOF(OFStream *) _Nullable _lastReturnedStream; } /*! * @return A stream for reading the current entry * * @note This is only available in read mode. */ @property (readonly, nonatomic) OFStream *streamForReadingCurrentEntry; /*! * @brief Creates a new OFTarArchive object with the specified stream. * * @param stream A stream from which the tar archive will be read. * For append mode, this needs to be an OFSeekableStream. * @param mode The mode for the tar file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing |
︙ | ︙ | |||
107 108 109 110 111 112 113 | * @ref OFWriteFailedException! * * @return The next entry from the tar archive or `nil` if all entries have * been read */ - (nullable OFTarArchiveEntry *)nextEntry; | < < < < < < < < < | 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | * @ref OFWriteFailedException! * * @return The next entry from the tar archive or `nil` if all entries have * been read */ - (nullable OFTarArchiveEntry *)nextEntry; /*! * @brief Returns a stream for writing the specified entry. * * @note This is only available in write and append mode. * * @warning Calling @ref nextEntry will invalidate all streams returned by * @ref streamForReadingCurrentEntry or |
︙ | ︙ |
Modified src/OFThread.h from [42f39cebaf] to [a03e0a91d4].
︙ | ︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | /*! * The block to execute in the thread. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) of_thread_block_t threadBlock; # endif /*! * @brief Creates a new thread. * * @return A new, autoreleased thread */ + (instancetype)thread; | > > > > > > > > > > > > > > > > > > > > > > > | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /*! * The block to execute in the thread. */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) of_thread_block_t threadBlock; # endif /*! * The run loop for the thread. */ @property (readonly, nonatomic) OFRunLoop *runLoop; /*! * The priority of the thread. * * @note This has to be set before the thread is started! * * This is a value between -1.0 (meaning lowest priority that still schedules) * and +1.0 (meaning highest priority that still allows getting preempted) * with normal priority being 0.0 (meaning being the same as the main thread). */ @property (nonatomic) float priority; /*! * The stack size of the thread. * * @note This has to be set before the thread is started! */ @property (nonatomic) size_t stackSize; /*! * @brief Creates a new thread. * * @return A new, autoreleased thread */ + (instancetype)thread; |
︙ | ︙ | |||
218 219 220 221 222 223 224 | /*! * @brief Joins a thread. * * @return The object returned by the main method of the thread. */ - (id)join; | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 241 242 243 244 245 246 247 248 249 250 251 252 253 | /*! * @brief Joins a thread. * * @return The object returned by the main method of the thread. */ - (id)join; #else - (instancetype)init OF_UNAVAILABLE; #endif @end OF_ASSUME_NONNULL_END |
Modified src/OFThreadPool.h from [eee48469e5] to [ddc1820eca].
︙ | ︙ | |||
48 49 50 51 52 53 54 55 56 57 58 59 60 61 | @public OFList *_queue; OFCondition *_queueCondition; volatile int _doneCount; OFCondition *_countCondition; } /*! * @brief Returns a new thread pool with one thread for each core in the system. * * @warning If for some reason the number of cores in the system could not be * determined, the pool will only have one thread! * * @return A new thread pool with one thread for each core in the system | > > > > > | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | @public OFList *_queue; OFCondition *_queueCondition; volatile int _doneCount; OFCondition *_countCondition; } /*! * The size of the thread pool. */ @property (readonly, nonatomic) size_t size; /*! * @brief Returns a new thread pool with one thread for each core in the system. * * @warning If for some reason the number of cores in the system could not be * determined, the pool will only have one thread! * * @return A new thread pool with one thread for each core in the system |
︙ | ︙ | |||
100 101 102 103 104 105 106 | - (void)dispatchWithBlock: (of_thread_pool_block_t)block; #endif /*! * @brief Waits until all jobs are done. */ - (void)waitUntilDone; | < < < < < < < | 105 106 107 108 109 110 111 112 113 114 | - (void)dispatchWithBlock: (of_thread_pool_block_t)block; #endif /*! * @brief Waits until all jobs are done. */ - (void)waitUntilDone; @end OF_ASSUME_NONNULL_END |
Modified src/OFTimer.h from [47d5c258ad] to [b9c72c484e].
︙ | ︙ | |||
73 74 75 76 77 78 79 80 81 82 83 84 85 86 | @property (readonly, nonatomic, getter=isRepeating) bool repeating; /*! * Whether the timer is valid. */ @property (readonly, nonatomic, getter=isValid) bool valid; /*! * @brief Creates and schedules a new timer with the specified time interval. * * @param timeInterval The time interval after which the timer should be fired * @param target The target on which to call the selector * @param selector The selector to call on the target * @param repeats Whether the timer repeats after it has been executed | > > > > > > > > > > | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | @property (readonly, nonatomic, getter=isRepeating) bool repeating; /*! * Whether the timer is valid. */ @property (readonly, nonatomic, getter=isValid) bool valid; /*! * The next date at which the timer will fire. * * If the timer is already scheduled in a run loop, it will be rescheduled. * Note that rescheduling is an expensive operation, though it still might be * preferable to reschedule instead of invalidating the timer and creating a * new one. */ @property (copy, nonatomic) OFDate *fireDate; /*! * @brief Creates and schedules a new timer with the specified time interval. * * @param timeInterval The time interval after which the timer should be fired * @param target The target on which to call the selector * @param selector The selector to call on the target * @param repeats Whether the timer repeats after it has been executed |
︙ | ︙ | |||
444 445 446 447 448 449 450 | /*! * @brief Fires the timer, meaning it will execute the specified selector on the * target. */ - (void)fire; | < < < < < < < < < < < < < < < < < < < | 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | /*! * @brief Fires the timer, meaning it will execute the specified selector on the * target. */ - (void)fire; /*! * @brief Invalidates the timer, preventing it from firing. */ - (void)invalidate; #ifdef OF_HAVE_THREADS /*! |
︙ | ︙ |
Modified src/OFURL.h from [6ad21dffff] to [cb95b72aba].
︙ | ︙ | |||
94 95 96 97 98 99 100 101 102 103 104 105 106 107 | @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *query; /*! * The fragment part of the URL. */ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *fragment; /*! * @brief Creates a new URL with the specified string. * * @param string A string describing a URL * @return A new, autoreleased OFURL */ + (instancetype)URLWithString: (OFString *)string; | > > > > > > > > > > > > > > > | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *query; /*! * The fragment part of the URL. */ @property OF_NULLABLE_PROPERTY (readonly, copy, nonatomic) OFString *fragment; /*! * The URL as a string. */ @property (readonly, nonatomic) OFString *string; /*! * The local file system representation for a file URL. * * @note This only exists for URLs with the file scheme and throws an exception * otherwise. * */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFString *fileSystemRepresentation; /*! * @brief Creates a new URL with the specified string. * * @param string A string describing a URL * @return A new, autoreleased OFURL */ + (instancetype)URLWithString: (OFString *)string; |
︙ | ︙ | |||
183 184 185 186 187 188 189 | * @param isDirectory Whether the path is a directory, in which case a slash is * appened if there is no slash yet * @return An Initialized OFURL */ + (instancetype)fileURLWithPath: (OFString *)path isDirectory: (bool)isDirectory; #endif | < < < < < < < < < < < < < < < < < | 198 199 200 201 202 203 204 205 206 207 208 209 | * @param isDirectory Whether the path is a directory, in which case a slash is * appened if there is no slash yet * @return An Initialized OFURL */ + (instancetype)fileURLWithPath: (OFString *)path isDirectory: (bool)isDirectory; #endif @end OF_ASSUME_NONNULL_END #import "OFMutableURL.h" |
Modified src/OFXMLElement+Serialization.h from [b12f08ceb4] to [befef63d14].
︙ | ︙ | |||
24 25 26 27 28 29 30 | extern int _OFXMLElement_Serialization_reference; #ifdef __cplusplus } #endif @interface OFXMLElement (OFSerialization) /*! | | < < | | 24 25 26 27 28 29 30 31 32 33 34 35 36 | extern int _OFXMLElement_Serialization_reference; #ifdef __cplusplus } #endif @interface OFXMLElement (OFSerialization) /*! * The XML element interpreted as serialization and parsed into an object. */ @property (readonly, nonatomic) id objectByDeserializing; @end OF_ASSUME_NONNULL_END |
Modified src/OFXMLElement.h from [0e0aeff41f] to [38861a1e42].
︙ | ︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 | #endif /*! * The default namespace for the element to be used if there is no parent. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *defaultNamespace; /*! * @brief Creates a new XML element with the specified name. * * @param name The name for the element * @return A new autoreleased OFXMLElement with the specified element name */ + (instancetype)elementWithName: (OFString *)name; | > > > > > > > > > > > > > > > > > | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #endif /*! * The default namespace for the element to be used if there is no parent. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *defaultNamespace; /*! * An array with the attributes of the element */ @property OF_NULLABLE_PROPERTY (readonly, nonatomic) OFArray OF_GENERIC(OFXMLAttribute *) *attributes; /*! * An array of OFXMLNodes with all children of the element. */ @property OF_NULLABLE_PROPERTY (nonatomic, copy) OFArray OF_GENERIC(OFXMLNode *) *children; /*! * All children that are elements. */ @property (readonly, nonatomic) OFArray OF_GENERIC(OFXMLElement *) *elements; /*! * @brief Creates a new XML element with the specified name. * * @param name The name for the element * @return A new autoreleased OFXMLElement with the specified element name */ + (instancetype)elementWithName: (OFString *)name; |
︙ | ︙ | |||
225 226 227 228 229 230 231 | * * @param prefix The prefix for the namespace * @param namespace_ The namespace for which the prefix is bound */ - (void)bindPrefix: (OFString *)prefix forNamespace: (OFString *)namespace_; | < < < < < < < | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 | * * @param prefix The prefix for the namespace * @param namespace_ The namespace for which the prefix is bound */ - (void)bindPrefix: (OFString *)prefix forNamespace: (OFString *)namespace_; /*! * @brief Adds the specified attribute. * * If an attribute with the same name and namespace already exists, it is not * added. * * @param attribute The attribute to add |
︙ | ︙ | |||
303 304 305 306 307 308 309 | * * @param attributeName The name of the attribute * @param attributeNS The namespace of the attribute */ - (void)removeAttributeForName: (OFString *)attributeName namespace: (nullable OFString *)attributeNS; | < < < < < < < < < < < < < < | 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | * * @param attributeName The name of the attribute * @param attributeNS The namespace of the attribute */ - (void)removeAttributeForName: (OFString *)attributeName namespace: (nullable OFString *)attributeNS; /*! * @brief Adds a child to the OFXMLElement. * * @param child An OFXMLNode which is added as a child */ - (void)addChild: (OFXMLNode *)child; |
︙ | ︙ | |||
375 376 377 378 379 380 381 | * * @param index The index of the child to replace * @param node The node to replace the child with */ - (void)replaceChildAtIndex: (size_t)index withNode: (OFXMLNode *)node; | < < < < < < < | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 | * * @param index The index of the child to replace * @param node The node to replace the child with */ - (void)replaceChildAtIndex: (size_t)index withNode: (OFXMLNode *)node; /*! * @brief Returns all children that have the specified namespace. * * @return All children that have the specified namespace */ - (OFArray OF_GENERIC(OFXMLElement *) *)elementsForNamespace: (nullable OFString *)elementNS; |
︙ | ︙ |
Modified src/OFXMLElement.m from [e09b35486d] to [fe80c58b63].
︙ | ︙ | |||
377 378 379 380 381 382 383 | { return [[_attributes copy] autorelease]; } - (void)setChildren: (OFArray *)children { OFArray *old = _children; | | | 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | { return [[_attributes copy] autorelease]; } - (void)setChildren: (OFArray *)children { OFArray *old = _children; _children = [children mutableCopy]; [old release]; } - (OFArray *)children { return [[_children copy] autorelease]; } |
︙ | ︙ |
Modified src/OFXMLNode.h from [2716730e4a] to [54f69129e9].
︙ | ︙ | |||
23 24 25 26 27 28 29 | /*! * @class OFXMLNode OFXMLNode.h ObjFW/OFXMLNode.h * * @brief A class which stores an XML element. */ @interface OFXMLNode: OFObject <OFCopying, OFSerialization> | < < < | > | | | < < < < < | | < < | < < < < < < < | < < | | < < | | | | | | > | 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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | /*! * @class OFXMLNode OFXMLNode.h ObjFW/OFXMLNode.h * * @brief A class which stores an XML element. */ @interface OFXMLNode: OFObject <OFCopying, OFSerialization> /*! * The contents of the node as a string value. * * For an @ref OFXMLElement, setting it removes all children and creates a * single child with the specified string value. */ @property (nonatomic, copy) OFString *stringValue; /*! * The contents of the receiver as a decimal value. */ @property (readonly, nonatomic) intmax_t decimalValue; /*! * The contents of the receiver as a hexadecimal value. */ @property (readonly, nonatomic) uintmax_t hexadecimalValue; /*! * The contents of the receiver as a float value. */ @property (readonly, nonatomic) float floatValue; /*! * The contents of the receiver as a double value. */ @property (readonly, nonatomic) double doubleValue; /*! * A string representing the node as an XML string. */ @property (readonly, nonatomic) OFString *XMLString; - (instancetype)init OF_UNAVAILABLE; - (instancetype)initWithSerialization: (OFXMLElement *)element OF_UNAVAILABLE; /*! * @brief Returns an OFString representing the OFXMLNode as an XML string with * indentation. * * @param indentation The indentation for the XML string * @return An OFString representing the OFXMLNode as an XML string with |
︙ | ︙ |
Modified src/OFXMLParser.h from [789b07e235] to [42011eb439].
︙ | ︙ | |||
175 176 177 178 179 180 181 182 183 184 185 186 187 188 | /*! * The delegate that is used by the XML parser. */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id <OFXMLParserDelegate> delegate; /*! * The depth limit for the XML parser. * * If the depth limit is exceeded, an OFMalformedXMLException is thrown. * * The default is 32. 0 means unlimited (insecure!). */ | > > > > > > > > > > | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | /*! * The delegate that is used by the XML parser. */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id <OFXMLParserDelegate> delegate; /*! * The current line number. */ @property (readonly, nonatomic) size_t lineNumber; /*! * @return Whether the XML parser has finished parsing. */ @property (readonly, nonatomic) bool hasFinishedParsing; /*! * The depth limit for the XML parser. * * If the depth limit is exceeded, an OFMalformedXMLException is thrown. * * The default is 32. 0 means unlimited (insecure!). */ |
︙ | ︙ | |||
222 223 224 225 226 227 228 | /*! * @brief Parses the specified file. * * @param path The path to the file to parse */ - (void)parseFile: (OFString *)path; #endif | < < < < < < < < < < < < < < | 232 233 234 235 236 237 238 239 240 241 | /*! * @brief Parses the specified file. * * @param path The path to the file to parse */ - (void)parseFile: (OFString *)path; #endif @end OF_ASSUME_NONNULL_END |
Modified src/OFZIPArchive.h from [f753feb424] to [29c18aa319].
︙ | ︙ | |||
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | } /*! * The archive comment. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *archiveComment; /*! * @brief Creates a new OFZIPArchive object with the specified stream. * * @param stream A stream from which the ZIP archive will be read. * For read and append mode, this needs to be an OFSeekableStream. * @param mode The mode for the ZIP file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing | > > > > > > > > > > > | 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | } /*! * The archive comment. */ @property OF_NULLABLE_PROPERTY (copy, nonatomic) OFString *archiveComment; /*! * The entries in the central directory of the archive as an array of objects * of class @ref OFZIPArchiveEntry. * * The objects of the array have the same order as the entries in the central * directory, which does not need to be the order in which the actual files are * stored. */ @property (readonly, nonatomic) OFArray OF_GENERIC(OFZIPArchiveEntry *) *entries; /*! * @brief Creates a new OFZIPArchive object with the specified stream. * * @param stream A stream from which the ZIP archive will be read. * For read and append mode, this needs to be an OFSeekableStream. * @param mode The mode for the ZIP file. Valid modes are "r" for reading, * "w" for creating a new file and "a" for appending to an existing |
︙ | ︙ | |||
109 110 111 112 113 114 115 | * archive. * @return An initialized OFZIPArchive */ - (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode; #endif | < < < < < < < < < < < < | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | * archive. * @return An initialized OFZIPArchive */ - (instancetype)initWithPath: (OFString *)path mode: (OFString *)mode; #endif /*! * @brief Returns a stream for reading the specified file from the archive. * * @note This method is only available in read mode. * * @warning Calling @ref streamForReadingFile: will invalidate all streams * previously returned by @ref streamForReadingFile: or |
︙ | ︙ |