- `withNullTerminatedSystemChars` makes it clear that the null-termination is included. Operations where the null-termination is included should be obvious.
This brings the contents of this package up to date with versions of the ABI stable `System` module that shipped in recent iOS/macOS releases.
Most changes only touch internal implementation details, but some ABI-related fixes also affect the public API. There are no source-incompatible changes.
- ABI stability fixes (un-deprecate CModeT, don't use PlatformChar in inlinable contexts that need to deploy to iOS 14)
- New utilities: `_RawBuffer`, `Array<String>._withCStringArray`, `_withOptionalUnsafePointerOrNull`, `_withStackBuffer`, `system_memset`
- Prefer using explicit optionals to implicitly-unwrapped ones
- Add support for wildcard matching in mocking tests
- A bunch of new availability annotations. (I expect there will be more of these coming in future PRs.)
Availability annotations now follow a rigid syntax that mentions the swift-system version that introduced the entry point:
```
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
public func greeting() -> String {
"Hello"
}
```
This is designed to be processed by automated source generation tools.
When building on Windows, we rely on the `withPlatformString` to convert
the strings to the native platform encoding (UTF-16). The public
`FilePath.withPlatformString` is marked as `@_alwaysEmitIntoClient` and
references the `_withPlatformString` which is marked as `internal`.
Annotate the function as `@usableFromInline` to enable the inlined
method to reference this function.
Fix bug in _modify and add better testing. Change lexicallyNormal to
lexicallyNormalized() to match "ed" rule.
Fix up some comments and remove some dead code
Co-authored-by: Kyle Macomber <kmacomber@apple.com>
This API is fully redundant with .kind == .regular and could be a source of
confusion and namespace pollution. Drop it for now, and we can add something
equivalent in the future when we have more component-analysis APIs.