< Summary - Jellyfin

Information
Class: MediaBrowser.MediaEncoding.BdInfo.BdInfoFileInfo
Assembly: MediaBrowser.MediaEncoding
File(s): /srv/git/jellyfin/MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 13
Coverable lines: 13
Total lines: 68
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
get_Name()100%210%
get_FullName()100%210%
get_Extension()100%210%
get_Length()100%210%
get_IsDir()100%210%
OpenRead()100%210%
OpenText()100%210%

File(s)

/srv/git/jellyfin/MediaBrowser.MediaEncoding/BdInfo/BdInfoFileInfo.cs

#LineLine coverage
 1using System.IO;
 2using MediaBrowser.Model.IO;
 3
 4namespace MediaBrowser.MediaEncoding.BdInfo;
 5
 6/// <summary>
 7/// Class BdInfoFileInfo.
 8/// </summary>
 9public class BdInfoFileInfo : BDInfo.IO.IFileInfo
 10{
 11    private readonly FileSystemMetadata _impl;
 12
 13    /// <summary>
 14    /// Initializes a new instance of the <see cref="BdInfoFileInfo" /> class.
 15    /// </summary>
 16    /// <param name="impl">The <see cref="FileSystemMetadata" />.</param>
 17    public BdInfoFileInfo(FileSystemMetadata impl)
 18    {
 019        _impl = impl;
 020    }
 21
 22    /// <summary>
 23    /// Gets the name.
 24    /// </summary>
 025    public string Name => _impl.Name;
 26
 27    /// <summary>
 28    /// Gets the full name.
 29    /// </summary>
 030    public string FullName => _impl.FullName;
 31
 32    /// <summary>
 33    /// Gets the extension.
 34    /// </summary>
 035    public string Extension => _impl.Extension;
 36
 37    /// <summary>
 38    /// Gets the length.
 39    /// </summary>
 040    public long Length => _impl.Length;
 41
 42    /// <summary>
 43    /// Gets a value indicating whether this is a directory.
 44    /// </summary>
 045    public bool IsDir => _impl.IsDirectory;
 46
 47    /// <summary>
 48    /// Gets a file as file stream.
 49    /// </summary>
 50    /// <returns>A <see cref="FileStream" /> for the file.</returns>
 51    public Stream OpenRead()
 52    {
 053        return new FileStream(
 054            FullName,
 055            FileMode.Open,
 056            FileAccess.Read,
 057            FileShare.Read);
 58    }
 59
 60    /// <summary>
 61    /// Gets a files's content with a stream reader.
 62    /// </summary>
 63    /// <returns>A <see cref="StreamReader" /> for the file's content.</returns>
 64    public StreamReader OpenText()
 65    {
 066        return new StreamReader(OpenRead());
 67    }
 68}