コード例 #1
0
        public static SizeBufferTable loadEntry(FStruct _struc, String name, List <string> parms)
        {
            String          delim = parms[1].Trim();
            SizeBufferTable f     = new SizeBufferTable(_struc, name, delim);

            return(f);
        }
コード例 #2
0
ファイル: Format.cs プロジェクト: kohoutech/Gander
        public static FField loadField(FStruct fs, String fname, List <String> parms)
        {
            FField f = null;

            //check for loaded struct
            FEntry ftype = fs.format.structs.getEntry(parms[0].ToLower());

            if (ftype != null)
            {
                f = new StructField(fs, fname, (FStruct)ftype);
            }

            //else is a predefined struct
            else
            {
                switch (parms[0])
                {
                case "int":
                    f = IntField.loadEntry(fs, fname, parms);
                    break;

                case "fixedstr":
                    f = FixedString.loadEntry(fs, fname, parms);
                    break;

                case "fixedbuf":
                    f = FixedBuffer.loadEntry(fs, fname, parms);
                    break;

                case "varbuf":
                    f = VariableBuffer.loadEntry(fs, fname, parms);
                    break;

                case "vartable":
                    f = VariableTable.loadEntry(fs, fname, parms);
                    break;

                case "sizebuftable":
                    f = SizeBufferTable.loadEntry(fs, fname, parms);
                    break;

                default:
                    break;
                }
            }

            return(f);
        }