ObjFW  Diff

Differences From Artifact [9619983a96]:

To Artifact [1cf435b925]:


40
41
42
43
44
45
46
47
48
49

50
51
52
53
54
55
56
57
	OF_STRING_ENCODING_ASCII,
	OF_STRING_ENCODING_ISO_8859_1,
	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);
#endif







|
<
|
>
|







40
41
42
43
44
45
46
47

48
49
50
51
52
53
54
55
56
57
	OF_STRING_ENCODING_ASCII,
	OF_STRING_ENCODING_ISO_8859_1,
	OF_STRING_ENCODING_ISO_8859_15,
	OF_STRING_ENCODING_WINDOWS_1252,
	OF_STRING_ENCODING_AUTODETECT = 0xFF
} of_string_encoding_t;

enum {

	OF_STRING_SEARCH_BACKWARDS = 1,
	OF_STRING_SKIP_EMPTY	   = 2
};

/* 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);
#endif
623
624
625
626
627
628
629
630

631
632
633
634
635
636
637
638
639
640
641

642
643
644
645
646
647
648
649
650
651
652
653
654
 */
- (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_NOT_FOUND as start position if it was not found
 */
- (of_range_t)rangeOfString: (OFString*)string
		    options: (of_string_search_options_t)options;

/**
 * \brief Returns the range of the string in the specified range.
 *
 * \param string The string to search
 * \param options Options modifying search behaviour

 * \param range The range in which to search
 * \return The range of the first occurrence of the string or a range with
 *	   OF_NOT_FOUND as start position if it was not found
 */
- (of_range_t)rangeOfString: (OFString*)string
		    options: (of_string_search_options_t)options
		      range: (of_range_t)range;

/**
 * \brief Returns whether the string contains the specified string.
 *
 * \param string The string to search
 * \return Whether the string contains the specified string







|
>




|





|
>





|







623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
 */
- (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.
 *		  Possible values: OF_STRING_SEARCH_BACKWARDS
 * \return The range of the first occurrence of the string or a range with
 *	   OF_NOT_FOUND as start position if it was not found
 */
- (of_range_t)rangeOfString: (OFString*)string
		    options: (int)options;

/**
 * \brief Returns the range of the string in the specified range.
 *
 * \param string The string to search
 * \param options Options modifying search behaviour.
 *		  Possible values: OF_STRING_SEARCH_BACKWARDS
 * \param range The range in which to search
 * \return The range of the first occurrence of the string or a range with
 *	   OF_NOT_FOUND as start position if it was not found
 */
- (of_range_t)rangeOfString: (OFString*)string
		    options: (int)options
		      range: (of_range_t)range;

/**
 * \brief Returns whether the string contains the specified string.
 *
 * \param string The string to search
 * \return Whether the string contains the specified string
700
701
702
703
704
705
706


707
708
709
710
711

712
713
714
715
716
717
718
719

/**
 * \brief Creates a new string by replacing the occurrences of the specified
 *	  string in the specified range with the specified replacement.
 *
 * \param string The string to replace
 * \param replacement The string with which it should be replaced


 * \param range The range in which to replace the string
 * \return A new string with the occurrences of the specified string replaced
 */
- (OFString*)stringByReplacingOccurrencesOfString: (OFString*)string
				       withString: (OFString*)replacement

					  inRange: (of_range_t)range;

/**
 * \brief Returns the string in uppercase.
 *
 * \return The string in uppercase
 */
- (OFString*)uppercaseString;







>
>





>
|







702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724

/**
 * \brief Creates a new string by replacing the occurrences of the specified
 *	  string in the specified range with the specified replacement.
 *
 * \param string The string to replace
 * \param replacement The string with which it should be replaced
 * \param options Options modifying search behaviour.
 *		  Possible values: None yet
 * \param range The range in which to replace the string
 * \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 Returns the string in uppercase.
 *
 * \return The string in uppercase
 */
- (OFString*)uppercaseString;
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789

790
791
792
793
794
795
796
797
798
799
800
 *
 * \param suffix The suffix to check for
 * \return A boolean whether the string has the specified suffix
 */
- (BOOL)hasSuffix: (OFString*)suffix;

/**
 * \brief Splits an OFString into an OFArray of OFStrings.
 *
 * \param delimiter The delimiter for splitting
 * \return An autoreleased OFArray with the split string
 */
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter;

/**
 * \brief Splits an OFString into an OFArray of OFStrings.
 *
 * \param delimiter The delimiter for splitting
 * \param skipEmpty Whether empty components should be skipped

 * \return An autoreleased OFArray with the split string
 */
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter
			      skipEmpty: (BOOL)skipEmpty;

/**
 * \brief Returns the components of the path.
 *
 * \return The components of the path
 */
- (OFArray*)pathComponents;







|

|
|




|

|
|
>
|


|







776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
 *
 * \param suffix The suffix to check for
 * \return A boolean whether the string has the specified suffix
 */
- (BOOL)hasSuffix: (OFString*)suffix;

/**
 * \brief Separates an OFString into an OFArray of OFStrings.
 *
 * \param delimiter The delimiter for separating
 * \return An autoreleased OFArray with the separated string
 */
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter;

/**
 * \brief Separates an OFString into an OFArray of OFStrings.
 *
 * \param delimiter The delimiter for separating
 * \param options Options according to which the string should be separated
 * 		  Possible values: OF_STRING_SKIP_EMPTY
 * \return An autoreleased OFArray with the separated string
 */
- (OFArray*)componentsSeparatedByString: (OFString*)delimiter
				options: (int)options;

/**
 * \brief Returns the components of the path.
 *
 * \return The components of the path
 */
- (OFArray*)pathComponents;