Skip to content

Conversation

@sbooth
Copy link
Owner

@sbooth sbooth commented Nov 3, 2025

Only std::exception subclasses are thrown.

Copy link
Contributor

Copilot AI left a 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 InputSource with concrete implementations: DataInput, FileInput, FileContentsInput, and MemoryMappedFileInput
  • 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.

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.

2 participants