Exemplo n.º 1
0
 // возвращает тип без typedef ов
 public static CompoundType GetUnwrappedType(CompoundType _type)
 {
     CompoundType type = _type;
     while (type.BaseType is CompoundTypedef)
         type = ((CompoundTypedef)type.BaseType).CompoundType;
     return type;
 }
Exemplo n.º 2
0
        private void ParseType(List<AlphabetType> _commands, ref int _indexParse, XmlNode _typeDefinition)
        {
            while (true)
            {
                if (_indexParse >= _commands.Count)
                    break;

                AlphabetType command = _commands[_indexParse];
                _indexParse ++;
                if (command.Direction == StateDirection.Up)
                {
                    break;
                }
                else if (command.Direction == StateDirection.Down)
                {
                    CompoundType type = new CompoundType();
                    mTemplateTypes.Add(type);

                    type.ParseType(_commands, ref _indexParse, _typeDefinition);
                }
                else
                {
                    if (command.Element != null)
                    {
                        if (mBaseType == null)
                        {
                            string refid = command.Element.Attributes["refid"].Value;
                            if (CompoundManager.Instance.IsIgnoredCompound(refid))
                            {
                                ConsoleUtility.WriteErrorLine("{0} id and name {1} not found in type {2}", refid, command.Element.InnerText, _typeDefinition.InnerXml);
                            }
                            else
                            {
                                var compound = CompoundManager.Instance.GetCompound(refid);
                                if (compound == null)
                                {
                                    ConsoleUtility.WriteErrorLine("{0} id and name {1} not found in type {2}", refid, command.Element.InnerText, _typeDefinition.InnerXml);
                                }
                                else
                                {
                                    mBaseType = compound;
                                }
                            }
                        }
                        else
                        {
                            ConsoleUtility.WriteErrorLine("Error parse type {0}", _typeDefinition.InnerXml);
                        }
                    }
                    else if (command.Text != null)
                    {
                        mParseType += command.Text;
                    }
                    else
                    {
                        ConsoleUtility.WriteErrorLine("Error parse type {0}", _typeDefinition.InnerXml);
                    }
                }
            }
        }
Exemplo n.º 3
0
        protected override void OnParse(XmlNode _node)
        {
            base.OnParse(_node);

            mCompoundType = new CompoundType(_node["type"], "");
            foreach (XmlNode node in _node.SelectNodes("param"))
                mCompoundParamTypes.Add(new CompoundType(node["type"], node["declname"] != null ? node["declname"].InnerText : ""));

            mPublic = _node.Attributes["prot"].Value == "public";
            mStatic = _node.Attributes["static"].Value == "yes";
            mInternal = _node["type"].InnerText == "";
            mGeneric = _node["templateparamlist"] != null;
            mConst = _node.Attributes["const"].Value == "yes";
            mVirtual = _node.Attributes["virt"].Value == "virtual";
            mReimplement = _node.SelectNodes("reimplements").Count != 0;

            string tmpGetName = "get";
            string tmpSetName = "set";
            string tmpIsName = "is";
            if (Name.ToLowerInvariant().StartsWith(tmpGetName))
            {
                mPropertyName = Name.Substring(tmpGetName.Length);
                mGetProperty = true;
            }
            else if (Name.ToLowerInvariant().StartsWith(tmpSetName))
            {
                mPropertyName = Name.Substring(tmpSetName.Length);
            }
            else if (Name.ToLowerInvariant().StartsWith(tmpIsName))
            {
                mPropertyName = Name.Substring(tmpIsName.Length);
                mIsProperty = true;
            }
        }
Exemplo n.º 4
0
 public static bool IsEventMultiDelegate(CompoundType _type)
 {
     return _type.TypeName.StartsWith("MyGUI::delegates::CMultiDelegate");
 }
Exemplo n.º 5
0
        protected override void OnParse(XmlNode _node)
        {
            base.OnParse(_node);

            mCompoundType = new CompoundType(_node["type"], _node["name"].Value);
        }