예제 #1
0
 internal static void ThrowIfNotOk(CurlShareCode code)
 {
     if (code != CurlShareCode.Ok)
     {
         throw new CurlShareOptionException(code);
     }
 }
예제 #2
0
파일: CurlShare.cs 프로젝트: zfyno1/Jackett
 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);
     }
 }
예제 #3
0
 private void setLastError(CurlShareCode code, CurlShareOption opt)
 {
     if ((LastErrorCode == CurlShareCode.Ok) && (code != CurlShareCode.Ok))
     {
         LastErrorCode        = code;
         LastErrorDescription = $"Error: {StrError(code)} setting option {opt}";
     }
 }
예제 #4
0
 public static extern IntPtr curl_share_strerror(CurlShareCode errorCode);
예제 #5
0
 // ReSharper disable once HeapView.BoxingAllocation
 internal CurlShareOptionException(CurlShareCode error) : base(CurlNative.GetShareError(error))
 {
     Error = error;
 }
예제 #6
0
파일: CurlShare.cs 프로젝트: zfyno1/Jackett
 /// <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)));
 }
예제 #7
0
 internal static extern IntPtr curl_share_strerror(CurlShareCode errorCode);
예제 #8
0
 /// <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));
 }
예제 #9
0
 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);
     }
 }
예제 #10
0
 private static extern IntPtr ShareStrError(CurlShareCode errornum);
예제 #11
0
 internal static string GetShareError(CurlShareCode code)
 {
     return(MarshalString.NativeToString(ShareStrError(code)));
 }