diff options
author | Metalrom <romain.magny@gmail.com> | 2013-01-14 14:46:45 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-01-14 18:15:37 +0400 |
commit | 95a50c31370c43aba6ee66b8705df45810dac0e8 (patch) | |
tree | caa19274df006fe86692949ac0cfd95e89ecaf44 /LibGit2Sharp/Blob.cs | |
parent | d31f95ad0de083086ca7f2a2e8e75d588ec45025 (diff) |
Introduce Blob.IsBinary
Diffstat (limited to 'LibGit2Sharp/Blob.cs')
-rw-r--r-- | LibGit2Sharp/Blob.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/LibGit2Sharp/Blob.cs b/LibGit2Sharp/Blob.cs index 40396080..ef4b31ce 100644 --- a/LibGit2Sharp/Blob.cs +++ b/LibGit2Sharp/Blob.cs @@ -10,6 +10,7 @@ namespace LibGit2Sharp public class Blob : GitObject { private readonly ILazy<Int64> lazySize; + private readonly ILazy<bool> lazyIsBinary; /// <summary> /// Needed for mocking purposes. @@ -21,6 +22,7 @@ namespace LibGit2Sharp : base(repo, id) { lazySize = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_blob_rawsize); + lazyIsBinary = GitObjectLazyGroup.Singleton(repo, id, Proxy.git_blob_is_binary); } /// <summary> @@ -29,6 +31,11 @@ namespace LibGit2Sharp public virtual int Size { get { return (int)lazySize.Value; } } /// <summary> + /// Determine if the blob content is most certainly binary or not. + /// </summary> + public virtual bool IsBinary { get { return lazyIsBinary.Value; } } + + /// <summary> /// Gets the blob content in a <see cref="byte" /> array. /// </summary> public virtual byte[] Content |