private static CppHeaderContext ProcessHeaderFile(string fileName, string dialogClassName)
        {
            if (HeaderFileMap.ContainsKey(fileName.ToLower()))
            {
                IProjectFile projectFile = HeaderFileMap[fileName.ToLower()];

                CppHeaderContext cppHeaderContext = new CppHeaderContext(projectFile.Name, dialogClassName);

                CurrentFileContext = cppHeaderContext;

                cppHeaderContext.ProjectFile = projectFile;

                cppHeaderContext.Init();

                CurrentFileContext = cppHeaderContext;

                AnalyzeHeaderContext(cppHeaderContext);

                cppHeaderContext.WriteSavedNodes();

                cppHeaderContext.ProcessResults();

                cppHeaderContext.Finalize();

                return(cppHeaderContext);
            }
            else
            {
                LogManager.Self.Log($"Missing Header File in map: {fileName}");
                return(null);
            }
        }
        public static void AnalyzeHeaderContext(CppHeaderContext cppHeaderContext)
        {
            IProjectFile projectFile = cppHeaderContext.ProjectFile;

            using (TextWriter writer = File.CreateText(CreateAnalyticsFilePath(cppHeaderContext.DialogClassName, $"{cppHeaderContext.FileName}-h.txt")))
            {
                cppHeaderContext.DumpFile(writer);
            }
        }
        private static void ParsePenradDialogs()
        {
            foreach (CppDialogEntry cppDialogEntry in PenradCppManager.Self.DialogMap.Values)
            {
                CppHeaderContext cppHeaderContext = ProcessHeaderFile(cppDialogEntry.HeaderFile, cppDialogEntry.DialogClassName);

                if (cppHeaderContext != null)
                {
                    ProcessCppFile(cppHeaderContext, cppDialogEntry.CodeFile, cppDialogEntry.DialogClassName);
                }
            }
        }
        private static void ProcessCppFile(CppHeaderContext cppHeaderContext, string fileName, string dialogClassName)
        {
            if (CppFileMap.ContainsKey(fileName.ToLower()))
            {
                IProjectFile projectFile = CppFileMap[fileName.ToLower()];

                CppCodeContext cppCodeContext = new CppCodeContext(fileName, dialogClassName);

                cppCodeContext.CppHeaderContext = cppHeaderContext;
                cppHeaderContext.CppCodeContext = cppCodeContext;
                cppCodeContext.WidgetTypeFinder = new WidgetTypeFinder(cppCodeContext, cppHeaderContext);

                CurrentFileContext = cppCodeContext;

                cppCodeContext.ProjectFile = projectFile;

                cppCodeContext.Init();

                CurrentFileContext = cppCodeContext;

                AnalyzeCodeContext(cppCodeContext);

                cppCodeContext.WriteSavedNodes();

                cppCodeContext.ProcessResults();

                cppCodeContext.Finalize();

                cppCodeContext.SaveClassInfo();

                cppCodeContext.WidgetTypeFinder.DoAnalytics();
            }
            else
            {
                LogManager.Self.Log($"Missing Cpp File in map: {fileName}");
            }
        }
 public WidgetTypeFinder(CppCodeContext cppCodeContext, CppHeaderContext cppHeaderContext)
 {
     this.CppCodeContext   = cppCodeContext;
     this.CppHeaderContext = cppHeaderContext;
 }