internal static void ThrowIfNotOk(CurlShareCode code) { if (code != CurlShareCode.Ok) { throw new CurlShareOptionException(code); } }
private void setLastError(CurlShareCode code, CurlShareOption opt) { if (_lastErrorCode == CurlShareCode.Ok && code != CurlShareCode.Ok) { _lastErrorCode = code; _lastErrorDescription = string.Format("Error: {0} setting option {1}", StrError(code), opt); } }
private void setLastError(CurlShareCode code, CurlShareOption opt) { if ((LastErrorCode == CurlShareCode.Ok) && (code != CurlShareCode.Ok)) { LastErrorCode = code; LastErrorDescription = $"Error: {StrError(code)} setting option {opt}"; } }
public static extern IntPtr curl_share_strerror(CurlShareCode errorCode);
// ReSharper disable once HeapView.BoxingAllocation internal CurlShareOptionException(CurlShareCode error) : base(CurlNative.GetShareError(error)) { Error = error; }
/// <summary> /// Return a String description of an error code. /// </summary> /// <param name="errorNum"> /// The <see cref="CurlShareCode" /> for which to obtain the error /// string description. /// </param> /// <returns>The string description.</returns> public String StrError(CurlShareCode errorNum) { return(Marshal.PtrToStringAnsi(NativeMethods.curl_share_strerror(errorNum))); }
internal static extern IntPtr curl_share_strerror(CurlShareCode errorCode);
/// <summary> /// Return a String description of an error code. /// </summary> /// <param name="errorNum"> /// The <see cref="CurlShareCode" /> for which to obtain the error /// string description. /// </param> /// <returns>The string description.</returns> public String StrError(CurlShareCode errorNum) { return Marshal.PtrToStringAnsi(NativeMethods.curl_share_strerror(errorNum)); }
private static extern IntPtr ShareStrError(CurlShareCode errornum);
internal static string GetShareError(CurlShareCode code) { return(MarshalString.NativeToString(ShareStrError(code))); }