📄 config.l
字号:
} else if (c=='\\') // skip escaped stuff { i++; } } } else if (c==' ' || c=='\t') // separator { // replace the string in the list and go to the next item. sl.insert(sl.at(),result.mid(p,i-p)); // insert new item before current item. sl.next(); // current item is now the old item p=i+1; } } } if (p!=l) // add the leftover as a string { // replace the string in the list and go to the next item. sl.insert(sl.at(),result.right(l-p)); // insert new item before current item. sl.next(); // current item is now the old item } // remove the old unexpanded string from the list i=sl.at(); sl.remove(); // current item index changes if the last element is removed. if (sl.at()==i) // not last item s = sl.current(); else // just removed last item s = 0; } else // just goto the next element in the list { s=sl.next(); } }}void ConfigString::substEnvVars(){ substEnvVarsInString(m_value);}void ConfigList::substEnvVars(){ substEnvVarsInStrList(m_value);}void ConfigBool::substEnvVars(){ substEnvVarsInString(m_valueString);}void ConfigInt::substEnvVars(){ substEnvVarsInString(m_valueString);}void ConfigEnum::substEnvVars(){ substEnvVarsInString(m_value);}void Config::substituteEnvironmentVars(){ ConfigOption *option = m_options->first(); while (option) { option->substEnvVars(); option = m_options->next(); }}void Config::check(){ //if (!projectName.isEmpty()) //{ // projectName[0]=toupper(projectName[0]); //} QCString &warnFormat = Config_getString("WARN_FORMAT"); if (warnFormat.isEmpty()) { warnFormat="$file:$line $text"; } else { if (warnFormat.find("$file")==-1) { config_err("Error: warning format does not contain a $file tag!\n"); exit(1); } if (warnFormat.find("$line")==-1) { config_err("Error: warning format does not contain a $line tag!\n"); exit(1); } if (warnFormat.find("$text")==-1) { config_err("Error: wanring format foes not contain a $text tag!\n"); exit(1); } } QCString &manExtension = Config_getString("MAN_EXTENSION"); // set default man page extension if non is given by the user if (manExtension.isEmpty()) { manExtension=".3"; } QCString &paperType = Config_getEnum("PAPER_TYPE"); paperType=paperType.lower().stripWhiteSpace(); if (paperType.isEmpty()) { paperType = "a4wide"; } if (paperType!="a4" && paperType!="a4wide" && paperType!="letter" && paperType!="legal" && paperType!="executive") { config_err("Error: Unknown page type specified"); } QCString &outputLanguage=Config_getEnum("OUTPUT_LANGUAGE"); outputLanguage=outputLanguage.stripWhiteSpace(); if (outputLanguage.isEmpty()) { outputLanguage = "English"; } // expand the relative stripFromPath values QStrList &stripFromPath = Config_getList("STRIP_FROM_PATH"); char *sfp = stripFromPath.first(); while (sfp) { QCString path = sfp; if (path.at(0)!='/' && (path.length()<=2 || path.at(1)!=':')) { QFileInfo fi(path); if (fi.exists() && fi.isDir()) { int i = stripFromPath.at(); stripFromPath.remove(); if (stripFromPath.at()==i) // did not remove last item stripFromPath.insert(i,fi.absFilePath()+"/"); else stripFromPath.append(fi.absFilePath()+"/"); } } sfp = stripFromPath.next(); } // Test to see if HTML header is valid QCString &headerFile = Config_getString("HTML_HEADER"); if (!headerFile.isEmpty()) { QFileInfo fi(headerFile); if (!fi.exists()) { config_err("Error: tag HTML_HEADER: header file `%s' " "does not exist\n",headerFile.data()); exit(1); } } // Test to see if HTML footer is valid QCString &footerFile = Config_getString("HTML_FOOTER"); if (!footerFile.isEmpty()) { QFileInfo fi(footerFile); if (!fi.exists()) { config_err("Error: tag HTML_FOOTER: footer file `%s' " "does not exist\n",footerFile.data()); exit(1); } } // Test to see if LaTeX header is valid QCString &latexHeaderFile = Config_getString("LATEX_HEADER"); if (!latexHeaderFile.isEmpty()) { QFileInfo fi(latexHeaderFile); if (!fi.exists()) { config_err("Error: tag LATEX_HEADER: header file `%s' " "does not exist\n",latexHeaderFile.data()); exit(1); } } // check include path QStrList &includePath = Config_getList("INCLUDE_PATH"); char *s=includePath.first(); while (s) { QFileInfo fi(s); if (!fi.exists()) config_err("Warning: tag INCLUDE_PATH: include path `%s' " "does not exist\n",s); s=includePath.next(); } // check aliases QStrList &aliasList = Config_getList("ALIASES"); s=aliasList.first(); while (s) { QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); QCString alias=s; alias=alias.stripWhiteSpace(); if (alias.find(re)!=0) { config_err("Illegal alias format `%s'. Use \"name=value\"\n",alias.data()); } s=aliasList.next(); } // check dot path QCString &dotPath = Config_getString("DOT_PATH"); if (!dotPath.isEmpty()) { if (dotPath.find('\\')!=-1) { if (dotPath.at(dotPath.length()-1)!='\\') { dotPath+='\\'; } } else if (dotPath.find('/')!=-1) { if (dotPath.at(dotPath.length()-1)!='/') { dotPath+='/'; } } #if defined(_WIN32) QFileInfo dp(dotPath+"dot.exe");#else QFileInfo dp(dotPath+"dot");#endif if (!dp.exists() || !dp.isFile()) { config_err("Warning: the dot tool could not be found at %s\n",dotPath.data()); dotPath=""; } else { dotPath=dp.dirPath(TRUE)+"/";#if defined(_WIN32) // convert slashes uint i=0,l=dotPath.length(); for (i=0;i<l;i++) if (dotPath.at(i)=='/') dotPath.at(i)='\\';#endif } } else // make sure the string is empty but not null! { dotPath=""; } // check input QStrList &inputSources=Config_getList("INPUT"); if (inputSources.count()==0) { //config_err("Error: tag INPUT: no input files specified after the INPUT tag.\n"); //exit(1); inputSources.append(QDir::currentDirPath()); //config_warn("Warning: no files after the INPUT tag, defaulting to the current dir\n"); } else { s=inputSources.first(); while (s) { QFileInfo fi(s); if (!fi.exists()) { config_err("Error: tag INPUT: input source `%s' does not exist\n",s); exit(1); } s=inputSources.next(); } } // add default pattern if needed QStrList &filePatternList = Config_getList("FILE_PATTERNS"); if (filePatternList.isEmpty()) { filePatternList.append("*.c"); filePatternList.append("*.cc"); filePatternList.append("*.cxx"); filePatternList.append("*.cpp"); filePatternList.append("*.c++"); filePatternList.append("*.java"); filePatternList.append("*.ii"); filePatternList.append("*.ixx"); filePatternList.append("*.ipp"); filePatternList.append("*.i++"); filePatternList.append("*.inl"); filePatternList.append("*.h"); filePatternList.append("*.hh"); filePatternList.append("*.hxx"); filePatternList.append("*.hpp"); filePatternList.append("*.h++"); filePatternList.append("*.idl"); } // add default pattern if needed QStrList &examplePatternList = Config_getList("EXAMPLE_PATTERNS"); if (examplePatternList.isEmpty()) { examplePatternList.append("*"); } // add default pattern if needed //QStrList &imagePatternList = Config_getList("IMAGE_PATTERNS"); //if (imagePatternList.isEmpty()) //{ // imagePatternList.append("*"); //} // more checks needed if and only if the search engine is enabled. if (Config_getBool("SEARCHENGINE")) { // check cgi name QCString &cgiName = Config_getString("CGI_NAME"); if (cgiName.isEmpty()) { config_err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n"); exit(1); } // check cgi URL QCString &cgiURL = Config_getString("CGI_URL"); if (cgiURL.isEmpty()) { config_err("Error: tag CGI_URL: no URL to cgi directory specified.\n"); exit(1); } else if (cgiURL.left(7)!="http://" && cgiURL.left(8)!="https://" ) { config_err("Error: tag CGI_URL: URL to cgi directory is invalid (must " "start with http:// or https://).\n"); exit(1); } // check documentation URL QCString &docURL = Config_getString("DOC_URL"); if (docURL.isEmpty()) { docURL = Config_getString("OUTPUT_DIRECTORY").copy().prepend("file://").append("html"); } else if (docURL.left(7)!="http://" && docURL.left(8)!="https://" && docURL.left(7)!="file://" ) { config_err("Error: tag DOC_URL: URL to documentation is invalid or " "not absolute.\n"); exit(1); } // check absolute documentation path QCString &docAbsPath = Config_getString("DOC_ABSPATH"); if (docAbsPath.isEmpty()) { docAbsPath = Config_getString("OUTPUT_DIRECTORY")+"/html"; } else if (docAbsPath[0]!='/' && docAbsPath[1]!=':') {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -