Пример #1
0
        public static string ToString(PackFormatType type)
        {
            switch (type)
            {
            case PackFormatType.Boolean:
                return("?");

            case PackFormatType.Character:
                return("c");

            case PackFormatType.SByte:
                return("b");

            case PackFormatType.Byte:
                return("B");

            case PackFormatType.Short:
                return("h");

            case PackFormatType.UShort:
                return("H");

            case PackFormatType.Integer:
                return("i");

            case PackFormatType.UInteger:
                return("I");

            case PackFormatType.Long:
                return("q");

            case PackFormatType.ULong:
                return("Q");

            case PackFormatType.Float:
                return("f");

            case PackFormatType.Double:
                return("d");

            case PackFormatType.CString:
                return("s");

            case PackFormatType.PascalString:
                return("p");

            case PackFormatType.Pointer:
                return("P");

            case PackFormatType.PaddingByte:
                return("x");
            }
            return(string.Empty);
        }
Пример #2
0
 public PackFormatItem(PackFormatType type) : this(type, 1)
 {
 }
Пример #3
0
 public PackFormatItem(PackFormatType type, int count)
 {
     Debug.Assert(count > 0);
     this.Type  = type;
     this.Count = count;
 }