|
1 | 1 | // This source file is part of the Swift.org open source project
|
2 | 2 | //
|
3 |
| -// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors |
| 3 | +// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors |
4 | 4 | // Licensed under Apache License v2.0 with Runtime Library Exception
|
5 | 5 | //
|
6 | 6 | // See http://swift.org/LICENSE.txt for license information
|
7 | 7 | // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
8 | 8 | //
|
9 | 9 |
|
| 10 | +/// File-system operation attempted on non-existent file. |
10 | 11 | public var NSFileNoSuchFileError: Int { return CocoaError.Code.fileNoSuchFile.rawValue }
|
| 12 | + |
| 13 | +/// Failure to get a lock on file. |
11 | 14 | public var NSFileLockingError: Int { return CocoaError.Code.fileLocking.rawValue }
|
| 15 | + |
| 16 | +/// Read error, reason unknown. |
12 | 17 | public var NSFileReadUnknownError: Int { return CocoaError.Code.fileReadUnknown.rawValue }
|
| 18 | + |
| 19 | +/// Read error because of a permission problem. |
13 | 20 | public var NSFileReadNoPermissionError: Int { return CocoaError.Code.fileReadNoPermission.rawValue }
|
| 21 | + |
| 22 | +/// Read error because of an invalid file name. |
14 | 23 | public var NSFileReadInvalidFileNameError: Int { return CocoaError.Code.fileReadInvalidFileName.rawValue }
|
| 24 | + |
| 25 | +/// Read error because of a corrupted file, bad format, or similar reason. |
15 | 26 | public var NSFileReadCorruptFileError: Int { return CocoaError.Code.fileReadCorruptFile.rawValue }
|
| 27 | + |
| 28 | +/// Read error because no such file was found. |
16 | 29 | public var NSFileReadNoSuchFileError: Int { return CocoaError.Code.fileReadNoSuchFile.rawValue }
|
| 30 | + |
| 31 | +/// Read error because the string encoding was not applicable. |
| 32 | +/// |
| 33 | +/// Access the bad encoding from the `userInfo` dictionary using |
| 34 | +/// the `NSStringEncodingErrorKey` key. |
17 | 35 | public var NSFileReadInapplicableStringEncodingError: Int { return CocoaError.Code.fileReadInapplicableStringEncoding.rawValue }
|
| 36 | + |
| 37 | +/// Read error because the specified URL scheme is unsupported. |
18 | 38 | public var NSFileReadUnsupportedSchemeError: Int { return CocoaError.Code.fileReadUnsupportedScheme.rawValue }
|
| 39 | + |
| 40 | +/// Read error because the specified file was too large. |
19 | 41 | public var NSFileReadTooLargeError: Int { return CocoaError.Code.fileReadTooLarge.rawValue }
|
| 42 | + |
| 43 | +/// Read error because the string coding of the file could not be determined. |
20 | 44 | public var NSFileReadUnknownStringEncodingError: Int { return CocoaError.Code.fileReadUnknownStringEncoding.rawValue }
|
| 45 | + |
| 46 | +/// Write error, reason unknown. |
21 | 47 | public var NSFileWriteUnknownError: Int { return CocoaError.Code.fileWriteUnknown.rawValue }
|
| 48 | + |
| 49 | +/// Write error because of a permission problem. |
22 | 50 | public var NSFileWriteNoPermissionError: Int { return CocoaError.Code.fileWriteNoPermission.rawValue }
|
| 51 | + |
| 52 | +/// Write error because of an invalid file name. |
23 | 53 | public var NSFileWriteInvalidFileNameError: Int { return CocoaError.Code.fileWriteInvalidFileName.rawValue }
|
| 54 | + |
| 55 | +/// Write error returned when `FileManager` class’s copy, move, |
| 56 | +/// and link methods report errors when the destination file already exists. |
24 | 57 | public var NSFileWriteFileExistsError: Int { return CocoaError.Code.fileWriteFileExists.rawValue }
|
| 58 | + |
| 59 | +/// Write error because the string encoding was not applicable. |
| 60 | +/// |
| 61 | +/// Access the bad encoding from the `userInfo` dictionary |
| 62 | +/// using the `NSStringEncodingErrorKey` key. |
25 | 63 | public var NSFileWriteInapplicableStringEncodingError: Int { return CocoaError.Code.fileWriteInapplicableStringEncoding.rawValue }
|
| 64 | + |
| 65 | +/// Write error because the specified URL scheme is unsupported. |
26 | 66 | public var NSFileWriteUnsupportedSchemeError: Int { return CocoaError.Code.fileWriteUnsupportedScheme.rawValue }
|
| 67 | + |
| 68 | +/// Write error because of a lack of disk space. |
27 | 69 | public var NSFileWriteOutOfSpaceError: Int { return CocoaError.Code.fileWriteOutOfSpace.rawValue }
|
| 70 | + |
| 71 | +/// Write error because because the volume is read only. |
28 | 72 | public var NSFileWriteVolumeReadOnlyError: Int { return CocoaError.Code.fileWriteVolumeReadOnly.rawValue }
|
| 73 | + |
29 | 74 | public var NSFileManagerUnmountUnknownError: Int { return CocoaError.Code.fileManagerUnmountUnknown.rawValue }
|
| 75 | + |
30 | 76 | public var NSFileManagerUnmountBusyError: Int { return CocoaError.Code.fileManagerUnmountBusy.rawValue }
|
| 77 | + |
| 78 | +/// Key-value coding validation error. |
31 | 79 | public var NSKeyValueValidationError: Int { return CocoaError.Code.keyValueValidation.rawValue }
|
| 80 | + |
| 81 | +/// Formatting error (related to display of data). |
32 | 82 | public var NSFormattingError: Int { return CocoaError.Code.formatting.rawValue }
|
| 83 | + |
| 84 | +/// The user cancelled the operation (for example, by pressing Command-period). |
| 85 | +/// |
| 86 | +/// This code is for errors that do not require a dialog displayed and might be |
| 87 | +/// candidates for special-casing. |
33 | 88 | public var NSUserCancelledError: Int { return CocoaError.Code.userCancelled.rawValue }
|
| 89 | + |
| 90 | +/// The feature is not supported, either because the file system |
| 91 | +/// lacks the feature, or required libraries are missing, |
| 92 | +/// or other similar reasons. |
| 93 | +/// |
| 94 | +/// For example, some volumes may not support a Trash folder, so these methods |
| 95 | +/// will report failure by returning `false` or `nil` and |
| 96 | +/// an `NSError` with `NSFeatureUnsupportedError`. |
34 | 97 | public var NSFeatureUnsupportedError: Int { return CocoaError.Code.featureUnsupported.rawValue }
|
| 98 | + |
| 99 | +/// Executable is of a type that is not loadable in the current process. |
35 | 100 | public var NSExecutableNotLoadableError: Int { return CocoaError.Code.executableNotLoadable.rawValue }
|
| 101 | + |
| 102 | +/// Executable does not provide an architecture compatible with |
| 103 | +/// the current process. |
36 | 104 | public var NSExecutableArchitectureMismatchError: Int { return CocoaError.Code.executableArchitectureMismatch.rawValue }
|
| 105 | + |
| 106 | +/// Executable has Objective-C runtime information incompatible |
| 107 | +/// with the current process. |
37 | 108 | public var NSExecutableRuntimeMismatchError: Int { return CocoaError.Code.executableRuntimeMismatch.rawValue }
|
| 109 | + |
| 110 | +/// Executable cannot be loaded for some other reason, such as |
| 111 | +/// a problem with a library it depends on. |
38 | 112 | public var NSExecutableLoadError: Int { return CocoaError.Code.executableLoad.rawValue }
|
| 113 | + |
| 114 | +/// Executable fails due to linking issues. |
39 | 115 | public var NSExecutableLinkError: Int { return CocoaError.Code.executableLink.rawValue }
|
| 116 | + |
| 117 | +/// An error was encountered while parsing the property list. |
40 | 118 | public var NSPropertyListReadCorruptError: Int { return CocoaError.Code.propertyListReadCorrupt.rawValue }
|
| 119 | + |
| 120 | +/// The version number of the property list is unable to be determined. |
41 | 121 | public var NSPropertyListReadUnknownVersionError: Int { return CocoaError.Code.propertyListReadUnknownVersion.rawValue }
|
| 122 | + |
| 123 | +/// An stream error was encountered while reading the property list. |
42 | 124 | public var NSPropertyListReadStreamError: Int { return CocoaError.Code.propertyListReadStream.rawValue }
|
| 125 | + |
| 126 | +/// An stream error was encountered while writing the property list. |
43 | 127 | public var NSPropertyListWriteStreamError: Int { return CocoaError.Code.propertyListWriteStream.rawValue }
|
| 128 | + |
44 | 129 | public var NSPropertyListWriteInvalidError: Int { return CocoaError.Code.propertyListWriteInvalid.rawValue }
|
| 130 | + |
| 131 | +/// The XPC connection was interrupted. |
45 | 132 | public var NSXPCConnectionInterrupted: Int { return CocoaError.Code.xpcConnectionInterrupted.rawValue }
|
| 133 | + |
| 134 | +/// The XPC connection was invalid. |
46 | 135 | public var NSXPCConnectionInvalid: Int { return CocoaError.Code.xpcConnectionInvalid.rawValue }
|
| 136 | + |
| 137 | +/// The XPC connection reply was invalid. |
47 | 138 | public var NSXPCConnectionReplyInvalid: Int { return CocoaError.Code.xpcConnectionReplyInvalid.rawValue }
|
| 139 | + |
| 140 | +/// The item has not been uploaded to iCloud by another device yet. |
| 141 | +/// |
| 142 | +/// When this error occurs, you do not need to ask the system |
| 143 | +/// to start downloading the item. The system will download the item as soon |
| 144 | +/// as it can. If you want to know when the item becomes available, |
| 145 | +/// use an `NSMetadataQuer`y object to monitor changes to the file’s URL. |
48 | 146 | public var NSUbiquitousFileUnavailableError: Int { return CocoaError.Code.ubiquitousFileUnavailable.rawValue }
|
| 147 | + |
| 148 | +/// The item could not be uploaded to iCloud because it would make |
| 149 | +/// the account go over its quota. |
49 | 150 | public var NSUbiquitousFileNotUploadedDueToQuotaError: Int { return CocoaError.Code.ubiquitousFileNotUploadedDueToQuota.rawValue }
|
| 151 | + |
| 152 | +/// Connecting to the iCloud servers failed. |
50 | 153 | public var NSUbiquitousFileUbiquityServerNotAvailable: Int { return CocoaError.Code.ubiquitousFileUbiquityServerNotAvailable.rawValue }
|
| 154 | + |
51 | 155 | public var NSUserActivityHandoffFailedError: Int { return CocoaError.Code.userActivityHandoffFailed.rawValue }
|
| 156 | + |
52 | 157 | public var NSUserActivityConnectionUnavailableError: Int { return CocoaError.Code.userActivityConnectionUnavailable.rawValue }
|
| 158 | + |
53 | 159 | public var NSUserActivityRemoteApplicationTimedOutError: Int { return CocoaError.Code.userActivityRemoteApplicationTimedOut.rawValue }
|
| 160 | + |
54 | 161 | public var NSUserActivityHandoffUserInfoTooLargeError: Int { return CocoaError.Code.userActivityHandoffUserInfoTooLarge.rawValue }
|
| 162 | + |
55 | 163 | public var NSCoderReadCorruptError: Int { return CocoaError.Code.coderReadCorrupt.rawValue }
|
| 164 | + |
56 | 165 | public var NSCoderValueNotFoundError: Int { return CocoaError.Code.coderValueNotFound.rawValue }
|
57 | 166 |
|
58 | 167 | #if os(OSX) || os(iOS)
|
|
0 commit comments