Remove cpp 17 features and implement Rust into CPP

This commit is contained in:
Jackson Coxson
2025-08-29 14:19:28 -06:00
parent 4fde7cf06b
commit 1169408da1
41 changed files with 1638 additions and 1212 deletions

View File

@@ -4,29 +4,29 @@
namespace IdeviceFFI {
std::optional<LocationSimulation> LocationSimulation::create(RemoteServer& server, FfiError& err) {
Result<LocationSimulation, FfiError> LocationSimulation::create(RemoteServer& server) {
LocationSimulationHandle* out = nullptr;
if (IdeviceFfiError* e = ::location_simulation_new(server.raw(), &out)) {
err = FfiError(e);
return std::nullopt;
FfiError e(::location_simulation_new(server.raw(), &out));
if (e) {
return Err(e);
}
return LocationSimulation::adopt(out);
return Ok(LocationSimulation::adopt(out));
}
bool LocationSimulation::clear(FfiError& err) {
if (IdeviceFfiError* e = ::location_simulation_clear(handle_.get())) {
err = FfiError(e);
return false;
Result<void, FfiError> LocationSimulation::clear() {
FfiError e(::location_simulation_clear(handle_.get()));
if (e) {
return Err(e);
}
return true;
return Ok();
}
bool LocationSimulation::set(double latitude, double longitude, FfiError& err) {
if (IdeviceFfiError* e = ::location_simulation_set(handle_.get(), latitude, longitude)) {
err = FfiError(e);
return false;
Result<void, FfiError> LocationSimulation::set(double latitude, double longitude) {
FfiError e(::location_simulation_set(handle_.get(), latitude, longitude));
if (e) {
return Err(e);
}
return true;
return Ok();
}
} // namespace IdeviceFFI