コード例 #1
0
            /// <summary>
            /// Creates all the Global data members
            /// </summary>
            /// <param name="s"></param>
            public Global(IO.XmlStream s)
            {
                s.ReadAttribute("opcode", 16, ref Opcode);

                {
                    string temp = null;
                    s.ReadAttribute("type", ref temp);
                    Type = ((XmlInterface)s.Owner).GetValueType(temp).Opcode;
                }

                if (!s.ReadAttributeOpt("name", ref Name))
                {
                    Name = string.Format("global_{0:X}", Opcode);
                }
                if (!s.ReadAttributeOpt("help", ref Help))
                {
                    Help = string.Empty;
                }

                if (!s.ReadAttributeOpt("null", ref IsNull))
                {
                    IsNull = false;
                }

                {
                    uint temp = 0;
                    s.ReadAttributeOpt("flags", 16, ref temp);
                    Flags = new Util.Flags(temp);
                }
            }
コード例 #2
0
        /// <summary>
        /// Is the field-set size (ignores version indices) equal to the latest definition's, taking
        /// into account things like
        /// </summary>
        /// <param name="header"></param>
        /// <param name="io_flags"></param>
        /// <param name="expected_size"></param>
        /// <returns></returns>
        bool VersioningSizeIsValid(tag_fieldset_header header, Util.Flags io_flags, out int expected_size)
        {
            bool useless        = io_flags.Test(IO.ITagStreamFlags.Halo2OldFormat_UselessPadding);
            bool old_string_ids = io_flags.Test(IO.ITagStreamFlags.Halo2OldFormat_StringId);

            int size_of = VersioningGetRealSizeOf(io_flags);

            expected_size = size_of;

            return(header.Size == size_of);
        }
コード例 #3
0
            /// <summary>
            /// Creates all the Function data members
            /// </summary>
            /// <param name="s"></param>
            public Function(IO.XmlStream s)
            {
                s.ReadAttribute("opcode", 16, ref Opcode);

                {
                    string temp = null;
                    s.ReadAttribute("returnType", ref temp);
                    ReturnType = ((XmlInterface)s.Owner).GetValueType(temp).Opcode;
                }

                if (!s.ReadAttributeOpt("name", ref Name))
                {
                    Name = string.Format("function_{0:X}", Opcode);
                }
                if (!s.ReadAttributeOpt("argc", 10, ref Argc))
                {
                    Argc = 0;
                }
                if (!s.ReadAttributeOpt("opArgc", 10, ref OpArgc))
                {
                    OpArgc = 0;
                }

                {
                    uint temp = 0;
                    s.ReadAttributeOpt("flags", 16, ref temp);
                    Flags = new Util.Flags(temp);
                }

                if (!s.ReadAttributeOpt <FunctionGroup>("group", ref Group))
                {
                    Group = FunctionGroup.Macro;
                }

                #region Args
                if (Argc > 0)
                {
                    int x = 0;
                    Args = new FunctionArg[Argc];
                    foreach (XmlNode n in s.Cursor.ChildNodes)
                    {
                        if (n.Name != "arg")
                        {
                            continue;
                        }

                        s.SaveCursor(n);
                        Args[x] = new FunctionArg(this, x++, s);
                        s.RestoreCursor();
                    }
                }
                else
                {
                    Args = null;
                }
                #endregion

                if (!s.ReadAttributeOpt("help", ref Help))
                {
                    Help = string.Empty;
                }
                if (!s.ReadAttributeOpt("helpArg", ref HelpArg))
                {
                    HelpArg = string.Empty;
                }

                if (!s.ReadAttributeOpt("null", ref IsNull))
                {
                    IsNull = false;
                }
            }
コード例 #4
0
        /// <summary>
        /// Can the field-set be implicitly upgraded by just not reading some (supposedly) newer fields?
        /// </summary>
        /// <param name="header"></param>
        /// <param name="io_flags"></param>
        /// <returns></returns>
        bool VersioningCanBeImplicitlyPerformed(tag_fieldset_header header, Util.Flags io_flags)
        {
            int size_of = VersioningGetRealSizeOf(io_flags);

            return(header.Index == attribute.Version && size_of > header.Size);
        }