Skip to content

Commit 47155da

Browse files
committed
x
Corrected bad wrong link to API design guidelines Link has probably been changed since the creation of the file. Disable test_completePathIntoString tests since it can take a very long time SR-644 to follow-up on this. Fix key's typo to NSFileGroupOwnerAccountName The key NSFileGroupOwnerAccountId is a typo as it is later overwritten by an NSNumber on line 381. The correct constant is NSFileGroupOwnerAccountName to correctly add the String of the account's name to the dictionary. Revert "Fix key's typo to NSFileGroupOwnerAccountName" Added few tests for NSMutableCharacterSet Implement NSTemporaryDirectory * Darwin should check against `confstr` using `_CS_DARWIN_USER_TEMP_DIR` * All platforms check against TMPDIR environment variable * Fall back to /tmp/ Addressing 32-bit issues with NSXMLNodeOptions
1 parent b72b3d8 commit 47155da

File tree

1 file changed

+29
-35
lines changed

1 file changed

+29
-35
lines changed

Foundation/NSXMLNodeOptions.swift

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -43,55 +43,49 @@
4343
@constant NSXMLDocumentIncludeContentTypeDeclaration Include a content type declaration for HTML or XHTML
4444
*/
4545

46-
#if arch(x86_64) || arch(arm64)
47-
public typealias NSXMLNodeOptionRawType = Int
48-
#else
49-
public typealias NSXMLNodeOptionRawType = Int64
50-
#endif
51-
52-
public var NSXMLNodeOptionsNone: NSXMLNodeOptionRawType { return 0 }
46+
public var NSXMLNodeOptionsNone: Int { return 0 }
5347

5448
// Init
55-
public var NSXMLNodeIsCDATA: NSXMLNodeOptionRawType { return 1 << 0 }
56-
public var NSXMLNodeExpandEmptyElement: NSXMLNodeOptionRawType { return 1 << 1 } // <a></a>
57-
public var NSXMLNodeCompactEmptyElement: NSXMLNodeOptionRawType { return 1 << 2 } // <a/>
58-
public var NSXMLNodeUseSingleQuotes: NSXMLNodeOptionRawType { return 1 << 3 }
59-
public var NSXMLNodeUseDoubleQuotes: NSXMLNodeOptionRawType { return 1 << 4 }
60-
public var NSXMLNodeNeverEscapeContents: NSXMLNodeOptionRawType { return 1 << 5 }
49+
public var NSXMLNodeIsCDATA: Int { return 1 << 0 }
50+
public var NSXMLNodeExpandEmptyElement: Int { return 1 << 1 } // <a></a>
51+
public var NSXMLNodeCompactEmptyElement: Int { return 1 << 2 } // <a/>
52+
public var NSXMLNodeUseSingleQuotes: Int { return 1 << 3 }
53+
public var NSXMLNodeUseDoubleQuotes: Int { return 1 << 4 }
54+
public var NSXMLNodeNeverEscapeContents: Int { return 1 << 5 }
6155

6256
// Tidy
63-
public var NSXMLDocumentTidyHTML: NSXMLNodeOptionRawType { return 1 << 9 }
64-
public var NSXMLDocumentTidyXML: NSXMLNodeOptionRawType { return 1 << 10 }
57+
public var NSXMLDocumentTidyHTML: Int { return 1 << 9 }
58+
public var NSXMLDocumentTidyXML: Int { return 1 << 10 }
6559

6660
// Validate
67-
public var NSXMLDocumentValidate: NSXMLNodeOptionRawType { return 1 << 13 }
61+
public var NSXMLDocumentValidate: Int { return 1 << 13 }
6862

6963
// External Entity Loading
7064
// Choose only zero or one option. Choosing none results in system-default behavior.
71-
public var NSXMLNodeLoadExternalEntitiesAlways: NSXMLNodeOptionRawType { return 1 << 14 }
72-
public var NSXMLNodeLoadExternalEntitiesSameOriginOnly: NSXMLNodeOptionRawType { return 1 << 15 }
73-
public var NSXMLNodeLoadExternalEntitiesNever: NSXMLNodeOptionRawType { return 1 << 19 }
65+
public var NSXMLNodeLoadExternalEntitiesAlways: Int { return 1 << 14 }
66+
public var NSXMLNodeLoadExternalEntitiesSameOriginOnly: Int { return 1 << 15 }
67+
public var NSXMLNodeLoadExternalEntitiesNever: Int { return 1 << 19 }
7468

