Пример #1
0
        // Load common links, such as those for UnlockComponent, from appData\apiManager\commonLinks.xml
        private bool integrateCommonLinks(Chilkat.Log log)
        {
            // No need for refdoc links if we're not using this code for refdoc generation.
            if (AppData.GitHubCodeBase)
            {
                return(true);
            }

            Chilkat.Xml xmlCommon = new Chilkat.Xml();
            if (!xmlCommon.LoadXmlFile(AppData.BaseDir + "/appData/apiManager/commonLinks.xml"))
            {
                log.LogError("Failed to load commonLinks.xml");
                return(false);
            }

            int    i;
            int    n       = xmlCommon.NumChildren;
            string strName = null;

            for (i = 0; i < n; i++)
            {
                xmlCommon.GetChild2(i);

                strName = xmlCommon.GetAttrValue("name");
                if ((strName != null) && xmlCommon.HasChildWithTag("links2"))
                {
                    if (xmlCommon.TagEquals("method"))
                    {
                        XMethod method = GetMethodByName(strName);
                        if (method != null)
                        {
                            xmlCommon.FindChild2("links2");
                            method.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                    else if (xmlCommon.TagEquals("property"))
                    {
                        XProperty prop = GetPropertyByName(strName);
                        if (prop != null)
                        {
                            xmlCommon.FindChild2("links2");
                            prop.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                }
                xmlCommon.GetParent2();
            }

            return(true);
        }
Пример #2
0
        // Load common links, such as those for UnlockComponent, from C:\ck2000\appData\apiManager\commonLinks.xml
        private bool integrateCommonLinks(Chilkat.Log log)
        {
            Chilkat.Xml xmlCommon = new Chilkat.Xml();
            if (!xmlCommon.LoadXmlFile(PATH_COMMON_LINKS_XML))
            {
                log.LogError("Failed to load commonLinks.xml");
                return(false);
            }

            int    i;
            int    n       = xmlCommon.NumChildren;
            string strName = null;

            for (i = 0; i < n; i++)
            {
                xmlCommon.GetChild2(i);

                strName = xmlCommon.GetAttrValue("name");
                if ((strName != null) && xmlCommon.HasChildWithTag("links2"))
                {
                    if (xmlCommon.TagEquals("method"))
                    {
                        XMethod method = GetMethodByName(strName);
                        if (method != null)
                        {
                            xmlCommon.FindChild2("links2");
                            method.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                    else if (xmlCommon.TagEquals("property"))
                    {
                        XProperty prop = GetPropertyByName(strName);
                        if (prop != null)
                        {
                            xmlCommon.FindChild2("links2");
                            prop.CopyLinks(xmlCommon);
                            xmlCommon.GetParent2();
                        }
                    }
                }
                xmlCommon.GetParent2();
            }

            return(true);
        }
Пример #3
0
        private void addClassEntries(Chilkat.Xml xml)
        {
            int i, n;

            // the methods.
            Chilkat.Xml x = xml.FindChild("methods");
            if (x != null)
            {
                n = x.NumChildren;
                for (i = 0; i < n; i++)
                {
                    Chilkat.Xml xEntry  = x.GetChild(i);
                    XMethod     xMethod = new XMethod();
                    xMethod.LoadMethodXml(xEntry);
                    m_methods.Add(xMethod.EntryName, xMethod);
                    m_methodList.Add(xMethod);
                }
            }

            // the properties.
            x = xml.FindChild("properties");
            if (x != null)
            {
                n = x.NumChildren;
                for (i = 0; i < n; i++)
                {
                    Chilkat.Xml xEntry = x.GetChild(i);
                    XProperty   xprop  = new XProperty();
                    xprop.loadPropXml(xEntry);
                    m_props.Add(xprop.EntryName, xprop);
                    m_propList.Add(xprop);
                }
            }

            // the events.
            x = xml.FindChild("events");
            if (x != null)
            {
                n = x.NumChildren;
                for (i = 0; i < n; i++)
                {
                    Chilkat.Xml xEntry = x.GetChild(i);
                    // If the tag is "standard", ignore it because we'll be loading the standard events elsewhere..
                    if (xEntry.TagEquals("standard"))
                    {
                        continue;
                    }

                    XMethod xEvent = new XMethod();
                    xEvent.LoadMethodXml(xEntry);
                    m_events.Add(xEvent.EntryName, xEvent);
                    m_eventList.Add(xEvent);
                }
            }
        }
Пример #4
0
        // For a method to be fully loaded from XML, the args must also be cached.
        protected void loadEntryXml(Chilkat.Xml p)
        {
            if (p == null)
            {
                return;
            }

            if (m_xml == p)
            {
                return;
            }
            m_xml = p;

            m_entryType = EntryTypeMethod;
            if (m_xml.TagEquals("property"))
            {
                m_entryType = EntryTypeProperty;
            }
            else if (m_xml.TagEquals("event"))
            {
                m_entryType = EntryTypeEvent;
            }

            // Cache info...
            m_name = m_xml.GetAttrValue("name");
            // We no longer user "cppType" in the XML.  It is derived from the generic type
            m_xml.RemoveChild("cppType");
            //m_cppType = m_xml.GetChildContent("cppType");
            //

            m_genericType = m_xml.GetChildContent("gType");
            if (m_genericType.Equals("long"))
            {
                GenericType = "int";
            }
            if (m_genericType.Equals("unsigned int") || m_genericType.Equals("uint32"))
            {
                GenericType = "unsigned long";
            }

            m_gt = ChilkatTypes.genericToGt(m_genericType);
            if (m_gt == ChilkatTypes.GT_DATE)
            {
                Chilkat.Xml gtXml = m_xml.FindChild("gType");
                m_outputArgFileTime   = gtXml.HasAttrWithValue("filetime", "1");
                m_outputArgSystemTime = gtXml.HasAttrWithValue("systemtime", "1");

                // If both are false, then assume systemtime.
                if (!m_outputArgFileTime && !m_outputArgSystemTime)
                {
                    m_outputArgSystemTime = true;
                }
            }


            m_hasCppOutputArg = (m_gt == ChilkatTypes.GT_STRING || m_gt == ChilkatTypes.GT_BYTES || m_gt == ChilkatTypes.GT_DATE);
            if (m_hasCppOutputArg)
            {
                m_cppOutputArgName = m_xml.GetAttrValue("outArgName");
                if (m_cppOutputArgName == null)
                {
                    if (m_gt == ChilkatTypes.GT_DATE)
                    {
                        m_cppOutputArgName = "outDate";
                    }
                    else if (m_gt == ChilkatTypes.GT_BYTES)
                    {
                        m_cppOutputArgName = "outBytes";
                    }
                    else
                    {
                        m_cppOutputArgName = "outStr";
                    }
                }
            }

            m_descrip      = m_xml.GetChildContent("descrip");
            m_ifdef        = m_xml.GetChildContent("ifdef");
            m_introVersion = m_xml.GetChildContent("iversion");

            m_cppEnabled = m_xml.HasAttrWithValue("cpp", "1");
            m_dnEnabled  = m_xml.HasAttrWithValue("dn", "1");
            m_axEnabled  = m_xml.HasAttrWithValue("ax", "1");

            m_hasEvents       = m_xml.HasAttrWithValue("events", "1");
            m_hasStatusReturn = m_xml.HasAttrWithValue("status", "1");
            m_isBaseEntry     = m_xml.HasAttrWithValue("baseEntry", "1");
            m_noPublish       = m_xml.HasAttrWithValue("noPublish", "1");
            m_deprecated      = m_xml.HasAttrWithValue("deprecated", "1");
            m_noxojo          = m_xml.HasAttrWithValue("noxojo", "1");
            m_windowsOnly     = m_xml.HasAttrWithValue("windowsOnly", "1");
            m_noSwig          = m_xml.HasAttrWithValue("noSwig", "1");
            m_noObjectiveC    = m_xml.HasAttrWithValue("noObjC", "1");
            m_noNodeJs        = m_xml.HasAttrWithValue("noNodeJs", "1");
            m_noSwig          = m_xml.HasAttrWithValue("noSwig", "1");
            m_noC             = m_xml.HasAttrWithValue("noC", "1");
            m_noWinRT         = m_xml.HasAttrWithValue("noWinRT", "1");


            m_lnameCk = m_lnameNoCk = StringUtil.ToLowerFirstChar(m_name);
            if (m_lnameCk.Equals("stat") || m_lnameCk.Equals("accept") || m_lnameCk.Equals("from"))
            {
                m_lnameCk = "ck_" + m_lnameCk;
            }

            m_refdocLinks = initRefdocLinks();

            return;
        }