-
Notifications
You must be signed in to change notification settings - Fork 95
Experimental C++ version of InputSource and company
#599
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR refactors the InputSource implementation from Objective-C to C++, introducing a new C++ class hierarchy with Objective-C wrappers. The main changes consolidate multiple Objective-C subclasses into a unified C++ implementation using std::expected for error handling.
Key changes:
- Replaces Objective-C subclasses (SFBDataInputSource, SFBFileInputSource, etc.) with C++ implementations
- Introduces new C++ base class
InputSourcewith concrete implementations:DataInput,FileInput,FileContentsInput, andMemoryMappedFileInput - Updates SFBInputSource to act as a wrapper around C++ implementations
Reviewed Changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| Package.swift | Updates C++ standard from C++20 to C++23 to support std::expected |
| scope_exit.hpp | Adds RAII helper for cleanup operations |
| InputSource.hpp/cpp | New C++ base class with virtual interface |
| DataInput.hpp/cpp | C++ implementation for data-based input sources |
| FileInput.hpp/cpp | C++ implementation for file-based input sources |
| FileContentsInput.hpp/cpp | C++ implementation for loading entire file contents |
| MemoryMappedFileInput.hpp/cpp | C++ implementation for memory-mapped files |
| SFBInputSource.mm | Refactored to wrap C++ implementations |
| SFBInputSource+Internal.h | Updated to store C++ unique_ptr instead of URL |
| SFB*InputSource.h/m (deleted) | Removed old Objective-C implementations |
| SFBAudioEngineTests.swift | Updated test to verify initial state |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Only
std::exceptionsubclasses are thrown.