< Summary

Information
Class: Renci.SshNet.Sftp.SftpFileSytemInformation
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\SftpFileSystemInformation.cs
Line coverage
100%
Covered lines: 39
Uncovered lines: 0
Coverable lines: 39
Total lines: 165
Line coverage: 100%
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

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_FileSystemBlockSize()100%1100%
get_BlockSize()100%1100%
get_TotalBlocks()100%1100%
get_FreeBlocks()100%1100%
get_AvailableBlocks()100%1100%
get_TotalNodes()100%1100%
get_FreeNodes()100%1100%
get_AvailableNodes()100%1100%
get_Sid()100%1100%
get_IsReadOnly()100%1100%
get_SupportsSetUid()100%1100%
get_MaxNameLenght()100%1100%
.ctor(...)100%1100%
SaveData(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\SftpFileSystemInformation.cs

#LineLine coverage
 1using Renci.SshNet.Common;
 2
 3namespace Renci.SshNet.Sftp
 4{
 5    /// <summary>
 6    /// Contains File system information exposed by statvfs@openssh.com request.
 7    /// </summary>
 8#pragma warning disable SA1649 // File name should match first type name
 9    public class SftpFileSytemInformation
 10#pragma warning restore SA1649 // File name should match first type name
 11    {
 12#pragma warning disable SA1310 // Field names should not contain underscore
 13        internal const ulong SSH_FXE_STATVFS_ST_RDONLY = 0x1;
 14        internal const ulong SSH_FXE_STATVFS_ST_NOSUID = 0x2;
 15#pragma warning restore SA1310 // Field names should not contain underscore
 16
 17        private readonly ulong _flag;
 18
 19        /// <summary>
 20        /// Gets the file system block size.
 21        /// </summary>
 22        /// <value>
 23        /// The file system block size.
 24        /// </value>
 3025        public ulong FileSystemBlockSize { get; private set; }
 26
 27        /// <summary>
 28        /// Gets the fundamental file system size of the block.
 29        /// </summary>
 30        /// <value>
 31        /// The fundamental file system block size.
 32        /// </value>
 3033        public ulong BlockSize { get; private set; }
 34
 35        /// <summary>
 36        /// Gets the total blocks.
 37        /// </summary>
 38        /// <value>
 39        /// The total blocks.
 40        /// </value>
 3041        public ulong TotalBlocks { get; private set; }
 42
 43        /// <summary>
 44        /// Gets the free blocks.
 45        /// </summary>
 46        /// <value>
 47        /// The free blocks.
 48        /// </value>
 3049        public ulong FreeBlocks { get; private set; }
 50
 51        /// <summary>
 52        /// Gets the available blocks.
 53        /// </summary>
 54        /// <value>
 55        /// The available blocks.
 56        /// </value>
 3357        public ulong AvailableBlocks { get; private set; }
 58
 59        /// <summary>
 60        /// Gets the total nodes.
 61        /// </summary>
 62        /// <value>
 63        /// The total nodes.
 64        /// </value>
 3065        public ulong TotalNodes { get; private set; }
 66
 67        /// <summary>
 68        /// Gets the free nodes.
 69        /// </summary>
 70        /// <value>
 71        /// The free nodes.
 72        /// </value>
 3073        public ulong FreeNodes { get; private set; }
 74
 75        /// <summary>
 76        /// Gets the available nodes.
 77        /// </summary>
 78        /// <value>
 79        /// The available nodes.
 80        /// </value>
 3081        public ulong AvailableNodes { get; private set; }
 82
 83        /// <summary>
 84        /// Gets the sid.
 85        /// </summary>
 86        /// <value>
 87        /// The sid.
 88        /// </value>
 3089        public ulong Sid { get; private set; }
 90
 91        /// <summary>
 92        /// Gets a value indicating whether this instance is read only.
 93        /// </summary>
 94        /// <value>
 95        /// <see langword="true"/> if this instance is read only; otherwise, <see langword="false"/>.
 96        /// </value>
 97        public bool IsReadOnly
 98        {
 1899            get { return (_flag & SSH_FXE_STATVFS_ST_RDONLY) == SSH_FXE_STATVFS_ST_RDONLY; }
 100        }
 101
 102        /// <summary>
 103        /// Gets a value indicating whether [supports set uid].
 104        /// </summary>
 105        /// <value>
 106        /// <see langword="true"/> if [supports set uid]; otherwise, <see langword="false"/>.
 107        /// </value>
 108        public bool SupportsSetUid
 109        {
 18110            get { return (_flag & SSH_FXE_STATVFS_ST_NOSUID) == 0; }
 111        }
 112
 113        /// <summary>
 114        /// Gets the max name lenght.
 115        /// </summary>
 116        /// <value>
 117        /// The max name lenght.
 118        /// </value>
 30119        public ulong MaxNameLenght { get; private set; }
 120
 121        /// <summary>
 122        /// Initializes a new instance of the <see cref="SftpFileSytemInformation" /> class.
 123        /// </summary>
 124        /// <param name="bsize">The bsize.</param>
 125        /// <param name="frsize">The frsize.</param>
 126        /// <param name="blocks">The blocks.</param>
 127        /// <param name="bfree">The bfree.</param>
 128        /// <param name="bavail">The bavail.</param>
 129        /// <param name="files">The files.</param>
 130        /// <param name="ffree">The ffree.</param>
 131        /// <param name="favail">The favail.</param>
 132        /// <param name="sid">The sid.</param>
 133        /// <param name="flag">The flag.</param>
 134        /// <param name="namemax">The namemax.</param>
 18135        internal SftpFileSytemInformation(ulong bsize, ulong frsize, ulong blocks, ulong bfree, ulong bavail, ulong file
 18136        {
 18137            FileSystemBlockSize = bsize;
 18138            BlockSize = frsize;
 18139            TotalBlocks = blocks;
 18140            FreeBlocks = bfree;
 18141            AvailableBlocks = bavail;
 18142            TotalNodes = files;
 18143            FreeNodes = ffree;
 18144            AvailableNodes = favail;
 18145            Sid = sid;
 18146            _flag = flag;
 18147            MaxNameLenght = namemax;
 18148        }
 149
 150        internal void SaveData(SshDataStream stream)
 6151        {
 6152            stream.Write(FileSystemBlockSize);
 6153            stream.Write(BlockSize);
 6154            stream.Write(TotalBlocks);
 6155            stream.Write(FreeBlocks);
 6156            stream.Write(AvailableBlocks);
 6157            stream.Write(TotalNodes);
 6158            stream.Write(FreeNodes);
 6159            stream.Write(AvailableNodes);
 6160            stream.Write(Sid);
 6161            stream.Write(_flag);
 6162            stream.Write(MaxNameLenght);
 6163        }
 164    }
 165}