private void EditDoxygen(DoxyType doxyType) { string arg = _doxySettings.activeDocumentationFolder; arg = arg.Replace('/', '\\'); arg = arg + "\\" + doxyType.ToString() + "Doxyfile"; string doxyWizard = _doxySettings.fullDoxygenPath.Replace("doxygen.exe", "doxywizard.exe"); doxyWizard = doxyWizard.Replace('/', '\\'); if (File.Exists(doxyWizard) && File.Exists(arg)) { _msgToUser = ""; System.Diagnostics.Process.Start("\"" + doxyWizard + "\"", "\"" + arg + "\""); } else { _msgToUser = ""; if (!File.Exists(doxyWizard)) { _msgToUser = "******" + doxyWizard; } if (!File.Exists(arg)) { _msgToUser += "Did not find the doxyfile at:" + arg; } } }
/*! * \breif Test if dxygen file exist */ public static bool DoxygenFileExist(DoxyType doxyType, DoxySettings doxySettings) { string activeDocumentationFolder = doxySettings.activeDocumentationFolder.Replace('/', '\\'); if (File.Exists(activeDocumentationFolder + @"\" + doxyType.ToString() + "Doxyfile")) { return(true); } else { return(false); } }
private void BrowsPDF(DoxyType doxyType) { string s = _doxySettings.activeDocumentationFolder; s = s.Replace('/', '\\'); s = s + "\\" + doxyType.ToString() + "Documentation.pdf"; if (File.Exists(@s)) { _msgToUser = ""; System.Diagnostics.Process.Start(@s); } else { _msgToUser = doxyType.ToString() + "Documentation.pdf where not found in " + @s; } }
/*! * \brief Build the new doxyfile form a sting containing the content */ private static void BuildFile(string doxyContent, DoxyType doxyType, DoxySettings doxySettings) { if (doxyContent != null) { StringBuilder sb = new StringBuilder(); sb.Append(doxyContent); StreamWriter NewDoxyfile = new StreamWriter(doxySettings.activeDocumentationFolder + @"\" + doxyType + "Doxyfile"); NewDoxyfile.Write(sb.ToString()); NewDoxyfile.Close(); } else { Debug.Log("Could not build file due to null input"); } }
/*! * \brief Make a doxyfile using a baseDoxy as string and a type string */ private static bool MakeDoxyOfType(DoxyType doxyType, DoxySettings doxySettings) { if (!DoxygenFileExist(doxyType, doxySettings)) { string baseDoxy = ReadBaseConfig(); string doxyContent = EditbaseDoxyString(baseDoxy, doxyType, doxySettings); BuildFile(doxyContent, doxyType, doxySettings); return(true); } else { string baseDoxy = ReadDoxyfile(doxyType, doxySettings); string doxyContent = EditDoxyString(baseDoxy, doxyType, doxySettings); BuildFile(doxyContent, doxyType, doxySettings); return(false); } }
/*! * \brief Edit the doxy file and return the compleat string. */ private static string EditDoxyString(string baseDoxy, DoxyType doxyType, DoxySettings doxySettings) { if (baseDoxy != null) { //Make the new doxyfile content baseDoxy = Regex.Replace(baseDoxy, @"PROJECT_NUMBER =[A-Za-z0-9_. ]*", "PROJECT_NUMBER = " + doxySettings.projectVersionNumber); baseDoxy = Regex.Replace(baseDoxy, @"PROJECT_BRIEF =[A-Za-z0-9_. " + "\"" + "]*", "PROJECT_BRIEF = " + "\"" + doxySettings.projectBrief + "\""); baseDoxy = Regex.Replace(baseDoxy, @"PROJECT_NAME =[A-Za-z0-9_. " + "\"" + "]*", "PROJECT_NAME = " + "\"" + doxySettings.projectName + " " + doxyType + " manual\""); baseDoxy = Regex.Replace(baseDoxy, @"OUTPUT_DIRECTORY =[A-Za-z0-9_. \\]*", "OUTPUT_DIRECTORY = " + ".\\" + doxyType + "PDF"); return(baseDoxy); } else { Debug.Log("Could not build file due to null input"); return(null); } }
/*! * \brief Read a doxy file acording to doxySettings acoding to doxytype */ private static string ReadDoxyfile(DoxyType doxyType, DoxySettings doxySettings) { string doxyFileName = doxySettings.activeDocumentationFolder + @"\" + doxyType + "Doxyfile"; try { if (File.Exists(doxyFileName)) { // Read in non-existent file. using (StreamReader sr = new StreamReader(doxyFileName)) { string line = sr.ReadToEnd(); return(line); } } else { return(""); } }catch (FileNotFoundException ex) { Debug.Log(ex); } return(""); }