usbmuxd class implementation for usbmuxd

This commit is contained in:
Jackson Coxson
2025-07-22 10:49:14 -06:00
parent f384df91d8
commit 032a6a6751
8 changed files with 689 additions and 0 deletions

29
cpp/include/ffi.hpp Normal file
View File

@@ -0,0 +1,29 @@
// Jackson Coxson
#ifndef IDEVICE_FFI
#define IDEVICE_FFI
#include "idevice.hpp"
#include <string>
namespace IdeviceFFI {
struct FfiError {
int32_t code = 0;
std::string message;
static FfiError from(const IdeviceFfiError* err) {
FfiError out;
if (err) {
out.code = err->code;
out.message = err->message ? err->message : "";
idevice_error_free(const_cast<IdeviceFfiError*>(err));
}
return out;
}
static FfiError success() { return {0, ""}; }
explicit operator bool() const { return code != 0; }
};
} // namespace IdeviceFFI
#endif