Example #1
0
            public void EnableFileTracking(string location)
            {
                if (_trackedLocations.ContainsKey(location))
                {
                    return;
                }

                var watcher = new FileWatcher(location);

                watcher.Changed += (sender, args) =>
                {
                    DoxygenHelper.RunDoxygen(new string[] { location },
                                             Path.Combine(DoxygenHelper.DoxygenXmlPath, "tmp"));
                    DoxygenHelper.TriggerTrackedFilesChangedEvent();
                };

                _trackedLocations[location] = watcher;
            }
Example #2
0
        public string GetSymbolDescription(DoxygenHelper.DescriptionType descriptionType, string overloadSpecification = null)
        {
            using (var reader = XmlReader.Create(new StreamReader(GetCompoundFilePath())))
            {
                var doc = new XmlDocument();
                doc.Load(reader);
                var nav = doc.CreateNavigator();


                if (descriptionType == DoxygenHelper.DescriptionType.Full)
                {
                    return
                        (GetTranslatedNode(nav, DoxygenHelper.GetDescriptionTypeString(DoxygenHelper.DescriptionType.Brief), overloadSpecification)
                         + " " +
                         GetTranslatedNode(nav, DoxygenHelper.GetDescriptionTypeString(DoxygenHelper.DescriptionType.Detailed), overloadSpecification));
                }

                return(GetTranslatedNode(nav, DoxygenHelper.GetDescriptionTypeString(descriptionType), overloadSpecification));
            }
        }
        public string GetSymbolDescription(string path, DoxygenHelper.DescriptionType descriptionType)
        {
            var symbol = GetSymbolFromPath(path);

            return symbol.GetSymbolDescription(descriptionType);
        }
        public string GetSymbolDescription(DoxygenHelper.DescriptionType descriptionType, string overloadSpecification = null)
        {
            using (var reader = XmlReader.Create(new StreamReader(GetCompoundFilePath())))
            {
                var doc = new XmlDocument();
                doc.Load(reader);
                var nav = doc.CreateNavigator();


                if (descriptionType == DoxygenHelper.DescriptionType.Full)
                {
                    return
                        GetTranslatedNode(nav, DoxygenHelper.GetDescriptionTypeString(DoxygenHelper.DescriptionType.Brief), overloadSpecification)
                        + " " +
                        GetTranslatedNode(nav, DoxygenHelper.GetDescriptionTypeString(DoxygenHelper.DescriptionType.Detailed), overloadSpecification);
                }

                return GetTranslatedNode(nav, DoxygenHelper.GetDescriptionTypeString(descriptionType), overloadSpecification);
            }
        }
Example #5
0
        public void ReloadFromDoxygenXmlDirectory()
        {
            var indexPath     = Path.Combine(DoxygenHelper.DoxygenXmlPath, "xml", "index.xml");
            var triggerChange = _symbolMap.Count > 0;

            if (!File.Exists(indexPath))
            {
                throw new DoxygenHelper.InvalidDoxygenPath(Path.Combine(DoxygenHelper.DoxygenXmlPath, "xml"));
            }

            Clear();

            try
            {
                _directoryPath = Path.Combine(DoxygenHelper.DoxygenXmlPath, "xml");

                using (var reader = XmlReader.Create(new StreamReader(indexPath)))
                {
                    var doc = new XmlDocument();
                    doc.Load(reader);
                    var nav = doc.CreateNavigator();

                    var compoundsIterator = nav.Select("/doxygenindex/compound");

                    while (compoundsIterator.MoveNext())
                    {
                        var compound = compoundsIterator.Current;

                        switch (compound.GetAttribute("kind", ""))
                        {
                        case "struct":
                        case "class":
                        case "union":
                        case "namespace":
                        case "file":
                            LoadFromXmlCompound(compound);
                            break;

                        case "category":
                        case "page":
                        case "dir":
                            // ignore compound
                            break;

                        default:
                            //throw new InvalidOperationException(Language.Message("DoxygenCompoundKindNotSupported", compound.GetAttribute("kind", "")));
                            break;
                        }
                    }
                }
            }
            catch (Exception)
            {
                // If something went wrong clear symbol info.
                Clear();
                throw;
            }
            finally
            {
                if (triggerChange)
                {
                    DoxygenHelper.TriggerTrackedFilesChangedEvent();
                }
            }
        }