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
Copy file name to clipboardExpand all lines: Foundation/ByteCountFormatter.swift
+4-4
Original file line number
Diff line number
Diff line change
@@ -50,15 +50,15 @@ open class ByteCountFormatter : Formatter {
50
50
NSUnimplemented()
51
51
}
52
52
53
-
/* Specify the units that can be used in the output. If NSByteCountFormatterUseDefault, uses platform-appropriate settings; otherwise will only use the specified units. This is the default value. Note that ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display ("0.0035 ZB" for instance).
53
+
/* Specify the units that can be used in the output. If ByteCountFormatter.Units.useDefault, uses platform-appropriate settings; otherwise will only use the specified units. This is the default value. Note that ZB and YB cannot be covered by the range of possible values, but you can still choose to use these units to get fractional display ("0.0035 ZB" for instance).
54
54
*/
55
55
openvarallowedUnits:Units=.useDefault
56
56
57
-
/* Specify how the count is displayed by indicating the number of bytes to be used for kilobyte. The default setting is NSByteCountFormatterFileCount, which is the system specific value for file and storage sizes.
57
+
/* Specify how the count is displayed by indicating the number of bytes to be used for kilobyte. The default setting is ByteCountFormatter.CountStyle.fileCount, which is the system specific value for file and storage sizes.
58
58
*/
59
59
openvarcountStyle:CountStyle=.file
60
60
61
-
/* Choose whether to allow more natural display of some values, such as zero, where it may be displayed as "Zero KB," ignoring all other flags or options (with the exception of NSByteCountFormatterUseBytes, which would generate "Zero bytes"). The result is appropriate for standalone output. Default value is YES. Special handling of certain values such as zero is especially important in some languages, so it's highly recommended that this property be left in its default state.
61
+
/* Choose whether to allow more natural display of some values, such as zero, where it may be displayed as "Zero KB," ignoring all other flags or options (with the exception of ByteCountFormatter.Units.useBytes, which would generate "Zero bytes"). The result is appropriate for standalone output. Default value is YES. Special handling of certain values such as zero is especially important in some languages, so it's highly recommended that this property be left in its default state.
62
62
*/
63
63
openvarallowsNonnumericFormatting:Bool=true
64
64
@@ -91,7 +91,7 @@ open class ByteCountFormatter : Formatter {
91
91
*/
92
92
privateletnumberFormatter=NumberFormatter()
93
93
94
-
/* Shortcut for converting a byte count into a string without creating an NSByteCountFormatter and an NSNumber. If you need to specify options other than countStyle, create an instance of NSByteCountFormatter first.
94
+
/* Shortcut for converting a byte count into a string without creating an ByteCountFormatter and an NSNumber. If you need to specify options other than countStyle, create an instance of ByteCountFormatter first.
/* NSDateComponentsFormatter provides locale-correct and flexible string formatting of quantities of time, such as "1 day" or "1h 10m", as specified by NSDateComponents. For formatting intervals of time (such as "2PM to 5PM"), see NSDateIntervalFormatter. NSDateComponentsFormatter is thread-safe, in that calling methods on it from multiple threads will not cause crashes or incorrect results, but it makes no attempt to prevent confusion when one thread sets something and another thread isn't expecting it to change.
37
+
/* DateComponentsFormatter provides locale-correct and flexible string formatting of quantities of time, such as "1 day" or "1h 10m", as specified by NSDateComponents. For formatting intervals of time (such as "2PM to 5PM"), see DateIntervalFormatter. DateComponentsFormatter is thread-safe, in that calling methods on it from multiple threads will not cause crashes or incorrect results, but it makes no attempt to prevent confusion when one thread sets something and another thread isn't expecting it to change.
38
38
*/
39
39
40
40
openclassDateComponentsFormatter:Formatter{
@@ -53,11 +53,11 @@ open class DateComponentsFormatter : Formatter {
/* Normally, NSDateComponentsFormatter will calculate as though counting from the current date and time (e.g. in February, 1 month formatted as a number of days will be 28). -stringFromDate:toDate: calculates from the passed-in startDate instead.
56
+
/* Normally, DateComponentsFormatter will calculate as though counting from the current date and time (e.g. in February, 1 month formatted as a number of days will be 28). -stringFromDate:toDate: calculates from the passed-in startDate instead.
57
57
58
58
See 'allowedUnits' for how the default set of allowed units differs from -stringFromDateComponents:.
59
59
60
-
Note that this is still formatting the quantity of time between the dates, not the pair of dates itself. For strings like "Feb 22nd - Feb 28th", use NSDateIntervalFormatter.
60
+
Note that this is still formatting the quantity of time between the dates, not the pair of dates itself. For strings like "Feb 22nd - Feb 28th", use DateIntervalFormatter.
61
61
*/
62
62
openfunc string(from startDate:Date, to endDate:Date)->String?{NSUnimplemented()}
63
63
@@ -67,7 +67,7 @@ open class DateComponentsFormatter : Formatter {
/* Choose how to indicate units. For example, 1h 10m vs 1:10. Default is NSDateComponentsFormatterUnitsStylePositional.
70
+
/* Choose how to indicate units. For example, 1h 10m vs 1:10. Default is DateComponentsFormatter.UnitsStyle.positional.
71
71
*/
72
72
openvarunitsStyle:UnitsStyle
73
73
@@ -87,9 +87,9 @@ open class DateComponentsFormatter : Formatter {
87
87
*/
88
88
openvarallowedUnits:NSCalendar.Unit
89
89
90
-
/* Bitmask specifying how to handle zeros in units. This includes both padding and dropping zeros so that a consistent number digits are displayed, causing updating displays to remain more stable. Default is NSDateComponentsFormatterZeroFormattingBehaviorDefault.
90
+
/* Bitmask specifying how to handle zeros in units. This includes both padding and dropping zeros so that a consistent number digits are displayed, causing updating displays to remain more stable. Default is DateComponentsFormatter.ZeroFormattingBehavior.default.
91
91
92
-
If the combination of zero formatting behavior and style would lead to ambiguous date formats (for example, 1:10 meaning 1 hour, 10 seconds), NSDateComponentsFormatter will throw an exception.
92
+
If the combination of zero formatting behavior and style would lead to ambiguous date formats (for example, 1:10 meaning 1 hour, 10 seconds), DateComponentsFormatter will throw an exception.
// NSDateIntervalFormatter is used to format the range between two NSDates in a locale-sensitive way.
23
-
// NSDateIntervalFormatter returns nil and NO for all methods in NSFormatter.
22
+
// DateIntervalFormatter is used to format the range between two NSDates in a locale-sensitive way.
23
+
// DateIntervalFormatter returns nil and NO for all methods in Formatter.
24
24
25
25
openclassDateIntervalFormatter:Formatter{
26
26
@@ -36,8 +36,8 @@ open class DateIntervalFormatter : Formatter {
36
36
/*@NSCopying*/ openvarcalendar:Calendar! // default is the calendar of the locale
37
37
/*@NSCopying*/ openvartimeZone:TimeZone! // default is [NSTimeZone defaultTimeZone]
38
38
openvardateTemplate:String! // default is an empty string
39
-
openvardateStyle:Style // default is NSDateIntervalFormatterNoStyle
40
-
openvartimeStyle:Style // default is NSDateIntervalFormatterNoStyle
39
+
openvardateStyle:Style // default is .noStyle
40
+
openvartimeStyle:Style // default is .noStyle
41
41
42
42
/*
43
43
If the range smaller than the resolution specified by the dateTemplate, a single date format will be produced. If the range is larger than the format specified by the dateTemplate, a locale-specific fallback will be used to format the items missing from the pattern.
/* Instances of NSFileManager may now have delegates. Each instance has one delegate, and the delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of an NSFileManager.
114
+
/* Instances of FileManager may now have delegates. Each instance has one delegate, and the delegate is not retained. In versions of Mac OS X prior to 10.5, the behavior of calling [[NSFileManager alloc] init] was undefined. In Mac OS X 10.5 "Leopard" and later, calling [[NSFileManager alloc] init] returns a new instance of an FileManager.
115
115
*/
116
116
open weak vardelegate:FileManagerDelegate?{
117
117
NSUnimplemented()
@@ -505,7 +505,7 @@ open class FileManager : NSObject {
505
505
tryself.removeItem(atPath: url.path)
506
506
}
507
507
508
-
/* Process working directory management. Despite the fact that these are instance methods on NSFileManager, these methods report and change (respectively) the working directory for the entire process. Developers are cautioned that doing so is fraught with peril.
508
+
/* Process working directory management. Despite the fact that these are instance methods on FileManager, these methods report and change (respectively) the working directory for the entire process. Developers are cautioned that doing so is fraught with peril.
509
509
*/
510
510
openvarcurrentDirectoryPath:String{
511
511
letlength=Int(PATH_MAX)+1
@@ -856,7 +856,7 @@ public protocol FileManagerDelegate : NSObjectProtocol {
func fileManager(_ fileManager:FileManager, shouldCopyItemAt srcURL:URL, to dstURL:URL)->Bool
858
858
859
-
/* fileManager:shouldProceedAfterError:copyingItemAtPath:toPath: gives the delegate an opportunity to recover from or continue copying after an error. If an error occurs, the error object will contain an NSError indicating the problem. The source path and destination paths are also provided. If this method returns YES, the NSFileManager instance will continue as if the error had not occurred. If this method returns NO, the NSFileManager instance will stop copying, return NO from copyItemAtPath:toPath:error: and the error will be provied there.
859
+
/* fileManager:shouldProceedAfterError:copyingItemAtPath:toPath: gives the delegate an opportunity to recover from or continue copying after an error. If an error occurs, the error object will contain an NSError indicating the problem. The source path and destination paths are also provided. If this method returns YES, the FileManager instance will continue as if the error had not occurred. If this method returns NO, the FileManager instance will stop copying, return NO from copyItemAtPath:toPath:error: and the error will be provied there.
func fileManager(_ fileManager:FileManager, shouldProceedAfterError error:Error, linkingItemAt srcURL:URL, to dstURL:URL)->Bool
884
884
885
-
/* fileManager:shouldRemoveItemAtPath: allows the delegate the opportunity to not remove the item at path. If the delegate returns YES from this method, the NSFileManager instance will attempt to remove the item. If the delegate returns NO from this method, the remove skips the item. If the item is a directory, no children of that item will be visited.
885
+
/* fileManager:shouldRemoveItemAtPath: allows the delegate the opportunity to not remove the item at path. If the delegate returns YES from this method, the FileManager instance will attempt to remove the item. If the delegate returns NO from this method, the remove skips the item. If the item is a directory, no children of that item will be visited.
0 commit comments