Differences From Artifact [1cf435b925]:
- File
src/OFString.h
— part of check-in
[fcaa549324]
at
2012-10-16 14:47:55
on branch trunk
— A few more API improvements.
This should make it more future-proof, as adding new options is easier
than adding new methods for each and every combination of options. (user: js, size: 28036) [annotate] [blame] [check-ins using]
To Artifact [25f3180e0b]:
- File src/OFString.h — part of check-in [8edaa642e4] at 2012-11-11 11:51:39 on branch 0.7 — Add two more OF_SENTINEL. (user: js, size: 27749) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
71 72 73 74 75 76 77 | #endif @class OFArray; @class OFURL; /** * \brief A class for handling strings. | < < < < < < | 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 |
︙ | ︙ | |||
113 114 115 116 117 118 119 | */ + (instancetype)stringWithUTF8String: (const char*)UTF8String length: (size_t)UTF8StringLength; /** * \brief Creates a new OFString from a C string with the specified encoding. * | | | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 | */ + (instancetype)stringWithUTF8String: (const char*)UTF8String length: (size_t)UTF8StringLength; /** * \brief Creates a new OFString from a C string with the specified encoding. * * \param cString A C string to initialize the OFString with * \param encoding The encoding of the C string * \return A new autoreleased OFString */ + (instancetype)stringWithCString: (const char*)cString encoding: (of_string_encoding_t)encoding; /** |
︙ | ︙ | |||
245 246 247 248 249 250 251 | /** * \brief Creates a new OFString containing the constructed specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ | | | 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | /** * \brief Creates a new OFString containing the constructed specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ + (instancetype)stringWithPath: (OFString*)firstComponent, ... OF_SENTINEL; /** * \brief Creates a new OFString with the contents of the specified UTF-8 * encoded file. * * \param path The path to the file * \return A new autoreleased OFString |
︙ | ︙ | |||
477 478 479 480 481 482 483 | /** * \brief Initializes an already allocated OFString with the constructed * specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ | | | 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | /** * \brief Initializes an already allocated OFString with the constructed * specified path. * * \param firstComponent The first component of the path * \return A new autoreleased OFString */ - initWithPath: (OFString*)firstComponent, ... OF_SENTINEL; /** * \brief Initializes an already allocated OFString with the constructed * specified path. * * \param firstComponent The first component of the path * \param arguments A va_list with the other components of the path |
︙ | ︙ | |||
624 625 626 627 628 629 630 | - (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. | | > | > | 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 | /** * \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. | | > | 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 | * \return The string in lowercase */ - (OFString*)lowercaseString; /** * \brief Returns the string capitalized. * | | | 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 | */ - (OFArray*)componentsSeparatedByString: (OFString*)delimiter; /** * \brief Separates an OFString into an OFArray of OFStrings. * * \param delimiter The delimiter for separating | | | > | 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. |
︙ | ︙ |