7569
// Parse
76-
public var NSXMLDocumentXInclude: NSXMLNodeOptionRawType { return 1 << 16 }
70+
public var NSXMLDocumentXInclude: Int { return 1 << 16 }
7771

7872
// Output
79-
public var NSXMLNodePrettyPrint: NSXMLNodeOptionRawType { return 1 << 17 }
80-
public var NSXMLDocumentIncludeContentTypeDeclaration: NSXMLNodeOptionRawType { return 1 << 18 }
73+
public var NSXMLNodePrettyPrint: Int { return 1 << 17 }
74+
public var NSXMLDocumentIncludeContentTypeDeclaration: Int { return 1 << 18 }
8175

8276
// Fidelity
83-
public var NSXMLNodePreserveNamespaceOrder: NSXMLNodeOptionRawType { return 1 << 20 }
84-
public var NSXMLNodePreserveAttributeOrder: NSXMLNodeOptionRawType { return 1 << 21 }
85-
public var NSXMLNodePreserveEntities: NSXMLNodeOptionRawType { return 1 << 22 }
86-
public var NSXMLNodePreservePrefixes: NSXMLNodeOptionRawType { return 1 << 23 }
87-
public var NSXMLNodePreserveCDATA: NSXMLNodeOptionRawType { return 1 << 24 }
88-
public var NSXMLNodePreserveWhitespace: NSXMLNodeOptionRawType { return 1 << 25 }
89-
public var NSXMLNodePreserveDTD: NSXMLNodeOptionRawType { return 1 << 26 }
90-
public var NSXMLNodePreserveCharacterReferences: NSXMLNodeOptionRawType { return 1 << 27 }
91-
public var NSXMLNodePromoteSignificantWhitespace: NSXMLNodeOptionRawType { return 1 << 28 }
92-
public var NSXMLNodePreserveEmptyElements: NSXMLNodeOptionRawType { return NSXMLNodeExpandEmptyElement | NSXMLNodeCompactEmptyElement }
93-
public var NSXMLNodePreserveQuotes: NSXMLNodeOptionRawType { return NSXMLNodeUseSingleQuotes | NSXMLNodeUseDoubleQuotes }
94-
public var NSXMLNodePreserveAll: NSXMLNodeOptionRawType { return
77+
public var NSXMLNodePreserveNamespaceOrder: Int { return 1 << 20 }
78+
public var NSXMLNodePreserveAttributeOrder: Int { return 1 << 21 }
79+
public var NSXMLNodePreserveEntities: Int { return 1 << 22 }
80+
public var NSXMLNodePreservePrefixes: Int { return 1 << 23 }
81+
public var NSXMLNodePreserveCDATA: Int { return 1 << 24 }
82+
public var NSXMLNodePreserveWhitespace: Int { return 1 << 25 }
83+
public var NSXMLNodePreserveDTD: Int { return 1 << 26 }
84+
public var NSXMLNodePreserveCharacterReferences: Int { return 1 << 27 }
85+
public var NSXMLNodePromoteSignificantWhitespace: Int { return 1 << 28 }
86+
public var NSXMLNodePreserveEmptyElements: Int { return NSXMLNodeExpandEmptyElement | NSXMLNodeCompactEmptyElement }
87+
public var NSXMLNodePreserveQuotes: Int { return NSXMLNodeUseSingleQuotes | NSXMLNodeUseDoubleQuotes }
88+
public var NSXMLNodePreserveAll: Int { return
9589
NSXMLNodePreserveNamespaceOrder |
9690
NSXMLNodePreserveAttributeOrder |
9791
NSXMLNodePreserveEntities |
@@ -102,6 +96,6 @@ public var NSXMLNodePreserveAll: NSXMLNodeOptionRawType { return
10296
NSXMLNodePreserveWhitespace |
10397
NSXMLNodePreserveDTD |
10498
NSXMLNodePreserveCharacterReferences |
105-
0xFFF00000 // high 12 bits
99+
Int(bitPattern: 0xFFF00000) // high 12 bits
106100
}
107101

0 commit comments

Comments
 (0)