Beispiel #1
0
        public DefNameSpace(XmlElement elem, string managedNamespace)
        {
            this._elem             = elem;
            this._managedNamespace = managedNamespace;

            string second = elem.GetAttribute("second");
            string third  = elem.GetAttribute("third");

            this.CLRName = managedNamespace;

            if (second != "")
            {
                this.CLRName += "::" + second;
            }

            if (third != "")
            {
                this.CLRName += "::" + third;
            }

            foreach (XmlElement child in elem.ChildNodes)
            {
                DefType type = DefType.CreateType(child);
                if (type != null)
                {
                    type.NameSpace = this;
                    this.Types.Add(type);
                }
            }
        }
Beispiel #2
0
        protected virtual DefType CreateExplicitContainerType(string container, string key, string val)
        {
            string      stdcont = "std::" + container;
            XmlDocument doc     = new XmlDocument();
            XmlElement  elem    = doc.CreateElement("typedef");

            elem.SetAttribute("basetype", stdcont);
            elem.SetAttribute("name", stdcont);
            XmlElement te = doc.CreateElement("type");

            te.InnerText = val;
            elem.AppendChild(te);
            if (key != "")
            {
                te           = doc.CreateElement("type");
                te.InnerText = key;
                elem.InsertAfter(te, null);
            }

            return(DefTypeDef.CreateExplicitType((DefTypeDef)DefType.CreateType(elem)));
        }