Skip to content

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

Merged
merged 1 commit into from
Jul 13, 2016

Conversation

mamabusi
Copy link
Contributor

No description provided.

}

public init(data: Data) {
NSUnimplemented()
let nsData = data._bridgeToObjectiveC()
Copy link
Contributor Author

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

Copy link
Contributor

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

@mamabusi
Copy link
Contributor Author

mamabusi commented Jul 11, 2016

This PR has common changes with: #443 for the below mentioned files.

TestFoundation/TestNSStream.swift
TestFoundation/main.swift
Foundation/NSStream.swift

@@ -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);
Copy link
Contributor

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?

@mamabusi mamabusi force-pushed the nsstream-branch branch 3 times, most recently from 582206e to 09b5a58 Compare July 13, 2016 13:52
@mamabusi
Copy link
Contributor Author

@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
Copy link
Contributor

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

@phausler
Copy link
Contributor

Other than the #if it looks good

@mamabusi
Copy link
Contributor Author

@phausler #if has been removed.

@phausler
Copy link
Contributor

@swift-ci Please test

@phausler phausler merged commit 5b44122 into swiftlang:master Jul 13, 2016
@loganwright
Copy link

@mamabusi really excited to see this work in upcoming snapshots!

@mamabusi mamabusi deleted the nsstream-branch branch December 22, 2017 08:11
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants