コード例 #1
0
 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));
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
     }
 }
コード例 #4
0
ファイル: Qid.cs プロジェクト: forki/Sharp9P
 protected bool Equals(Qid other)
 {
     return(Type == other.Type && Vers == other.Vers && Path == other.Path);
 }