Create location simulation example in cpp

This commit is contained in:
Jackson Coxson
2025-08-15 14:56:02 -06:00
parent b00be3fa26
commit 36770ffd67
12 changed files with 820 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
// Jackson Coxson
#include <idevice++/location_simulation.hpp>
namespace IdeviceFFI {
std::optional<LocationSimulation> LocationSimulation::create(RemoteServer& server, FfiError& err) {
LocationSimulationHandle* out = nullptr;
if (IdeviceFfiError* e = ::location_simulation_new(server.raw(), &out)) {
err = FfiError(e);
return std::nullopt;
}
return LocationSimulation::adopt(out);
}
bool LocationSimulation::clear(FfiError& err) {
if (IdeviceFfiError* e = ::location_simulation_clear(handle_.get())) {
err = FfiError(e);
return false;
}
return true;
}
bool LocationSimulation::set(double latitude, double longitude, FfiError& err) {
if (IdeviceFfiError* e = ::location_simulation_set(handle_.get(), latitude, longitude)) {
err = FfiError(e);
return false;
}
return true;
}
} // namespace IdeviceFFI