public static bool Success(IntPtr handle, yajl_status code) { switch (code) { case yajl_status.yajl_status_ok: return true; case yajl_status.yajl_status_client_canceled: return false; default: IntPtr str = yajl_get_error(handle, 1, IntPtr.Zero, IntPtr.Zero); var exp = new Exception(Marshal.PtrToStringAuto(str)); yajl_free_error(handle, str); throw exp; } }
public static bool Success(IntPtr handle, yajl_status code) { switch (code) { case yajl_status.yajl_status_ok: return(true); case yajl_status.yajl_status_client_canceled: return(false); default: IntPtr str = yajl_get_error(handle, 1, IntPtr.Zero, IntPtr.Zero); var exp = new Exception(Marshal.PtrToStringAuto(str)); yajl_free_error(handle, str); throw exp; } }
static string GetString(yajl_status code) { return(new string(yajl_status_to_string(code))); }
static extern sbyte *yajl_status_to_string(yajl_status code);
static string GetString(yajl_status code) { return new string(yajl_status_to_string(code)); }