ObjFW  Diff

Differences From Artifact [8eb0a45d6e]:

To Artifact [d557fd2664]:


513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
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

# if defined(OF_HAVE_FILES) || defined(OF_HAVE_SOCKETS)
/**
 * @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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
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;
# endif

/**
 * @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