private static void ParseReturnCodeValue(int ret) { PHYSFS_ErrorCode errorCode = (PHYSFS_ErrorCode)ret; if (errorCode != PHYSFS_ErrorCode.PHYSFS_ERR_OK) { throw new PhysFSException(errorCode); } }
public PhysFSException(PHYSFS_ErrorCode errorCode) : base($"[{errorCode}] {Marshal.PtrToStringAnsi(Interop.PHYSFS_getErrorByCode(errorCode))}") { ErrorCode = errorCode; }
public static extern void PHYSFS_setErrorCode(PHYSFS_ErrorCode code); //
public static extern IntPtr PHYSFS_getErrorByCode(PHYSFS_ErrorCode code); // IntPtr => const char*;