Differences From Artifact [b31ea8640a]:
- File src/OFString.h — part of check-in [4bbac7ab17] at 2020-11-01 11:35:03 on branch trunk — OFString: Add -[substring{From,To}Index:] (user: js, size: 43083) [annotate] [blame] [check-ins using] [more...]
To Artifact [d557fd2664]:
- File
src/OFString.h
— part of check-in
[1a49ef773d]
at
2021-03-08 00:00:52
on branch trunk
— Make +[stringWithContentsOfURL:] always available
Even when there is neither files nor sockets, a scheme could still be
registered, for example for files embedded into the binary. (user: js, size: 42910) [annotate] [blame] [check-ins using] [more...]
1 | /* | < < | | 1 2 3 4 5 6 7 8 9 | /* * Copyright (c) 2008-2021 Jonathan Schleifer <js@nil.im> * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in * the packaging of this file. * |
︙ | ︙ | |||
515 516 517 518 519 520 521 | * @param encoding The encoding of the file * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding; # endif | < | 513 514 515 516 517 518 519 520 521 522 523 524 525 526 | * @param encoding The encoding of the file * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (of_string_encoding_t)encoding; # endif /** * @brief Creates a new OFString with the contents of the specified URL. * * If the URL's scheme is file, it tries UTF-8 encoding. * * If the URL's scheme is http(s), it tries to detect the encoding from the HTTP * headers. If it could not detect the encoding using the HTTP headers, it tries |
︙ | ︙ | |||
540 541 542 543 544 545 546 | * * @param URL The URL to the contents for the string * @param encoding The encoding to assume * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding; | < | 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | * * @param URL The URL to the contents for the string * @param encoding The encoding to assume * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding; /** * @brief Initializes an already allocated OFString from a UTF-8 encoded C * string. * * @param UTF8String A UTF-8 encoded C string to initialize the OFString with * @return An initialized OFString |
︙ | ︙ | |||
907 908 909 910 911 912 913 | /** * @brief Copies the Unicode characters in the specified range to the specified * buffer. * * @param buffer The buffer to store the Unicode characters * @param range The range of the Unicode characters to copy */ | | < | 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 | /** * @brief Copies the Unicode characters in the specified range to the specified * buffer. * * @param buffer The buffer to store the Unicode characters * @param range The range of the Unicode characters to copy */ - (void)getCharacters: (of_unichar_t *)buffer inRange: (of_range_t)range; /** * @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_NOT_FOUND` as start position if it was not found |
︙ | ︙ | |||
931 932 933 934 935 936 937 | * Possible values are: * Value | Description * -----------------------------|------------------------------- * `OF_STRING_SEARCH_BACKWARDS` | Search backwards in the string * @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 */ | | < | 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 | * Possible values are: * Value | Description * -----------------------------|------------------------------- * `OF_STRING_SEARCH_BACKWARDS` | Search backwards in the string * @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.@n * Possible values are: |
︙ | ︙ | |||
1242 1243 1244 1245 1246 1247 1248 | /** * @brief Writes the string into the specified file using the specified * encoding. * * @param path The path of the file to write to * @param encoding The encoding to use to write the string into the file */ | | < | < | 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 | /** * @brief Writes the string into the specified file using the specified * encoding. * * @param path The path of the file to write to * @param encoding The encoding to use to write the string into the file */ - (void)writeToFile: (OFString *)path encoding: (of_string_encoding_t)encoding; # endif /** * @brief Writes the string to the specified URL using UTF-8 encoding. * * @param URL The URL to write to */ - (void)writeToURL: (OFURL *)URL; /** * @brief Writes the string to the specified URL using the specified encoding. * * @param URL The URL to write to * @param encoding The encoding to use to write the string to the URL */ - (void)writeToURL: (OFURL *)URL encoding: (of_string_encoding_t)encoding; # ifdef OF_HAVE_BLOCKS /** * Enumerates all lines in the receiver using the specified block. * * @brief block The block to call for each line */ |
︙ | ︙ |