Пример #1
0
 public T EnumU32 <T>(string name, T value) where T : unmanaged, Enum
 {
     _bw.Write(SerdesUtil.EnumToUInt(value));
     _offset += 4L;
     DebugCheck();
     return(value);
 }
Пример #2
0
        public T EnumU32 <T>(string name, T value) where T : unmanaged, Enum
        {
            var offset = LocalOffset;

            value = _s.EnumU32(name, value);
            var label     = Enum.GetName(typeof(T), value);
            var uintValue = SerdesUtil.EnumToUInt(value);

            DoIndent();
            _tw.WriteLine("{0:X} {1} = {2} (0x{2:X} u) // {3}", offset, name, uintValue, label);
            return(value);
        }
Пример #3
0
        public byte[] Bytes(string name, byte[] value, int n)
        {
            var offset = LocalOffset;

            value = _s.Bytes(name, value, n);
            DoIndent();
            _tw.Write("{0:X} {1} = ", offset, name);

            if (n <= 16)
            {
                _tw.WriteLine(SerdesUtil.ConvertToHexString(value, n));
            }
            else
            {
                PrintByteArrayHex(value, n);
            }
            return(value);
        }
Пример #4
0
 public T EnumU32 <T>(string name, T value) where T : unmanaged, Enum
 {
     _offset += 4L; return(SerdesUtil.UIntToEnum <T>(_br.ReadUInt32()));
 }
Пример #5
0
 public T EnumU16 <T>(string name, T value) where T : unmanaged, Enum
 {
     _offset += 2L; return(SerdesUtil.UShortToEnum <T>((_br.ReadUInt16())));
 }
Пример #6
0
 public T EnumU8 <T>(string name, T value) where T : unmanaged, Enum
 {
     _offset += 1L; return(SerdesUtil.ByteToEnum <T>(_br.ReadByte()));
 }