@@ -14,19 +14,27 @@ */ #import "OFObject.h" #import "OFSerialization.h" #import "OFMessagePackRepresentation.h" + +/*! @file */ OF_ASSUME_NONNULL_BEGIN @class OFString; @class OFURL; -enum { - OF_DATA_SEARCH_BACKWARDS = 1 -}; +/** + * @brief Options for searching in data. + * + * This is a bit mask. + */ +typedef enum { + /** Search backwards in the data */ + OFDataSearchBackwards = 1 +} OFDataSearchOptions; /** * @class OFData OFData.h ObjFW/OFData.h * * @brief A class for storing arbitrary data in an array. @@ -274,11 +282,11 @@ * @brief Compares the data to other data. * * @param data Data to compare the data to * @return The result of the comparison */ -- (of_comparison_result_t)compare: (OFData *)data; +- (OFComparisonResult)compare: (OFData *)data; /** * @brief Returns a specific item of the OFData. * * @param index The number of the item to return @@ -290,28 +298,24 @@ * @brief Returns the data in the specified range as a new OFData. * * @param range The range of the data for the new OFData * @return The data in the specified range as a new OFData */ -- (OFData *)subdataWithRange: (of_range_t)range; +- (OFData *)subdataWithRange: (OFRange)range; /** * @brief Returns the range of the data. * * @param data The data to search for - * @param options Options modifying search behavior.@n - * Possible values are: - * Value | Description - * ---------------------------|----------------------------- - * `OF_DATA_SEARCH_BACKWARDS` | Search backwards in the data + * @param options Options modifying search behavior * @param range The range in which to search * @return The range of the first occurrence of the data or a range with - * `OF_NOT_FOUND` as start position if it was not found. + * `OFNotFound` as start position if it was not found. */ -- (of_range_t)rangeOfData: (OFData *)data - options: (int)options - range: (of_range_t)range; +- (OFRange)rangeOfData: (OFData *)data + options: (OFDataSearchOptions)options + range: (OFRange)range; #ifdef OF_HAVE_FILES /** * @brief Writes the OFData into the specified file. *