/// <summary> /// Enumerates each string from the array using the UTF-8 marshaler. /// </summary> public String[] ReadStrings() { var count = checked ((int)Array.Count.ToUInt32()); String[] toReturn = new String[count]; for (int i = 0; i < count; i++) { toReturn[i] = LaxUtf8Marshaler.FromNative(Marshal.ReadIntPtr(Array.Strings, i * IntPtr.Size)); } return(toReturn); }
private static unsafe void HandleError(int result) { string errorMessage; GitErrorCategory errorCategory = GitErrorCategory.Unknown; GitError * error = NativeMethods.git_error_last(); if (error == null) { errorMessage = "No error message has been provided by the native library"; } else { errorMessage = LaxUtf8Marshaler.FromNative(error->Message); } Func <string, GitErrorCategory, GitException> exceptionBuilder; if (!GitErrorsToGitExceptions.TryGetValue((GitErrorCode)result, out exceptionBuilder)) { exceptionBuilder = (m, c) => new GitException(m, c); } throw exceptionBuilder(errorMessage, errorCategory); }
public new static FilePath FromBuffer(byte[] buffer) { return(LaxUtf8Marshaler.FromBuffer(buffer)); }
public new static unsafe FilePath FromNative(char *buffer) { return(LaxUtf8Marshaler.FromNative(buffer)); }
public new static FilePath FromNative(IntPtr pNativeData) { return(LaxUtf8Marshaler.FromNative(pNativeData)); }