Exemplo n.º 1
0
 void Write(RetType retType)
 {
     Write(retType.CustomMods);
     if (retType.Void)
     {
         Write(ElementType.Void);
     }
     else if (retType.TypedByRef)
     {
         Write(ElementType.TypedByRef);
     }
     else if (retType.ByRef)
     {
         Write(ElementType.ByRef);
         Write(retType.Type);
     }
     else
     {
         Write(retType.Type);
     }
 }
Exemplo n.º 2
0
        RetType ReadRetType(byte [] data, int pos, out int start)
        {
            RetType rt = new RetType();

            start         = pos;
            rt.CustomMods = ReadCustomMods(data, start, out start);
            int         curs = start;
            ElementType flag = (ElementType)Utilities.ReadCompressedInteger(data, start, out start);

            switch (flag)
            {
            case ElementType.Void:
                rt.ByRef = rt.TypedByRef = false;
                rt.Void  = true;
                break;

            case ElementType.TypedByRef:
                rt.ByRef      = rt.Void = false;
                rt.TypedByRef = true;
                break;

            case ElementType.ByRef:
                rt.TypedByRef = rt.Void = false;
                rt.ByRef      = true;
                rt.CustomMods = CombineCustomMods(rt.CustomMods, ReadCustomMods(data, start, out start));
                rt.Type       = ReadType(data, start, out start);
                break;

            default:
                rt.TypedByRef = rt.Void = rt.ByRef = false;
                rt.Type       = ReadType(data, curs, out start);
                break;
            }

            return(rt);
        }