Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IntPtrExtensions.cs « Core « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4e2d4f4df0df4737cc9d1e794762f8e398b4e8dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;
using System.Runtime.InteropServices;

namespace LibGit2Sharp.Core
{
    internal static class IntPtrExtensions
    {
        public static string MarshallAsString(this IntPtr intPtr)
        {
            return Marshal.PtrToStringAnsi(intPtr);
        }

        public static GitOid MarshalAsOid(this IntPtr intPtr)
        {
            return (GitOid)Marshal.PtrToStructure(intPtr, typeof(GitOid));
        }
    }
}