Git.Core.Blob.GetText C# (CSharp) Method

GetText() public method

public GetText ( ) : string
return string
        public string GetText()
        {
            if (IsText ())
                return Encoding.UTF8.GetString (data);

            throw new FieldAccessException ("The data in this blob is not text");
        }

Usage Example

Example #1
0
        public static Item[] DiffBlobs(Blob blobA, Blob blobB)
        {
            if (blobA.IsText () && blobB.IsText ())
                return DiffText (blobA.GetText (), blobB.GetText (), false, false, false);

            throw new ArgumentException ("non or one of the blobs is a text");
        }