You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Returns a character set containing individual Unicode characters that can also be represented as composed character sequences (such as for letters with accents), by the definition of “standard decomposition” in version 3.2 of the Unicode character encoding standard.
185
+
/// Returns a character set containing individual Unicode characters that can also be represented as composed character sequences (such as for letters with accents), by the definition of "standard decomposition" in version 3.2 of the Unicode character encoding standard.
@@ -88,7 +88,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
88
88
/**
89
89
The time interval between the date and the current date and time.
90
90
91
-
If the date is earlier than the current date and time, the this property’s value is negative.
91
+
If the date is earlier than the current date and time, the this property's value is negative.
92
92
93
93
- SeeAlso: `timeIntervalSince(_:)`
94
94
- SeeAlso: `timeIntervalSince1970`
@@ -101,7 +101,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
101
101
/**
102
102
The interval between the date object and 00:00:00 UTC on 1 January 1970.
103
103
104
-
This property’s value is negative if the date object is earlier than 00:00:00 UTC on 1 January 1970.
104
+
This property's value is negative if the date object is earlier than 00:00:00 UTC on 1 January 1970.
105
105
106
106
- SeeAlso: `timeIntervalSince(_:)`
107
107
- SeeAlso: `timeIntervalSinceNow`
@@ -179,7 +179,7 @@ public struct Date : ReferenceConvertible, Comparable, Equatable, CustomStringCo
179
179
180
180
- Parameter locale: A `Locale` object. If you pass `nil`, `NSDate` formats the date in the same way as the `description` property.
181
181
182
-
- Returns: A string representation of the receiver, using the given locale, or if the locale argument is `nil`, in the international format `YYYY-MM-DD HH:MM:SS ±HHMM`, where `±HHMM` represents the time zone offset in hours and minutes from UTC (for example, “`2001-03-24 10:45:32 +0600`”)
182
+
- Returns: A string representation of the receiver, using the given locale, or if the locale argument is `nil`, in the international format `YYYY-MM-DD HH:MM:SS ±HHMM`, where `±HHMM` represents the time zone offset in hours and minutes from UTC (for example, "`2001-03-24 10:45:32 +0600`")
Copy file name to clipboardExpand all lines: stdlib/public/SDK/Foundation/URL.swift
+27-27Lines changed: 27 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -275,7 +275,7 @@ public struct URLResourceValues {
275
275
276
276
/// The document identifier -- a value assigned by the kernel to a document (which can be either a file or directory) and is used to identify the document regardless of where it gets moved on a volume.
277
277
///
278
-
/// The document identifier survives "safe save” operations; i.e it is sticky to the path it was assigned to (`replaceItem(at:,withItemAt:,backupItemName:,options:,resultingItem:) throws` is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes.
278
+
/// The document identifier survives "safe save" operations; i.e it is sticky to the path it was assigned to (`replaceItem(at:,withItemAt:,backupItemName:,options:,resultingItem:) throws` is the preferred safe-save API). The document identifier is persistent across system restarts. The document identifier is not transferred when the file is copied. Document identifiers are only unique within a single volume. This property is not supported by all volumes.
@@ -471,7 +471,7 @@ public struct URLResourceValues {
471
471
/**
472
472
A URL is a type that can potentially contain the location of a resource on a remote server, the path of a local file on disk, or even an arbitrary piece of encoded data.
473
473
474
-
You can construct URLs and access their parts. For URLs that represent local files, you can also manipulate properties of those files directly, such as changing the file’s last modification date. Finally, you can pass URLs to other APIs to retrieve the contents of those URLs. For example, you can use the URLSession classes to access the contents of remote resources, as described in URL Session Programming Guide.
474
+
You can construct URLs and access their parts. For URLs that represent local files, you can also manipulate properties of those files directly, such as changing the file's last modification date. Finally, you can pass URLs to other APIs to retrieve the contents of those URLs. For example, you can use the URLSession classes to access the contents of remote resources, as described in URL Session Programming Guide.
475
475
476
476
URLs are the preferred way to refer to local files. Most objects that read data from or write data to a file have methods that accept a URL instead of a pathname as the file reference. For example, you can get the contents of a local file URL as `String` by calling `func init(contentsOf:encoding) throws`, or as a `Data` by calling `func init(contentsOf:options) throws`.
/// Returns a file reference URL that refers to the same resource as a specified file URL.
675
675
///
676
-
/// File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URL’s underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark.
676
+
/// File reference URLs use a URL path syntax that identifies a file system object by reference, not by path. This form of file URL remains valid when the file system path of the URL's underlying resource changes. An error will occur if the url parameter is not a file URL. File reference URLs cannot be created to file system objects which do not exist or are not reachable. In some areas of the file system hierarchy, file reference URLs cannot be generated to the leaf node of the URL path. A file reference URL's path should never be persistently stored because is not valid across system restarts, and across remounts of volumes -- if you want to create a persistent reference to a file system object, use a bookmark.
// TODO: Use URLComponents to handle an empty-path case
712
712
/*
713
713
URLByAppendingPathComponent can return nil if:
714
-
• the URL does not have a path component. (see note 1)
715
-
• a mutable copy of the URLs string could not be created.
716
-
• a percent-encoded string of the new path component could not created using the same encoding as the URL’s string. (see note 2)
717
-
• a new URL object could not be created with the modified URL string.
714
+
* the URL does not have a path component. (see note 1)
715
+
* a mutable copy of the URLs string could not be created.
716
+
* a percent-encoded string of the new path component could not created using the same encoding as the URL's string. (see note 2)
717
+
* a new URL object could not be created with the modified URL string.
718
718
719
-
Note 1: If NS/CFURL parsed URLs correctly, this would not occur because URL strings always have a path component. For example, the URL <mailto:[email protected]> should be parsed as Scheme=“mailto”, and Path= “[email protected]". Instead, CFURL returns false for CFURLCanBeDecomposed(), says Scheme=“mailto”, Path=nil, and ResourceSpecifier=“[email protected]”. rdar://problem/15060399
719
+
Note 1: If NS/CFURL parsed URLs correctly, this would not occur because URL strings always have a path component. For example, the URL <mailto:[email protected]> should be parsed as Scheme="mailto", and Path= "[email protected]". Instead, CFURL returns false for CFURLCanBeDecomposed(), says Scheme="mailto", Path=nil, and ResourceSpecifier="[email protected]". rdar://problem/15060399
720
720
721
721
Note 2: CFURLCreateWithBytes() and CFURLCreateAbsoluteURLWithBytes() allow URLs to be created with an array of bytes and a CFStringEncoding. All other CFURL functions and URL methods which create URLs use kCFStringEncodingUTF8/NSUTF8StringEncoding. So, the encoding passed to CFURLCreateWithBytes/CFURLCreateAbsoluteURLWithBytes might prevent the percent-encoding of the new path component or path extension.
/// Each `URLQueryItem` represents a single key-value pair,
268
268
///
269
-
/// Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the `URLComponents` has an empty query component, returns an empty array. If the `URLComponents` has no query component, returns nil.
269
+
/// Note that a name may appear more than once in a single query string, so the name values are not guaranteed to be unique. If the `URLComponents` has an empty query component, returns an empty array. If the `URLComponents` has no query component, returns nil.
270
270
///
271
271
/// The setter combines an array containing any number of `URLQueryItem`s, each of which represents a single key-value pair, into a query string and sets the `URLComponents` query property. Passing an empty array sets the query component of the `URLComponents` to an empty string. Passing nil removes the query component of the `URLComponents`.
0 commit comments