-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add section on using library in Swift #26
Add section on using library in Swift #26
Conversation
This is a starting point for documenting "Getting Started" with this library using Swift. The section is somewhat large, so I wonder if it wouldn't be better to include an entire demo project for Swift with this README content instead. Either way, let me know. |
- Contains a full working example that should work out of the box.
0f85c92
to
3320745
Compare
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.
I would move it under docs/swift/README.md
right away so that contributor history is not lost on the page. I am working on the document restructure and the MkDocs site, so I will incorporate it there
README.md
Outdated
|
||
This module can then be imported and used from inside the application. However, the only challenge is dealing with C-style strings that are typically utf8 and are null terminated, so they require a bit of extra support for translation in Swift. | ||
|
||
Here is the `generic-containers` demo translated into Swift, with an exstension to properly translate a `String` to a utf8 string for C: |
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.
I guess it will get easier if we have a C++ binding header with std::string
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.
I agree with that. Also, Swift has some decent C++ interop these days, so it would make things much smoother to have a C++ interface with std::string being used.
@xtremekforever I will merge #27 once the build passes. If you could copy over the content to the Swift stub and reference it from README, it would be appreciated! |
@oleg-nenashev updated the pull request with the latest from testcontainers-c main and moved all the content for Swift to docs/swift/README.md! |
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.
Thanks a lot!
This adds some documentation on how to get started using the testcontainers-c library in Swift.
What does this PR do?
Describes with examples on how to setup a CTestContainers module in Swift that imports the
testcontainers-c
header and library, and shows off how to run the generic wiremock demo in Swift as well.Why is it important?
Users of Swift may be interested in using this library in the future as it develops. This gives a good idea of how to use it without having to be an expert in C interop.
Related issues
N/A
How to test this PR
Follow the instructions in the Swift README at docs/swift/README.md to verify that the steps work correctly as described.