Beispiel #1
0
            public BaseValuesTable_val GetBaseValuesTable_val()
            {
                BaseValuesTable_val bvt = null;

                if (BaseValuesOffset != 0)
                {
                    bvt = new BaseValuesTable_val((ushort)(m_offsetBaseScriptTable + BaseValuesOffset), m_bufTable);
                }

                return(bvt);
            }
Beispiel #2
0
            public bool Validate(Validator v, string sIdentity, OTTable table)
            {
                bool bRet = true;

                bRet &= ((val_BASE)table).ValidateNoOverlap(m_offsetBaseScriptTable, CalcLength(), v, sIdentity, table.GetTag());

                // check the BaseValuesOffset
                if (BaseValuesOffset == 0)
                {
                    v.Pass(T.T_NULL, P.BASE_P_BaseValuesOffset_null, table.m_tag, sIdentity);
                }
                else if (BaseValuesOffset + m_offsetBaseScriptTable > m_bufTable.GetLength())
                {
                    v.Error(T.T_NULL, E.BASE_E_BaseValuesOffset, table.m_tag, sIdentity);
                }
                else
                {
                    v.Pass(T.T_NULL, P.BASE_P_BaseValuesOffset, table.m_tag, sIdentity);
                }

                // check the DefaultMinMaxOffset
                if (DefaultMinMaxOffset == 0)
                {
                    v.Pass(T.T_NULL, P.BASE_P_DefaultMinMaxOffset_null, table.m_tag, sIdentity);
                }
                else if (DefaultMinMaxOffset + m_offsetBaseScriptTable > m_bufTable.GetLength())
                {
                    v.Error(T.T_NULL, E.BASE_E_DefaultMinMaxOffset, table.m_tag, sIdentity);
                }
                else
                {
                    v.Pass(T.T_NULL, P.BASE_P_DefaultMinMaxOffset, table.m_tag, sIdentity);
                }

                // check the BaseLangSysRecord order
                bool bOrderOk = true;

                if (BaseLangSysCount > 1)
                {
                    for (uint i = 0; i < BaseLangSysCount - 1; i++)
                    {
                        BaseLangSysRecord ThisBlsr = GetBaseLangSysRecord(i);
                        BaseLangSysRecord NextBlsr = GetBaseLangSysRecord(i + 1);
                        if (ThisBlsr.BaseLangSysTag >= NextBlsr.BaseLangSysTag)
                        {
                            v.Error(T.T_NULL, E.BASE_E_BaseLangSysRecord_order, table.m_tag, sIdentity);
                            bOrderOk = false;
                            bRet     = false;
                        }
                    }
                }
                if (bOrderOk)
                {
                    v.Pass(T.T_NULL, P.BASE_P_BaseLangSysRecord_order, table.m_tag, sIdentity);
                }

                // check the BaseLangSysRecord MinMaxOffsets
                bool bOffsetsOk = true;

                for (uint i = 0; i < BaseLangSysCount; i++)
                {
                    BaseLangSysRecord bslr = GetBaseLangSysRecord(i);
                    if (bslr.MinMaxOffset == 0)
                    {
                        v.Error(T.T_NULL, E.BASE_E_BaseLangSysRecord_offset0, table.m_tag, sIdentity + ", BaseLangSysRecord index = " + i);
                        bOffsetsOk = false;
                        bRet       = false;
                    }
                    else if (bslr.MinMaxOffset + m_offsetBaseScriptTable > m_bufTable.GetLength())
                    {
                        v.Error(T.T_NULL, E.BASE_E_BaseLangSysRecord_offset, table.m_tag, sIdentity + ", BaseLangSysRecord index = " + i);
                        bOffsetsOk = false;
                        bRet       = false;
                    }
                }
                if (bOffsetsOk)
                {
                    v.Pass(T.T_NULL, P.BASE_P_BaseLangSysRecord_offsets, table.m_tag, sIdentity);
                }

                // check the BaseValuesTable
                if (BaseValuesOffset != 0)
                {
                    BaseValuesTable_val bvt = GetBaseValuesTable_val();
                    bvt.Validate(v, sIdentity, table);
                }

                // check the Default MinMaxTable
                if (DefaultMinMaxOffset != 0)
                {
                    MinMaxTable_val mmt = GetDefaultMinMaxTable_val();
                    mmt.Validate(v, sIdentity + ", default MinMax", table);
                }

                // check the BaseLangSysRecord MinMaxTables
                for (uint i = 0; i < BaseLangSysCount; i++)
                {
                    BaseLangSysRecord blsr = GetBaseLangSysRecord(i);
                    MinMaxTable_val   mmt  = GetMinMaxTable_val(blsr);
                    mmt.Validate(v, sIdentity + ", BaseLangSysRecord[" + i + "]", table);
                }

                return(bRet);
            }
Beispiel #3
0
            public BaseValuesTable_val GetBaseValuesTable_val()
            {
                BaseValuesTable_val bvt = null;

                if (BaseValuesOffset != 0)
                {
                    bvt = new BaseValuesTable_val((ushort)(m_offsetBaseScriptTable + BaseValuesOffset), m_bufTable);
                }

                return bvt;
            }