-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implementing (initial) of Stream and InputStream. #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} | ||
|
||
public init(data: Data) { | ||
NSUnimplemented() | ||
let nsData = data._bridgeToObjectiveC() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using NSData as an intermediate to convert the Data object to the expected CFData. Currently, this is the available option. Found a work item which says so: https://bugs.swift.org/browse/SR-1797
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an internal helper property for this: data._cfObject
This PR has common changes with: #443 for the below mentioned files. TestFoundation/TestNSStream.swift |
d95c73a
to
84c648e
Compare
@@ -78,6 +78,8 @@ const CFStringRef kCFStreamPropertyDataWritten; | |||
CF_EXPORT | |||
CFReadStreamRef CFReadStreamCreateWithBytesNoCopy(CFAllocatorRef alloc, const UInt8 *bytes, CFIndex length, CFAllocatorRef bytesDeallocator); | |||
|
|||
CF_EXPORT CFReadStreamRef CFReadStreamCreateWithData(CFAllocatorRef alloc, CFDataRef data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should be a private method, putting it here makes it public API which I am not certain we really want to do just yet. Can you move this declaration to ForFoundationOnly.h or ForSwiftFoundationOnly.h?
582206e
to
09b5a58
Compare
@phausler Thanks for reviewing the changes. Have addressed the comments. Please take a look at the modified code. |
@@ -7,6 +7,10 @@ | |||
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | |||
// | |||
|
|||
#if os(Linux) | |||
import CoreFoundation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be for all operating systems not just Linux
Other than the #if it looks good |
09b5a58
to
38908c1
Compare
@phausler #if has been removed. |
@swift-ci Please test |
@mamabusi really excited to see this work in upcoming snapshots! |
[pull] swiftwasm from main
No description provided.