ObjFW  Diff

Differences From Artifact [6d0eea5940]:

To Artifact [cab3d30f53]:


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#endif

@class OFArray;
@class OFURL;

/**
 * \brief A class for handling strings.
 *
 * <b>Warning:</b> If you add methods to OFString using a category, you are not
 * allowed to access the ivars directly, as these might be still uninitialized
 * for a constant string and get initialized on the first message! Therefore,
 * you should use the corresponding methods to get the ivars, which ensures the
 * constant string is initialized.
 */
@interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing,
    OFSerialization, OFJSONRepresentation>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t length;
#endif








<
<
<
<
<
<







71
72
73
74
75
76
77






78
79
80
81
82
83
84
#endif

@class OFArray;
@class OFURL;

/**
 * \brief A class for handling strings.






 */
@interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing,
    OFSerialization, OFJSONRepresentation>
#ifdef OF_HAVE_PROPERTIES
@property (readonly) size_t length;
#endif

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
- (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;







|
>











|
>







618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
- (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;
703
704
705
706
707
708
709
710

711
712
713
714
715
716
717
/**
 * \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;







|
>







699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
/**
 * \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;
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
 * \return The string in lowercase
 */
- (OFString*)lowercaseString;

/**
 * \brief Returns the string capitalized.
 *
 * \note This only considers spaces, tab and newlines to be word delimiters!
 *	 Also note that this might change in the future to all word delimiters
 *	 specified by Unicode!
 *
 * \return The capitalized string
 */
- (OFString*)capitalizedString;








|







726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
 * \return The string in lowercase
 */
- (OFString*)lowercaseString;

/**
 * \brief Returns the string capitalized.
 *
 * \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!
 *
 * \return The capitalized string
 */
- (OFString*)capitalizedString;

787
788
789
790
791
792
793
794
795

796
797
798
799
800
801
802
 */
- (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.







|
|
>







784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
 */
- (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.