/// <summary> /// Gets the blob content in a <see cref="Stream"/> as it would be /// checked out to the working directory. /// <param name="filteringOptions">Parameter controlling content filtering behavior</param> /// </summary> public virtual Stream GetContentStream(FilteringOptions filteringOptions) { Ensure.ArgumentNotNull(filteringOptions, "filteringOptions"); return(Proxy.git_blob_filtered_content_stream(repo.Handle, Id, filteringOptions.HintPath, false)); }
/// <summary> /// Gets the blob content, decoded with UTF8 encoding if the encoding cannot be detected /// </summary> /// <param name="filteringOptions">Parameter controlling content filtering behavior</param> /// <returns>Blob content as text.</returns> public virtual string GetContentText(FilteringOptions filteringOptions) { return(GetContentText(filteringOptions, null)); }
/// <summary> /// Gets the blob content as it would be checked out to the /// working directory, decoded with the specified encoding, /// or according to byte order marks, with UTF8 as fallback, /// if <paramref name="encoding"/> is null. /// </summary> /// <param name="filteringOptions">Parameter controlling content filtering behavior</param> /// <param name="encoding">The encoding of the text. (default: detected or UTF8)</param> /// <returns>Blob content as text.</returns> public virtual string GetContentText(FilteringOptions filteringOptions, Encoding encoding) { Ensure.ArgumentNotNull(filteringOptions, "filteringOptions"); return(ReadToEnd(GetContentStream(filteringOptions), encoding)); }