Skip to content

Library written in C++ to read large files using a caching system. This is a testcase to learn how to mix C++ and Swift, and how to use the test target to test the library in Swift.

Notifications You must be signed in to change notification settings

RetepV/LargeFileReaderLib

Repository files navigation

LargeFileReaderLib

Manage a file for reading using a caching mechanism, where the cache block size and the total size of the cache can be specified. This makes the amount of memory used deterministic, which is sometimes what we want, if we are managing huge files.

There are two targets: 1) the library itself, 2) a Swift Testing test target.

This library is useful, but the main reason for developing it was to test Swift and C++ interoperability.

I started out by reading these:

Then got into this WWDC session:

Donwloaded and tried this sample project:

But then I found that the accompanying sample project https://developer.apple.com/documentation/Swift/CallingAPIsAcrossLanguageBoundaries does not compile anymore since Xcode 15.4. Xcode does not compile the static C++ functions into the ForestBuilder-Swift.h anymore for some reason. https://forums.swift.org/t/use-swift-framework-code-in-c-app-missing-swift-h-header/70914/10

So, for now, it seems we need to use a .mm wrapper again.

About

Library written in C++ to read large files using a caching system. This is a testcase to learn how to mix C++ and Swift, and how to use the test target to test the library in Swift.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published