public Stat( ushort type, uint dev, Qid qid, uint mode, uint atime, uint mtime, ulong length, string name, string uid, string gid, string muid) { Type = type; Dev = dev; Qid = qid; Mode = mode; Atime = atime; Mtime = mtime; Length = length; Name = name; Uid = uid; Gid = gid; Muid = muid; Size = (ushort)(Constants.Bit16Sz + Constants.Bit16Sz + Constants.Bit32Sz + Constants.Qidsz + Constants.Bit32Sz + Constants.Bit32Sz + Constants.Bit32Sz + Constants.Bit64Sz + Protocol.GetStringLength(Name) + Protocol.GetStringLength(Uid) + Protocol.GetStringLength(Gid) + Protocol.GetStringLength(Muid)); }
internal static int WriteQid(byte[] data, Qid qid, int offset) { var bytes = qid.ToBytes(); Array.Copy(bytes, 0, data, offset, Constants.Qidsz); return(Constants.Qidsz); }
public override int GetHashCode() { unchecked { var hashCode = Size.GetHashCode(); hashCode = (hashCode * 397) ^ Type.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Dev; hashCode = (hashCode * 397) ^ (Qid?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (int)Mode; hashCode = (hashCode * 397) ^ (int)Atime; hashCode = (hashCode * 397) ^ (int)Mtime; hashCode = (hashCode * 397) ^ Length.GetHashCode(); hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Uid?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Gid?.GetHashCode() ?? 0); hashCode = (hashCode * 397) ^ (Muid?.GetHashCode() ?? 0); return(hashCode); } }
protected bool Equals(Qid other) { return(Type == other.Type && Vers == other.Vers && Path == other.Path); }