Differences From Artifact [d0122c5cef]:
- File
src/OFString.h
— part of check-in
[114576fe94]
at
2022-09-04 18:27:46
on branch trunk
— Remove -[OFString stringByPrependingString:]
The same can be achieved using -[OFString stringByAppendingString:] and
swapping the order of arguments. (user: js, size: 42752) [annotate] [blame] [check-ins using]
To Artifact [9816b06102]:
- File src/OFString.h — part of check-in [e7ab06503c] at 2022-09-28 21:40:00 on branch trunk — Rename OFUR{L -> I} in preparation for URI support (user: js, size: 42756) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
132 133 134 135 136 137 138 | */ typedef void (^OFStringLineEnumerationBlock)(OFString *line, bool *stop); #endif #ifdef __OBJC__ @class OFArray OF_GENERIC(ObjectType); @class OFCharacterSet; | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | */ typedef void (^OFStringLineEnumerationBlock)(OFString *line, bool *stop); #endif #ifdef __OBJC__ @class OFArray OF_GENERIC(ObjectType); @class OFCharacterSet; @class OFURI; /** * @class OFString OFString.h ObjFW/OFString.h * * @brief A class for handling strings. */ @interface OFString: OFObject <OFCopying, OFMutableCopying, OFComparing, |
︙ | ︙ | |||
535 536 537 538 539 540 541 | * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding; # endif /** | | | | | | | | | | 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 | * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding; # endif /** * @brief Creates a new OFString with the contents of the specified URI. * * If the URI's scheme is file, it tries UTF-8 encoding. * * If the URI'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 * UTF-8. * * @param URI The URI to the contents for the string * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfURI: (OFURI *)URI; /** * @brief Creates a new OFString with the contents of the specified URI in the * specified encoding. * * @param URI The URI to the contents for the string * @param encoding The encoding to assume * @return A new autoreleased OFString */ + (instancetype)stringWithContentsOfURI: (OFURI *)URI encoding: (OFStringEncoding)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 |
︙ | ︙ | |||
808 809 810 811 812 813 814 | */ - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding; # endif /** * @brief Initializes an already allocated OFString with the contents of the | | | | | | | | | | 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 | */ - (instancetype)initWithContentsOfFile: (OFString *)path encoding: (OFStringEncoding)encoding; # endif /** * @brief Initializes an already allocated OFString with the contents of the * specified URI. * * If the URI's scheme is file, it tries UTF-8 encoding. * * If the URI'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 * UTF-8. * * @param URI The URI to the contents for the string * @return An initialized OFString */ - (instancetype)initWithContentsOfURI: (OFURI *)URI; /** * @brief Initializes an already allocated OFString with the contents of the * specified URI in the specified encoding. * * @param URI The URI to the contents for the string * @param encoding The encoding to assume * @return An initialized OFString */ - (instancetype)initWithContentsOfURI: (OFURI *)URI encoding: (OFStringEncoding)encoding; /** * @brief Writes the OFString into the specified C string with the specified * encoding. * * @param cString The C string to write into |
︙ | ︙ | |||
1241 1242 1243 1244 1245 1246 1247 | * @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: (OFStringEncoding)encoding; # endif /** | | | | | | | | | 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 1267 | * @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: (OFStringEncoding)encoding; # endif /** * @brief Writes the string to the specified URI using UTF-8 encoding. * * @param URI The URI to write to */ - (void)writeToURI: (OFURI *)URI; /** * @brief Writes the string to the specified URI using the specified encoding. * * @param URI The URI to write to * @param encoding The encoding to use to write the string to the URI */ - (void)writeToURI: (OFURI *)URI encoding: (OFStringEncoding)encoding; # ifdef OF_HAVE_BLOCKS /** * Enumerates all lines in the receiver using the specified block. * * @brief block The block to call for each line */ |
︙ | ︙ | |||
1308 1309 1310 1311 1312 1313 1314 | #include "OFMutableString.h" #ifdef __OBJC__ # import "OFString+CryptographicHashing.h" # import "OFString+JSONParsing.h" # ifdef OF_HAVE_FILES # import "OFString+PathAdditions.h" # endif | | | | | 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 | #include "OFMutableString.h" #ifdef __OBJC__ # import "OFString+CryptographicHashing.h" # import "OFString+JSONParsing.h" # ifdef OF_HAVE_FILES # import "OFString+PathAdditions.h" # endif # import "OFString+PercentEncoding.h" # import "OFString+PropertyListParsing.h" # import "OFString+Serialization.h" # import "OFString+XMLEscaping.h" # import "OFString+XMLUnescaping.h" #endif #if defined(__OBJC__) && !defined(NSINTEGER_DEFINED) && !__has_feature(modules) /* * Very *ugly* hack required for string boxing literals to work. |
︙ | ︙ |