@@ -42,10 +42,15 @@ OF_STRING_ENCODING_ISO_8859_15, OF_STRING_ENCODING_WINDOWS_1252, OF_STRING_ENCODING_AUTODETECT = 0xFF } of_string_encoding_t; + +typedef enum of_string_search_options_t { + OF_STRING_SEARCH_BACKWARDS = 1 +} of_string_search_options_t; + /* FIXME */ #define OF_STRING_ENCODING_NATIVE OF_STRING_ENCODING_UTF_8 #ifdef OF_HAVE_BLOCKS typedef void (^of_string_line_enumeration_block_t)(OFString *line, BOOL *stop); @@ -608,26 +613,28 @@ */ - (void)getCharacters: (of_unichar_t*)buffer inRange: (of_range_t)range; /** - * \brief Returns the index of the first occurrence of the string. - * - * \param string The string to search - * \return The index of the first occurrence of the string or OF_INVALID_INDEX - * if it was not found - */ -- (size_t)indexOfFirstOccurrenceOfString: (OFString*)string; - -/** - * \brief Returns the index of the last occurrence of the string. - * - * \param string The string to search - * \return The index of the last occurrence of the string or OF_INVALID_INDEX if - * it was not found - */ -- (size_t)indexOfLastOccurrenceOfString: (OFString*)string; + * \brief Returns the range of the first occurrence of the string. + * + * \param string The string to search + * \return The range of the first occurrence of the string or a range with + * OF_INVALID_INDEX as start position if it was not found + */ +- (of_range_t)rangeOfString: (OFString*)string; + +/** + * \brief Returns the range of the string. + * + * \param string The string to search + * \param options Options modifying search behaviour. + * \return The range of the first occurrence of the string or a range with + * OF_INVALID_INDEX as start position if it was not found + */ +- (of_range_t)rangeOfString: (OFString*)string + options: (of_string_search_options_t)options; /** * \brief Returns whether the string contains the specified string. * * \param string The string to search