Doxygen
util.h 文件参考

A bunch of utility functions. 更多...

#include <memory>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <fstream>
#include <ctype.h>
#include "types.h"
#include "docparser.h"
#include "containers.h"
#include "outputgen.h"
#include "regex.h"
#include "conceptdef.h"
+ util.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

class  TextGeneratorIntf
 Abstract interface for a hyperlinked text fragment. 更多...
 
class  TextGeneratorOLImpl
 Implements TextGeneratorIntf for an OutputDocInterface stream. 更多...
 
struct  ColoredImgDataItem
 Data associated with a HSV colored image. 更多...
 

函数

QCString langToString (SrcLangExt lang)
 Returns a string representation of lang. 更多...
 
QCString getLanguageSpecificSeparator (SrcLangExt lang, bool classScope=FALSE)
 Returns the scope separator to use given the programming language lang 更多...
 
void linkifyText (const TextGeneratorIntf &ol, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak=FALSE, bool external=TRUE, bool keepSpaces=FALSE, int indentLevel=0)
 
QCString fileToString (const QCString &name, bool filter=FALSE, bool isSourceCode=FALSE)
 
QCString dateToString (bool)
 
bool getDefs (const QCString &scopeName, const QCString &memberName, const QCString &args, const MemberDef *&md, const ClassDef *&cd, const FileDef *&fd, const NamespaceDef *&nd, const GroupDef *&gd, bool forceEmptyScope=FALSE, const FileDef *currentFile=0, bool checkCV=FALSE)
 
QCString getFileFilter (const QCString &name, bool isSourceCode)
 
bool resolveRef (const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, bool lookForSpecializations=TRUE, const FileDef *currentFile=0, bool checkScope=FALSE)
 
bool resolveLink (const QCString &scName, const QCString &lr, bool inSeeBlock, const Definition **resContext, QCString &resAnchor)
 
bool generateLink (OutputDocInterface &od, const QCString &, const QCString &, bool inSeeBlock, const QCString &)
 
void generateFileRef (OutputDocInterface &od, const QCString &, const QCString &linkTxt=QCString())
 
void writePageRef (OutputDocInterface &od, const QCString &cn, const QCString &mn)
 
QCString getCanonicalTemplateSpec (const Definition *d, const FileDef *fs, const QCString &spec)
 
bool matchArguments2 (const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV)
 
void mergeArguments (ArgumentList &, ArgumentList &, bool forceNameOverwrite=FALSE)
 
QCString substituteClassNames (const QCString &s)
 
QCString clearBlock (const char *s, const char *begin, const char *end)
 
QCString selectBlock (const QCString &s, const QCString &name, bool enable, OutputGenerator::OutputType o)
 
QCString removeEmptyLines (const QCString &s)
 
FileDeffindFileDef (const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
 
QCString showFileDefMatches (const FileNameLinkedMap *fnMap, const QCString &n)
 
int guessSection (const QCString &name)
 
bool isId (int c)
 
bool isIdJS (int c)
 
QCString removeRedundantWhiteSpace (const QCString &s)
 
QCString argListToString (const ArgumentList &al, bool useCanonicalType=FALSE, bool showDefVals=TRUE)
 
QCString tempArgListToString (const ArgumentList &al, SrcLangExt lang, bool includeDefaults=true)
 
QCString generateMarker (int id)
 
void writeExamples (OutputList &ol, const ExampleList &el)
 
QCString stripAnonymousNamespaceScope (const QCString &s)
 
QCString stripFromPath (const QCString &path)
 
QCString stripFromIncludePath (const QCString &path)
 
bool rightScopeMatch (const QCString &scope, const QCString &name)
 
bool leftScopeMatch (const QCString &scope, const QCString &name)
 
QCString substituteKeywords (const QCString &s, const QCString &title, const QCString &projName, const QCString &projNum, const QCString &projBrief)
 
int getPrefixIndex (const QCString &name)
 
QCString removeAnonymousScopes (const QCString &s)
 
QCString replaceAnonymousScopes (const QCString &s, const QCString &replacement=QCString())
 
QCString convertNameToFile (const QCString &name, bool allowDots=FALSE, bool allowUnderscore=FALSE)
 
void extractNamespaceName (const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass=FALSE)
 
QCString insertTemplateSpecifierInScope (const QCString &scope, const QCString &templ)
 
QCString stripScope (const QCString &name)
 
QCString convertToId (const QCString &s)
 
QCString correctId (const QCString &s)
 
QCString convertToHtml (const QCString &s, bool keepEntities=TRUE)
 
QCString convertToLaTeX (const QCString &s, bool insideTabbing=FALSE, bool keepSpaces=FALSE)
 
QCString convertToXML (const QCString &s, bool keepEntities=FALSE)
 
QCString convertToDocBook (const QCString &s)
 
QCString convertToJSString (const QCString &s)
 
QCString convertToPSString (const QCString &s)
 
QCString getOverloadDocs ()
 
void addMembersToMemberGroup (MemberList *ml, MemberGroupList *pMemberGroups, const Definition *context)
 
int extractClassNameFromType (const QCString &type, int &pos, QCString &name, QCString &templSpec, SrcLangExt=SrcLangExt_Unknown)
 
QCString normalizeNonTemplateArgumentsInString (const QCString &name, const Definition *context, const ArgumentList &formalArgs)
 
QCString substituteTemplateArgumentsInString (const QCString &name, const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs)
 
QCString stripTemplateSpecifiersFromScope (const QCString &fullName, bool parentOnly=TRUE, QCString *lastScopeStripped=0)
 
QCString resolveTypeDef (const Definition *d, const QCString &name, const Definition **typedefContext=0)
 
QCString mergeScopes (const QCString &leftScope, const QCString &rightScope)
 
int getScopeFragment (const QCString &s, int p, int *l)
 
void addRefItem (const RefItemVector &sli, const QCString &key, const QCString &prefix, const QCString &name, const QCString &title, const QCString &args, const Definition *scope)
 
PageDefaddRelatedPage (const QCString &name, const QCString &ptitle, const QCString &doc, const QCString &fileName, int docLine, int startLine, const RefItemVector &sli=RefItemVector(), GroupDef *gd=0, const TagInfo *tagInfo=0, bool xref=FALSE, SrcLangExt lang=SrcLangExt_Unknown)
 
QCString escapeCharsInString (const QCString &name, bool allowDots, bool allowUnderscore=FALSE)
 
QCString unescapeCharsInString (const QCString &s)
 
void addGroupListToTitle (OutputList &ol, const Definition *d)
 
void filterLatexString (TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces)
 
QCString latexEscapeLabelName (const QCString &s)
 
QCString latexEscapeIndexChars (const QCString &s)
 
QCString latexEscapePDFString (const QCString &s)
 
QCString latexFilterURL (const QCString &s)
 
QCString rtfFormatBmkStr (const QCString &name)
 
QCString linkToText (SrcLangExt lang, const QCString &link, bool isFileName)
 
bool checkExtension (const QCString &fName, const QCString &ext)
 
QCString addHtmlExtensionIfMissing (const QCString &fName)
 
QCString stripExtensionGeneral (const QCString &fName, const QCString &ext)
 
QCString stripExtension (const QCString &fName)
 
void replaceNamespaceAliases (QCString &scope, int i)
 
int computeQualifiedIndex (const QCString &name)
 
void addDirPrefix (QCString &fileName)
 
QCString relativePathToRoot (const QCString &name)
 
void createSubDirs (const Dir &d)
 
void clearSubDirs (const Dir &d)
 
QCString stripPath (const QCString &s)
 
bool containsWord (const QCString &s, const char *word)
 returns TRUE iff string s contains word w 更多...
 
bool findAndRemoveWord (QCString &s, const char *word)
 removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple sequences of spaces. 更多...
 
QCString stripLeadingAndTrailingEmptyLines (const QCString &s, int &docLine)
 Special version of QCString::stripWhiteSpace() that only strips completely blank lines. 更多...
 
bool updateLanguageMapping (const QCString &extension, const QCString &parser)
 
SrcLangExt getLanguageFromFileName (const QCString &fileName, SrcLangExt defLang=SrcLangExt_Cpp)
 
SrcLangExt getLanguageFromCodeLang (QCString &fileName)
 Routine to handle the language attribute of the \code command 更多...
 
QCString getFileNameExtension (const QCString &fn)
 
void initDefaultExtensionMapping ()
 
void addCodeOnlyMappings ()
 
bool checkIfTypedef (const Definition *scope, const FileDef *fileScope, const QCString &n)
 
QCString parseCommentAsText (const Definition *scope, const MemberDef *member, const QCString &doc, const QCString &fileName, int lineNr)
 
QCString transcodeCharacterStringToUTF8 (const QCString &input)
 
QCString recodeString (const QCString &str, const char *fromEncoding, const char *toEncoding)
 
QCString extractAliasArgs (const QCString &args, size_t pos)
 
int countAliasArguments (const QCString &argList)
 
QCString resolveAliasCmd (const QCString &aliasCmd)
 
std::string expandAlias (const std::string &aliasName, const std::string &aliasValue)
 
void writeTypeConstraints (OutputList &ol, const Definition *d, const ArgumentList &al)
 
QCString convertCharEntitiesToUTF8 (const QCString &s)
 
void stackTrace ()
 
bool readInputFile (const QCString &fileName, BufStr &inBuf, bool filter=TRUE, bool isSourceCode=FALSE)
 read a file name fileName and optionally filter and transcode it 更多...
 
QCString filterTitle (const QCString &title)
 
bool patternMatch (const FileInfo &fi, const StringVector &patList)
 
QCString externalLinkTarget (const bool parent=false)
 
QCString externalRef (const QCString &relPath, const QCString &ref, bool href)
 
int nextUtf8CharPosition (const QCString &utf8Str, uint len, uint startPos)
 
void writeMarkerList (OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
 
void writeColoredImgData (const QCString &dir, ColoredImgDataItem data[])
 Writes the intensity only bitmap represented by data as an image to directory dir using the colors defined by HTML_COLORSTYLE_*. 更多...
 
QCString replaceColorMarkers (const QCString &str)
 Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC, where #AABBCC represents a valid color, based on the intensity represented by hex number AA and the current HTML_COLORSTYLE_* settings. 更多...
 
bool copyFile (const QCString &src, const QCString &dest)
 Copies the contents of file with name src to the newly created file with name dest. 更多...
 
QCString extractBlock (const QCString &text, const QCString &marker)
 Returns the section of text, in between a pair of markers. 更多...
 
int lineBlock (const QCString &text, const QCString &marker)
 Returns the line number of the line following the line with the marker. 更多...
 
bool isURL (const QCString &url)
 Checks whether the given url starts with a supported protocol 更多...
 
QCString correctURL (const QCString &url, const QCString &relPath)
 Corrects URL url according to the relative path relPath. 更多...
 
QCString processMarkup (const QCString &s)
 
bool protectionLevelVisible (Protection prot)
 
QCString stripIndentation (const QCString &s)
 
void stripIndentation (QCString &doc, const int indentationLevel)
 
QCString getDotImageExtension ()
 
bool fileVisibleInIndex (const FileDef *fd, bool &genSourceFile)
 
QCString extractDirection (QCString &docs)
 Strip the direction part from docs and return it as a string in canonical form The input docs string can start with e.g. 更多...
 
void convertProtectionLevel (MemberListType inListType, Protection inProt, int *outListType1, int *outListType2)
 Computes for a given list type inListType, which are the the corresponding list type(s) in the base class that are to be added to this list. 更多...
 
bool mainPageHasTitle ()
 
bool openOutputFile (const QCString &outFile, std::ofstream &f)
 
void writeExtraLatexPackages (TextStream &t)
 
void writeLatexSpecialFormulaChars (TextStream &t)
 
StringVector split (const std::string &s, const std::string &delimiter)
 split input string s by string delimiter delimiter. returns a vector of non-empty strings that are between the delimiters 更多...
 
StringVector split (const std::string &s, const reg::Ex &delimiter)
 split input string s by regular expression delimiter delimiter. returns a vector of non-empty strings that are between the delimiters 更多...
 
int findIndex (const StringVector &sv, const std::string &s)
 find the index of a string in a vector of strings, returns -1 if the string could not be found 更多...
 
int findIndex (const std::string &s, const reg::Ex &re)
 find the index of the first occurrence of pattern re in a string s returns -1 if the pattern could not be found 更多...
 
std::string join (const StringVector &s, const std::string &delimiter)
 create a string where the string in the vector are joined by the given delimiter 更多...
 
bool recognizeFixedForm (const QCString &contents, FortranFormat format)
 
FortranFormat convertFileNameFortranParserCode (QCString fn)
 
QCString integerToAlpha (int n, bool upper=true)
 
QCString integerToRoman (int n, bool upper=true)
 

详细描述

A bunch of utility functions.

在文件 util.h 中定义.

函数说明

◆ addCodeOnlyMappings()

void addCodeOnlyMappings ( )

在文件 util.cpp5568 行定义.

5569 {
5570  updateLanguageMapping(".xml", "xml");
5571  updateLanguageMapping(".sql", "sql");
5572 }

引用了 updateLanguageMapping().

被这些函数引用 generateOutput().

◆ addDirPrefix()

void addDirPrefix ( QCString fileName)

◆ addGroupListToTitle()

◆ addHtmlExtensionIfMissing()

QCString addHtmlExtensionIfMissing ( const QCString fName)

在文件 util.cpp5275 行定义.

5276 {
5277  if (fName.isEmpty()) return fName;
5278  if (fName.find('.')==-1) // no extension
5279  {
5280  return QCString(fName)+Doxygen::htmlFileExtension;
5281  }
5282  return fName;
5283 }

引用了 QCString::find(), Doxygen::htmlFileExtension , 以及 QCString::isEmpty().

被这些函数引用 HtmlCodeGenerator::_writeCodeLink(), DocSets::addContentsItem(), EclipseHelp::addContentsItem(), HtmlHelp::addContentsItem(), DotGroupCollaboration::addMemberList(), DotGroupCollaboration::buildGraph(), MemberContext::Private::callerGraph(), MemberContext::Private::callGraph(), ClassContext::Private::collaborationDiagram(), convertMapFile(), DirContext::Private::dirGraph(), drawClusterOpening(), drawDirectory(), dumpSymbol(), field2URL(), FTVHelp::generateTree(), ModuleContext::Private::groupGraph(), FileContext::Private::includedByGraph(), FileContext::Private::includeGraph(), ClassContext::Private::inheritanceDiagram(), makeFileName(), DefinitionImpl::navigationPathAsString(), node2URL(), replaceRef(), SearchIndexExternal::setCurrentDoc(), HtmlGenerator::startFile(), HtmlGenerator::startIndexItem(), HtmlDocVisitor::startLink(), HtmlGenerator::startTextLink(), LayoutNavEntry::url(), HtmlDocVisitor::visitPre(), DotNode::writeBox(), writeClassToDot(), writeColumn(), DefinitionImpl::writeDocAnchorsToTagFile(), HtmlGenerator::writeInheritedSectionTitle(), writeJavaScriptSearchIndex(), TextGeneratorHtml::writeLink(), writeMapArea(), HtmlGenerator::writeObjectLink(), NamespaceDefImpl::writeQuickMemberLinks(), GroupDefImpl::writeQuickMemberLinks(), FileDefImpl::writeQuickMemberLinks(), ClassDefImpl::writeQuickMemberLinks(), HtmlGenerator::writeSplitBarAsString(), HtmlGenerator::writeStartAnnoItem(), HtmlGenerator::writeSummaryLink(), NamespaceDefImpl::writeTagFile(), PageDefImpl::writeTagFile(), ConceptDefImpl::writeTagFile(), DirDefImpl::writeTagFile(), GroupDefImpl::writeTagFile(), FileDefImpl::writeTagFile(), VhdlDocGen::writeTagFile(), ClassDefImpl::writeTagFile(), MemberDefImpl::writeTagFile(), DocSets::writeToken() , 以及 HtmlCodeGenerator::writeTooltip().

◆ addMembersToMemberGroup()

void addMembersToMemberGroup ( MemberList ml,
MemberGroupList pMemberGroups,
const Definition context 
)

在文件 util.cpp4220 行定义.

4223 {
4224  ASSERT(context!=0);
4225  //printf("addMemberToMemberGroup() context=%s\n",qPrint(context->name()));
4226  if (ml==0) return;
4227 
4228  struct MoveMemberInfo
4229  {
4230  MoveMemberInfo(const MemberDef *md,MemberGroup *mg,const RefItemVector &rv)
4231  : memberDef(md), memberGroup(mg), sli(rv) {}
4232  const MemberDef *memberDef;
4233  MemberGroup *memberGroup;
4234  RefItemVector sli;
4235  };
4236  std::vector<MoveMemberInfo> movedMembers;
4237 
4238  for (const auto &md : *ml)
4239  {
4240  if (md->isEnumerate()) // insert enum value of this enum into groups
4241  {
4242  for (const auto &fmd : md->enumFieldList())
4243  {
4244  int groupId=fmd->getMemberGroupId();
4245  if (groupId!=-1)
4246  {
4247  auto it = Doxygen::memberGroupInfoMap.find(groupId);
4248  if (it!=Doxygen::memberGroupInfoMap.end())
4249  {
4250  auto &info = it->second;
4251  auto mg_it = std::find_if(pMemberGroups->begin(),
4252  pMemberGroups->end(),
4253  [&groupId](const auto &g)
4254  { return g->groupId()==groupId; }
4255  );
4256  MemberGroup *mg_ptr = 0;
4257  if (mg_it==pMemberGroups->end())
4258  {
4259  auto mg = std::make_unique<MemberGroup>(
4260  context,
4261  groupId,
4262  info->header,
4263  info->doc,
4264  info->docFile,
4265  info->docLine,
4266  ml->container());
4267  mg_ptr = mg.get();
4268  pMemberGroups->push_back(std::move(mg));
4269  }
4270  else
4271  {
4272  mg_ptr = (*mg_it).get();
4273  }
4274  mg_ptr->insertMember(fmd); // insert in member group
4275  MemberDefMutable *fmdm = toMemberDefMutable(fmd);
4276  if (fmdm)
4277  {
4278  fmdm->setMemberGroup(mg_ptr);
4279  }
4280  }
4281  }
4282  }
4283  }
4284  int groupId=md->getMemberGroupId();
4285  if (groupId!=-1)
4286  {
4287  auto it = Doxygen::memberGroupInfoMap.find(groupId);
4288  if (it!=Doxygen::memberGroupInfoMap.end())
4289  {
4290  auto &info = it->second;
4291  auto mg_it = std::find_if(pMemberGroups->begin(),
4292  pMemberGroups->end(),
4293  [&groupId](const auto &g)
4294  { return g->groupId()==groupId; }
4295  );
4296  MemberGroup *mg_ptr = 0;
4297  if (mg_it==pMemberGroups->end())
4298  {
4299  auto mg = std::make_unique<MemberGroup>(
4300  context,
4301  groupId,
4302  info->header,
4303  info->doc,
4304  info->docFile,
4305  info->docLine,
4306  ml->container());
4307  mg_ptr = mg.get();
4308  pMemberGroups->push_back(std::move(mg));
4309  }
4310  else
4311  {
4312  mg_ptr = (*mg_it).get();
4313  }
4314  movedMembers.push_back(MoveMemberInfo(md,mg_ptr,info->m_sli));
4315  }
4316  }
4317  }
4318 
4319  // move the members to their group
4320  for (const auto &mmi : movedMembers)
4321  {
4322  ml->remove(mmi.memberDef); // remove from member list
4323  mmi.memberGroup->insertMember(mmi.memberDef->resolveAlias()); // insert in member group
4324  mmi.memberGroup->setRefItems(mmi.sli);
4325  MemberDefMutable *rmdm = toMemberDefMutable(mmi.memberDef);
4326  if (rmdm)
4327  {
4328  rmdm->setMemberGroup(mmi.memberGroup);
4329  }
4330  }
4331 }

引用了 ASSERT, Definition::docFile(), end(), MemberDef::enumFieldList(), MemberDef::getMemberGroupId(), MemberGroup::insertMember(), MemberDef::isEnumerate(), Doxygen::memberGroupInfoMap, MemberDef::setMemberGroup() , 以及 toMemberDefMutable().

◆ addRefItem()

void addRefItem ( const RefItemVector sli,
const QCString key,
const QCString prefix,
const QCString name,
const QCString title,
const QCString args,
const Definition scope 
)

在文件 util.cpp4880 行定义.

4883 {
4884  //printf("addRefItem(sli=%d,key=%s,prefix=%s,name=%s,title=%s,args=%s)\n",(int)sli.size(),key,prefix,name,title,args);
4885  if (!key.isEmpty() && key[0]!='@') // check for @ to skip anonymous stuff (see bug427012)
4886  {
4887  for (RefItem *item : sli)
4888  {
4889  item->setPrefix(prefix);
4890  item->setScope(scope);
4891  item->setName(name);
4892  item->setTitle(title);
4893  item->setArgs(args);
4894  item->setGroup(key);
4895  }
4896  }
4897 }

引用了 QCString::isEmpty().

被这些函数引用 MemberDefImpl::addListReference(), MemberGroup::addListReferences(), NamespaceDefImpl::addListReferences(), GroupDefImpl::addListReferences(), FileDefImpl::addListReferences(), ClassDefImpl::addListReferences(), addListReferences() , 以及 buildPageList().

◆ addRelatedPage()

PageDef* addRelatedPage ( const QCString name,
const QCString ptitle,
const QCString doc,
const QCString fileName,
int  docLine,
int  startLine,
const RefItemVector sli = RefItemVector(),
GroupDef gd = 0,
const TagInfo tagInfo = 0,
bool  xref = FALSE,
SrcLangExt  lang = SrcLangExt_Unknown 
)

在文件 util.cpp4749 行定义.

4760 {
4761  PageDef *pd=0;
4762  //printf("addRelatedPage(name=%s gd=%p)\n",qPrint(name),gd);
4763  QCString title=ptitle.stripWhiteSpace();
4764  bool newPage = true;
4765  if ((pd=Doxygen::pageLinkedMap->find(name)) && !pd->isReference())
4766  {
4767  if (!xref && !title.isEmpty() && pd->title()!=pd->name() && pd->title()!=title)
4768  {
4769  warn(fileName,startLine,"multiple use of page label '%s' with different titles, (other occurrence: %s, line: %d)",
4770  qPrint(name),qPrint(pd->docFile()),pd->getStartBodyLine());
4771  }
4772  if (!title.isEmpty() && pd->title()==pd->name()) // pd has no real title yet
4773  {
4774  pd->setTitle(title);
4776  if (si)
4777  {
4778  si->setTitle(title);
4779  }
4780  }
4781  // append documentation block to the page.
4782  pd->setDocumentation(doc,fileName,docLine);
4783  //printf("Adding page docs '%s' pi=%p name=%s\n",qPrint(doc),pd,name);
4784  // append (x)refitems to the page.
4785  pd->setRefItems(sli);
4786  newPage = false;
4787  }
4788 
4789  if (newPage) // new page
4790  {
4791  QCString baseName=name;
4792  if (baseName.right(4)==".tex")
4793  baseName=baseName.left(baseName.length()-4);
4795  baseName=baseName.left(baseName.length()-Doxygen::htmlFileExtension.length());
4796 
4797  //printf("Appending page '%s'\n",qPrint(baseName));
4798  if (pd) // replace existing page
4799  {
4800  pd->setDocumentation(doc,fileName,docLine);
4801  pd->setFileName(::convertNameToFile(baseName,FALSE,TRUE));
4802  pd->setShowLineNo(FALSE);
4803  pd->setNestingLevel(0);
4804  pd->setPageScope(0);
4805  pd->setTitle(title);
4806  }
4807  else // newPage
4808  {
4809  pd = Doxygen::pageLinkedMap->add(baseName,
4810  std::unique_ptr<PageDef>(
4811  createPageDef(fileName,docLine,baseName,doc,title)));
4812  }
4813  pd->setBodySegment(startLine,startLine,-1);
4814 
4815  pd->setRefItems(sli);
4816  pd->setLanguage(lang);
4817 
4818  if (tagInfo)
4819  {
4820  pd->setReference(tagInfo->tagName);
4821  pd->setFileName(tagInfo->fileName);
4822  }
4823 
4824 
4825  if (gd) gd->addPage(pd);
4826 
4827  if (pd->hasTitle())
4828  {
4829  //outputList->writeTitle(pi->name,pi->title);
4830 
4831  // a page name is a label as well!
4832  QCString file;
4833  QCString orgFile;
4834  int line = -1;
4835  if (gd)
4836  {
4837  file=gd->getOutputFileBase();
4838  orgFile=gd->getOutputFileBase();
4839  }
4840  else
4841  {
4842  file=pd->getOutputFileBase();
4843  orgFile=pd->docFile();
4844  line = pd->getStartBodyLine();
4845  }
4846  const SectionInfo *si = SectionManager::instance().find(pd->name());
4847  if (si)
4848  {
4849  if (!si->ref().isEmpty()) // we are from a tag file
4850  {
4852  file,-1,pd->title(),SectionType::Page,0,pd->getReference());
4853  }
4854  else if (si->lineNr() != -1)
4855  {
4856  warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s, line %d)",qPrint(pd->name()),qPrint(si->fileName()),si->lineNr());
4857  }
4858  else
4859  {
4860  warn(orgFile,line,"multiple use of section label '%s', (first occurrence: %s)",qPrint(pd->name()),qPrint(si->fileName()));
4861  }
4862  }
4863  else
4864  {
4866  file,-1,pd->title(),SectionType::Page,0,pd->getReference());
4867  //printf("si->label='%s' si->definition=%s si->fileName='%s'\n",
4868  // qPrint(si->label),si->definition?si->definition->name().data():"<none>",
4869  // qPrint(si->fileName));
4870  //printf(" SectionInfo: sec=%p sec->fileName=%s\n",si,qPrint(si->fileName));
4871  //printf("Adding section key=%s si->fileName=%s\n",qPrint(pageName),qPrint(si->fileName));
4872  }
4873  }
4874  }
4875  return pd;
4876 }

引用了 LinkedMap< T, Hash, KeyEqual, Map >::add(), SectionManager::add(), GroupDef::addPage(), convertNameToFile(), createPageDef(), Definition::docFile(), FALSE, TagInfo::fileName, SectionInfo::fileName(), LinkedMap< T, Hash, KeyEqual, Map >::find(), PageDef::getOutputFileBase(), GroupDef::getOutputFileBase(), Definition::getReference(), Definition::getStartBodyLine(), PageDef::hasTitle(), Doxygen::htmlFileExtension, SectionManager::instance(), QCString::isEmpty(), Definition::isReference(), QCString::left(), QCString::length(), SectionInfo::lineNr(), Definition::name(), Page, Doxygen::pageLinkedMap, qPrint(), SectionInfo::ref(), SectionManager::replace(), QCString::right(), DefinitionMutable::setBodySegment(), DefinitionMutable::setDocumentation(), PageDef::setFileName(), DefinitionMutable::setLanguage(), PageDef::setNestingLevel(), PageDef::setPageScope(), DefinitionMutable::setReference(), DefinitionMutable::setRefItems(), PageDef::setShowLineNo(), PageDef::setTitle(), SectionInfo::setTitle(), QCString::stripWhiteSpace(), TagInfo::tagName, PageDef::title(), TRUE , 以及 warn().

◆ argListToString()

QCString argListToString ( const ArgumentList al,
bool  useCanonicalType = FALSE,
bool  showDefVals = TRUE 
)

在文件 util.cpp1149 行定义.

1150 {
1151  QCString result;
1152  if (!al.hasParameters()) return result;
1153  result+="(";
1154  for (auto it = al.begin() ; it!=al.end() ;)
1155  {
1156  Argument a = *it;
1157  QCString type1 = useCanonicalType && !a.canType.isEmpty() ? a.canType : a.type;
1158  QCString type2;
1159  int i=type1.find(")("); // hack to deal with function pointers
1160  if (i!=-1)
1161  {
1162  type2=type1.mid(i);
1163  type1=type1.left(i);
1164  }
1165  if (!a.attrib.isEmpty())
1166  {
1167  result+=a.attrib+" ";
1168  }
1169  if (!a.name.isEmpty() || !a.array.isEmpty())
1170  {
1171  result+= type1+" "+a.name+type2+a.array;
1172  }
1173  else
1174  {
1175  result+= type1+type2;
1176  }
1177  if (!a.defval.isEmpty() && showDefVals)
1178  {
1179  result+="="+a.defval;
1180  }
1181  ++it;
1182  if (it!=al.end()) result+=", ";
1183  }
1184  result+=")";
1185  if (al.constSpecifier()) result+=" const";
1186  if (al.volatileSpecifier()) result+=" volatile";
1187  if (al.refQualifier()==RefQualifierLValue) result+=" &";
1188  else if (al.refQualifier()==RefQualifierRValue) result+=" &&";
1189  if (!al.trailingReturnType().isEmpty()) result+=al.trailingReturnType();
1190  if (al.pureSpecifier()) result+=" =0";
1191  return removeRedundantWhiteSpace(result);
1192 }

引用了 Argument::array, Argument::attrib, ArgumentList::begin(), Argument::canType, ArgumentList::constSpecifier(), Argument::defval, ArgumentList::end(), QCString::find(), ArgumentList::hasParameters(), QCString::isEmpty(), QCString::left(), QCString::mid(), Argument::name, ArgumentList::pureSpecifier(), ArgumentList::refQualifier(), RefQualifierLValue, RefQualifierRValue, removeRedundantWhiteSpace(), ArgumentList::trailingReturnType(), Argument::type , 以及 ArgumentList::volatileSpecifier().

被这些函数引用 addMemberFunction(), DocParser::checkArgumentName(), DocParser::checkUnOrMultipleDocumentedParams(), findGlobalMember() , 以及 findMember().

◆ checkExtension()

bool checkExtension ( const QCString fName,
const QCString ext 
)

在文件 util.cpp5270 行定义.

5271 {
5272  return fName.right(ext.length())==ext;
5273 }

引用了 QCString::length() , 以及 QCString::right().

被这些函数引用 copyLatexStyleSheet() , 以及 extraLatexStyleSheet().

◆ checkIfTypedef()

bool checkIfTypedef ( const Definition scope,
const FileDef fileScope,
const QCString n 
)

Returns true iff the given name string appears to be a typedef in scope.

在文件 util.cpp5684 行定义.

5685 {
5686  MemberDef *bestMatch = getMemberFromSymbol(scope,fileScope,n);
5687 
5688  if (bestMatch && bestMatch->isTypedef())
5689  return TRUE; // closest matching symbol is a typedef
5690  else
5691  return FALSE;
5692 }

引用了 FALSE, getMemberFromSymbol(), MemberDef::isTypedef() , 以及 TRUE.

被这些函数引用 isVarWithConstructor().

◆ clearBlock()

QCString clearBlock ( const char *  s,
const char *  begin,
const char *  end 
)

◆ clearSubDirs()

void clearSubDirs ( const Dir d)

在文件 util.cpp3704 行定义.

3705 {
3706  if (Config_getBool(CREATE_SUBDIRS))
3707  {
3708  // remove empty subdirectories
3709  for (int l1=0;l1<16;l1++)
3710  {
3711  QCString subdir;
3712  subdir.sprintf("d%x",l1);
3713  for (int l2=0;l2<256;l2++)
3714  {
3715  QCString subsubdir;
3716  subsubdir.sprintf("d%x/d%02x",l1,l2);
3717  if (d.exists(subsubdir.str()) && d.isEmpty(subsubdir.str()))
3718  {
3719  d.rmdir(subsubdir.str());
3720  }
3721  }
3722  if (d.exists(subdir.str()) && d.isEmpty(subdir.str()))
3723  {
3724  d.rmdir(subdir.str());
3725  }
3726  }
3727  }
3728 }

引用了 Config_getBool, Dir::exists(), Dir::isEmpty(), Dir::rmdir(), QCString::sprintf() , 以及 QCString::str().

被这些函数引用 RTFGenerator::cleanup(), ManGenerator::cleanup(), HtmlGenerator::cleanup(), LatexGenerator::cleanup(), DocbookGenerator::cleanup() , 以及 generateXML().

◆ computeQualifiedIndex()

int computeQualifiedIndex ( const QCString name)

在文件 util.cpp486 行定义.

487 {
488  int i = name.find('<');
489  return name.findRev("::",i==-1 ? name.length() : i);
490 }

引用了 QCString::find(), QCString::findRev() , 以及 QCString::length().

被这些函数引用 addToMap(), getMemberFromSymbol() , 以及 SymbolResolver::Private::getResolvedClassRec().

◆ containsWord()

bool containsWord ( const QCString s,
const char *  word 
)

returns TRUE iff string s contains word w

在文件 util.cpp5335 行定义.

5336 {
5337  if (str.isEmpty() || word==0) return false;
5338  static const reg::Ex re(R"(\a+)");
5339  std::string s = str.str();
5340  for (reg::Iterator it(s,re) ; it!=reg::Iterator() ; ++it)
5341  {
5342  if (it->str()==word) return true;
5343  }
5344  return false;
5345 }

引用了 QCString::isEmpty() , 以及 QCString::str().

◆ convertCharEntitiesToUTF8()

QCString convertCharEntitiesToUTF8 ( const QCString s)

在文件 util.cpp4170 行定义.

4171 {
4172  if (str.isEmpty()) return QCString();
4173 
4174  std::string s = str.data();
4175  static const reg::Ex re(R"(&\a\w*;)");
4176  reg::Iterator it(s,re);
4178 
4179  GrowBuf growBuf;
4180  size_t p,i=0,l;
4181  for (; it!=end ; ++it)
4182  {
4183  const auto &match = *it;
4184  p = match.position();
4185  l = match.length();
4186  if (p>i)
4187  {
4188  growBuf.addStr(s.substr(i,p-i));
4189  }
4190  QCString entity(match.str());
4192  const char *code=0;
4193  if (symType!=DocSymbol::Sym_Unknown && (code=HtmlEntityMapper::instance()->utf8(symType)))
4194  {
4195  growBuf.addStr(code);
4196  }
4197  else
4198  {
4199  growBuf.addStr(entity);
4200  }
4201  i=p+l;
4202  }
4203  growBuf.addStr(s.substr(i));
4204  growBuf.addChar(0);
4205  //printf("convertCharEntitiesToUTF8(%s)->%s\n",qPrint(s),growBuf.get());
4206  return growBuf.get();
4207 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), end(), GrowBuf::get(), HtmlEntityMapper::instance(), QCString::isEmpty(), reg::match(), HtmlEntityMapper::name2sym() , 以及 DocSymbol::Sym_Unknown.

被这些函数引用 convertToJSString(), generateXMLForPage(), parseCommentAsText(), HtmlDocVisitor::visitPre(), LatexDocVisitor::visitPre() , 以及 XmlDocVisitor::visitPre().

◆ convertFileNameFortranParserCode()

FortranFormat convertFileNameFortranParserCode ( QCString  fn)

在文件 util.cpp7156 行定义.

7157 {
7158  QCString ext = getFileNameExtension(fn);
7159  QCString parserName = Doxygen::parserManager->getParserName(ext);
7160 
7161  if (parserName == "fortranfixed") return FortranFormat_Fixed;
7162  else if (parserName == "fortranfree") return FortranFormat_Free;
7163 
7164  return FortranFormat_Unknown;
7165 }

引用了 FortranFormat_Fixed, FortranFormat_Free, FortranFormat_Unknown, getFileNameExtension(), ParserManager::getParserName() , 以及 Doxygen::parserManager.

◆ convertNameToFile()

QCString convertNameToFile ( const QCString name,
bool  allowDots,
bool  allowUnderscore 
)

This function determines the file name on disk of an item given its name, which could be a class name with template arguments, so special characters need to be escaped.

在文件 util.cpp3604 行定义.

3605 {
3606  if (name.isEmpty()) return name;
3607  static bool shortNames = Config_getBool(SHORT_NAMES);
3608  static bool createSubdirs = Config_getBool(CREATE_SUBDIRS);
3609  QCString result;
3610  if (shortNames) // use short names only
3611  {
3612  std::lock_guard<std::mutex> lock(g_usedNamesMutex);
3613  auto kv = g_usedNames.find(name.str());
3614  uint num=0;
3615  if (kv!=g_usedNames.end())
3616  {
3617  num = kv->second;
3618  }
3619  else
3620  {
3621  num = g_usedNamesCount;
3622  g_usedNames.insert(std::make_pair(name.str(),g_usedNamesCount++));
3623  }
3624  result.sprintf("a%05d",num);
3625  }
3626  else // long names
3627  {
3628  result=escapeCharsInString(name,allowDots,allowUnderscore);
3629  int resultLen = result.length();
3630  if (resultLen>=128) // prevent names that cannot be created!
3631  {
3632  // third algorithm based on MD5 hash
3633  uchar md5_sig[16];
3634  char sigStr[33];
3635  MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig);
3636  MD5SigToString(md5_sig,sigStr);
3637  result=result.left(128-32)+sigStr;
3638  }
3639  }
3640  if (createSubdirs)
3641  {
3642  int l1Dir=0,l2Dir=0;
3643 
3644  // compute md5 hash to determine sub directory to use
3645  uchar md5_sig[16];
3646  MD5Buffer((const unsigned char *)result.data(),result.length(),md5_sig);
3647  l1Dir = md5_sig[14]&0xf;
3648  l2Dir = md5_sig[15];
3649 
3650  result.prepend(QCString().sprintf("d%x/d%02x/",l1Dir,l2Dir));
3651  }
3652  //printf("*** convertNameToFile(%s)->%s\n",qPrint(name),qPrint(result));
3653  return result;
3654 }

引用了 Config_getBool, QCString::data(), escapeCharsInString(), g_usedNames, g_usedNamesCount, g_usedNamesMutex, QCString::isEmpty(), QCString::left(), QCString::length(), QCString::prepend(), QCString::sprintf() , 以及 QCString::str().

被这些函数引用 addRelatedPage(), buildExampleList(), ClassDefImpl::ClassDefImpl(), ConceptDefImpl::ConceptDefImpl(), DocAnchor::DocAnchor(), DocCite::DocCite(), DocParser::handleAHref(), NamespaceDefImpl::NamespaceDefImpl(), FileDefImpl::setDiskName() , 以及 NamespaceDefImpl::setFileName().

◆ convertProtectionLevel()

void convertProtectionLevel ( MemberListType  inListType,
Protection  inProt,
int *  outListType1,
int *  outListType2 
)

Computes for a given list type inListType, which are the the corresponding list type(s) in the base class that are to be added to this list.

So for public inheritance, the mapping is 1-1, so outListType1=inListType Private members are to be hidden completely.

For protected inheritance, both protected and public members of the base class should be joined in the protected member section.

For private inheritance, both protected and public members of the base class should be joined in the private member section.

在文件 util.cpp6851 行定义.

6857 {
6858  static bool extractPrivate = Config_getBool(EXTRACT_PRIVATE);
6859  // default representing 1-1 mapping
6860  *outListType1=inListType;
6861  *outListType2=-1;
6862  if (inProt==Public)
6863  {
6864  switch (inListType) // in the private section of the derived class,
6865  // the private section of the base class should not
6866  // be visible
6867  {
6874  *outListType1=-1;
6875  *outListType2=-1;
6876  break;
6877  default:
6878  break;
6879  }
6880  }
6881  else if (inProt==Protected) // Protected inheritance
6882  {
6883  switch (inListType) // in the protected section of the derived class,
6884  // both the public and protected members are shown
6885  // as protected
6886  {
6899  *outListType1=-1;
6900  *outListType2=-1;
6901  break;
6902 
6904  *outListType2=MemberListType_pubMethods;
6905  break;
6907  *outListType2=MemberListType_pubStaticMethods;
6908  break;
6910  *outListType2=MemberListType_pubSlots;
6911  break;
6913  *outListType2=MemberListType_pubAttribs;
6914  break;
6916  *outListType2=MemberListType_pubStaticAttribs;
6917  break;
6919  *outListType2=MemberListType_pubTypes;
6920  break;
6921  default:
6922  break;
6923  }
6924  }
6925  else if (inProt==Private)
6926  {
6927  switch (inListType) // in the private section of the derived class,
6928  // both the public and protected members are shown
6929  // as private
6930  {
6943  *outListType1=-1;
6944  *outListType2=-1;
6945  break;
6946 
6948  if (extractPrivate)
6949  {
6950  *outListType1=MemberListType_pubMethods;
6951  *outListType2=MemberListType_proMethods;
6952  }
6953  else
6954  {
6955  *outListType1=-1;
6956  *outListType2=-1;
6957  }
6958  break;
6960  if (extractPrivate)
6961  {
6962  *outListType1=MemberListType_pubStaticMethods;
6963  *outListType2=MemberListType_proStaticMethods;
6964  }
6965  else
6966  {
6967  *outListType1=-1;
6968  *outListType2=-1;
6969  }
6970  break;
6972  if (extractPrivate)
6973  {
6974  *outListType1=MemberListType_pubSlots;
6975  *outListType2=MemberListType_proSlots;
6976  }
6977  else
6978  {
6979  *outListType1=-1;
6980  *outListType2=-1;
6981  }
6982  break;
6984  if (extractPrivate)
6985  {
6986  *outListType1=MemberListType_pubAttribs;
6987  *outListType2=MemberListType_proAttribs;
6988  }
6989  else
6990  {
6991  *outListType1=-1;
6992  *outListType2=-1;
6993  }
6994  break;
6996  if (extractPrivate)
6997  {
6998  *outListType1=MemberListType_pubStaticAttribs;
6999  *outListType2=MemberListType_proStaticAttribs;
7000  }
7001  else
7002  {
7003  *outListType1=-1;
7004  *outListType2=-1;
7005  }
7006  break;
7008  if (extractPrivate)
7009  {
7010  *outListType1=MemberListType_pubTypes;
7011  *outListType2=MemberListType_proTypes;
7012  }
7013  else
7014  {
7015  *outListType1=-1;
7016  *outListType2=-1;
7017  }
7018  break;
7019  default:
7020  break;
7021  }
7022  }
7023  //printf("convertProtectionLevel(type=%d prot=%d): %d,%d\n",
7024  // inListType,inProt,*outListType1,*outListType2);
7025 }

引用了 Config_getBool, MemberListType_priAttribs, MemberListType_priMethods, MemberListType_priSlots, MemberListType_priStaticAttribs, MemberListType_priStaticMethods, MemberListType_priTypes, MemberListType_proAttribs, MemberListType_proMethods, MemberListType_proSlots, MemberListType_proStaticAttribs, MemberListType_proStaticMethods, MemberListType_proTypes, MemberListType_pubAttribs, MemberListType_pubMethods, MemberListType_pubSlots, MemberListType_pubStaticAttribs, MemberListType_pubStaticMethods, MemberListType_pubTypes, Private, Protected , 以及 Public.

被这些函数引用 ClassDefImpl::countInheritedDecMembers(), InheritedMemberInfoListContext::Private::findInheritedMembers() , 以及 ClassDefImpl::writeInheritedMemberDeclarations().

◆ convertToDocBook()

QCString convertToDocBook ( const QCString s)

Converts a string to an DocBook-encoded string

在文件 util.cpp3999 行定义.

4000 {
4001  if (s.isEmpty()) return s;
4002  GrowBuf growBuf;
4003  const unsigned char *q;
4004  int cnt;
4005  const unsigned char *p=(const unsigned char *)s.data();
4006  char c;
4007  while ((c=*p++))
4008  {
4009  switch (c)
4010  {
4011  case '<': growBuf.addStr("&lt;"); break;
4012  case '>': growBuf.addStr("&gt;"); break;
4013  case '&': // possibility to have a special symbol
4014  q = p;
4015  cnt = 2; // we have to count & and ; as well
4016  while ((*q >= 'a' && *q <= 'z') || (*q >= 'A' && *q <= 'Z') || (*q >= '0' && *q <= '9'))
4017  {
4018  cnt++;
4019  q++;
4020  }
4021  if (*q == ';')
4022  {
4023  --p; // we need & as well
4024  DocSymbol::SymType res = HtmlEntityMapper::instance()->name2sym(QCString((char *)p).left(cnt));
4025  if (res == DocSymbol::Sym_Unknown)
4026  {
4027  p++;
4028  growBuf.addStr("&amp;");
4029  }
4030  else
4031  {
4032  growBuf.addStr(HtmlEntityMapper::instance()->docbook(res));
4033  q++;
4034  p = q;
4035  }
4036  }
4037  else
4038  {
4039  growBuf.addStr("&amp;");
4040  }
4041  break;
4042  case '\'': growBuf.addStr("&apos;"); break;
4043  case '"': growBuf.addStr("&quot;"); break;
4044  case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
4045  case 11: case 12: case 14: case 15: case 16: case 17: case 18:
4046  case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
4047  case 27: case 28: case 29: case 30: case 31:
4048  growBuf.addStr("&#x24");
4049  growBuf.addChar(hex[static_cast<uchar>(c)>>4]);
4050  growBuf.addChar(hex[static_cast<uchar>(c)&0xF]);
4051  growBuf.addChar(';');
4052  break;
4053  default:
4054  growBuf.addChar(c);
4055  break;
4056  }
4057  }
4058  growBuf.addChar(0);
4059  return growBuf.get();
4060 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), GrowBuf::get(), hex, HtmlEntityMapper::instance(), QCString::isEmpty(), HtmlEntityMapper::name2sym() , 以及 DocSymbol::Sym_Unknown.

被这些函数引用 addIndexTerm(), DocbookGenerator::docify(), DocbookDocVisitor::filter(), DocbookGenerator::startDescTable(), DocbookGenerator::startIndexSection(), DocbookGenerator::startMemberDoc(), DocbookGenerator::startMemberDocSimple(), DocbookDocVisitor::visitPre(), DocbookDocVisitor::visitPreStart(), writeDocbookString(), DocbookGenerator::writePageLink() , 以及 DefinitionImpl::writeToc().

◆ convertToHtml()

QCString convertToHtml ( const QCString s,
bool  keepEntities 
)

Converts a string to a HTML-encoded string

在文件 util.cpp4063 行定义.

4064 {
4065  if (s.isEmpty()) return s;
4066  GrowBuf growBuf;
4067  const char *p=s.data();
4068  char c;
4069  while ((c=*p++))
4070  {
4071  switch (c)
4072  {
4073  case '<': growBuf.addStr("&lt;"); break;
4074  case '>': growBuf.addStr("&gt;"); break;
4075  case '&': if (keepEntities)
4076  {
4077  const char *e=p;
4078  char ce;
4079  while ((ce=*e++))
4080  {
4081  if (ce==';' || (!(isId(ce) || ce=='#'))) break;
4082  }
4083  if (ce==';') // found end of an entity
4084  {
4085  // copy entry verbatim
4086  growBuf.addChar(c);
4087  while (p<e) growBuf.addChar(*p++);
4088  }
4089  else
4090  {
4091  growBuf.addStr("&amp;");
4092  }
4093  }
4094  else
4095  {
4096  growBuf.addStr("&amp;");
4097  }
4098  break;
4099  case '\'': growBuf.addStr("&#39;"); break;
4100  case '"': growBuf.addStr("&quot;"); break;
4101  default:
4102  {
4103  uchar uc = static_cast<uchar>(c);
4104  if (uc<32 && !isspace(c))
4105  {
4106  growBuf.addStr("&#x24");
4107  growBuf.addChar(hex[uc>>4]);
4108  growBuf.addChar(hex[uc&0xF]);
4109  growBuf.addChar(';');
4110  }
4111  else
4112  {
4113  growBuf.addChar(c);
4114  }
4115  }
4116  break;
4117  }
4118  }
4119  growBuf.addChar(0);
4120  return growBuf.get();
4121 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), GrowBuf::get(), hex, QCString::isEmpty(), isId() , 以及 reg::isspace().

被这些函数引用 HtmlCodeGenerator::_writeCodeLink(), HtmlHelp::addContentsItem(), FilterEscape::apply(), HtmlEscaper::escape(), FTVHelp::generateLink(), ClassContext::Private::inheritanceDiagram(), DefinitionImpl::navigationPathAsString(), HtmlGenerator::startFile(), HtmlDocVisitor::startLink(), substituteHtmlKeywords(), HtmlDocVisitor::visit(), HtmlDocVisitor::visitPre(), HtmlHelpIndex::writeFields(), HtmlGenerator::writeInheritedSectionTitle(), TextGeneratorHtml::writeLink(), writeMapArea(), HtmlGenerator::writePageFooter(), NamespaceDefImpl::writeQuickMemberLinks(), GroupDefImpl::writeQuickMemberLinks(), FileDefImpl::writeQuickMemberLinks(), ClassDefImpl::writeQuickMemberLinks(), HtmlGenerator::writeSearchPage(), TextGeneratorHtml::writeString() , 以及 DefinitionImpl::writeToc().

◆ convertToId()

QCString convertToId ( const QCString s)

Converts a string to a HTML id string

在文件 util.cpp3908 行定义.

3909 {
3910  if (s.isEmpty()) return s;
3911  GrowBuf growBuf;
3912  const char *p=s.data();
3913  char c;
3914  bool first=TRUE;
3915  while ((c=*p++))
3916  {
3917  char encChar[4];
3918  if ((c>='0' && c<='9') || (c>='a' && c<='z') || (c>='A' && c<='Z') || c=='-' || c==':' || c=='.')
3919  { // any permissive character except _
3920  if (first && c>='0' && c<='9') growBuf.addChar('a'); // don't start with a digit
3921  growBuf.addChar(c);
3922  }
3923  else
3924  {
3925  encChar[0]='_';
3926  encChar[1]=hex[((unsigned char)c)>>4];
3927  encChar[2]=hex[((unsigned char)c)&0xF];
3928  encChar[3]=0;
3929  growBuf.addStr(encChar);
3930  }
3931  first=FALSE;
3932  }
3933  growBuf.addChar(0);
3934  return growBuf.get();
3935 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), FALSE, GrowBuf::get(), hex, QCString::isEmpty() , 以及 TRUE.

被这些函数引用 HtmlGenerator::endClassDiagram(), ClassContext::Private::inheritanceDiagram(), renderMemberIndicesAsJs(), writeMemberList(), writeQuickMemberIndex(), ClassDefImpl::writeSummaryLinks() , 以及 VhdlDocGen::writeVHDLDeclarations().

◆ convertToJSString()

QCString convertToJSString ( const QCString s)

在文件 util.cpp4123 行定义.

4124 {
4125  if (s.isEmpty()) return s;
4126  GrowBuf growBuf;
4127  const char *p=s.data();
4128  char c;
4129  while ((c=*p++))
4130  {
4131  switch (c)
4132  {
4133  case '"': growBuf.addStr("\\\""); break;
4134  case '\\': growBuf.addStr("\\\\"); break;
4135  default: growBuf.addChar(c); break;
4136  }
4137  }
4138  growBuf.addChar(0);
4139  return convertCharEntitiesToUTF8(growBuf.get());
4140 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), convertCharEntitiesToUTF8(), QCString::data(), GrowBuf::get() , 以及 QCString::isEmpty().

被这些函数引用 generateJSLink(), generateJSNavTree(), renderMemberIndicesAsJs() , 以及 renderQuickLinksAsJs().

◆ convertToLaTeX()

QCString convertToLaTeX ( const QCString s,
bool  insideTabbing = FALSE,
bool  keepSpaces = FALSE 
)

在文件 util.cpp4161 行定义.

4162 {
4163  TextStream t;
4164  filterLatexString(t,s,insideTabbing,false,false,false,keepSpaces);
4165  return t.str();
4166 }

引用了 filterLatexString() , 以及 TextStream::str().

被这些函数引用 LatexGenerator::endIndexSection(), LatexEscaper::escape(), LatexGenerator::startIndexSection(), substituteLatexKeywords() , 以及 TextGeneratorLatex::writeString().

◆ convertToPSString()

QCString convertToPSString ( const QCString s)

在文件 util.cpp4142 行定义.

4143 {
4144  if (s.isEmpty()) return s;
4145  GrowBuf growBuf;
4146  const char *p=s.data();
4147  char c;
4148  while ((c=*p++))
4149  {
4150  switch (c)
4151  {
4152  case '(': growBuf.addStr("\\("); break;
4153  case ')': growBuf.addStr("\\)"); break;
4154  default: growBuf.addChar(c); break;
4155  }
4156  }
4157  growBuf.addChar(0);
4158  return growBuf.get();
4159 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), GrowBuf::get() , 以及 QCString::isEmpty().

被这些函数引用 ClassDiagram::writeFigure() , 以及 writeVectorBox().

◆ convertToXML()

QCString convertToXML ( const QCString s,
bool  keepEntities 
)

Converts a string to an XML-encoded string

在文件 util.cpp3948 行定义.

3949 {
3950  if (s.isEmpty()) return s;
3951  GrowBuf growBuf;
3952  const char *p=s.data();
3953  char c;
3954  while ((c=*p++))
3955  {
3956  switch (c)
3957  {
3958  case '<': growBuf.addStr("&lt;"); break;
3959  case '>': growBuf.addStr("&gt;"); break;
3960  case '&': if (keepEntities)
3961  {
3962  const char *e=p;
3963  char ce;
3964  while ((ce=*e++))
3965  {
3966  if (ce==';' || (!(isId(ce) || ce=='#'))) break;
3967  }
3968  if (ce==';') // found end of an entity
3969  {
3970  // copy entry verbatim
3971  growBuf.addChar(c);
3972  while (p<e) growBuf.addChar(*p++);
3973  }
3974  else
3975  {
3976  growBuf.addStr("&amp;");
3977  }
3978  }
3979  else
3980  {
3981  growBuf.addStr("&amp;");
3982  }
3983  break;
3984  case '\'': growBuf.addStr("&apos;"); break;
3985  case '"': growBuf.addStr("&quot;"); break;
3986  case 1: case 2: case 3: case 4: case 5: case 6: case 7: case 8:
3987  case 11: case 12: case 13: case 14: case 15: case 16: case 17: case 18:
3988  case 19: case 20: case 21: case 22: case 23: case 24: case 25: case 26:
3989  case 27: case 28: case 29: case 30: case 31:
3990  break; // skip invalid XML characters (see http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char)
3991  default: growBuf.addChar(c); break;
3992  }
3993  }
3994  growBuf.addChar(0);
3995  return growBuf.get();
3996 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), QCString::data(), GrowBuf::get(), QCString::isEmpty() , 以及 isId().

被这些函数引用 DocSets::addContentsItem(), EclipseHelp::addContentsItem(), SymbolContext::Private::createScope(), XmlDocVisitor::filter(), generateXMLForClass(), generateXMLForConcept(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForMember(), generateXMLForNamespace(), generateXMLForPage(), generateXMLSection(), DotDirDeps::getImgAltText(), htmlAttribsToString(), EclipseHelp::initialize(), QhpXmlWriter::openCloseContent(), QhpXmlWriter::openPureHelper(), XmlDocVisitor::visitPre(), visitPreStart(), SearchIndexExternal::write(), NamespaceDefImpl::writeClassesToTagFile(), FileDefImpl::writeClassesToTagFile(), NamespaceDefImpl::writeConceptsToTagFile(), DefinitionImpl::writeDocAnchorsToTagFile(), DotNode::writeDocbook(), DotGraph::writeGraphHeader(), DotGroupCollaboration::writeGraphHeader(), writeInnerClasses(), writeInnerDirs(), writeInnerFiles(), writeInnerGroups(), writeInnerNamespaces(), writeInnerPages(), writeJavaScriptSearchIndex(), writeListOfAllMembers(), writeMapArea(), writeMemberReference(), NamespaceDefImpl::writeTagFile(), PageDefImpl::writeTagFile(), ConceptDefImpl::writeTagFile(), DirDefImpl::writeTagFile(), GroupDefImpl::writeTagFile(), FileDefImpl::writeTagFile(), VhdlDocGen::writeTagFile(), ClassDefImpl::writeTagFile(), MemberDefImpl::writeTagFile(), writeTemplateArgumentList(), DocSets::writeToken(), DotNode::writeXML(), writeXMLLink() , 以及 writeXMLString().

◆ copyFile()

bool copyFile ( const QCString src,
const QCString dest 
)

Copies the contents of file with name src to the newly created file with name dest.

Returns TRUE if successful.

在文件 util.cpp6439 行定义.

6440 {
6441  if (!Dir().copy(src.str(),dest.str()))
6442  {
6443  err("could not copy file %s to %s\n",qPrint(src),qPrint(dest));
6444  return false;
6445  }
6446  return true;
6447 }

引用了 err(), qPrint() , 以及 QCString::str().

被这些函数引用 copyExtraFiles(), copyLatexStyleSheet(), copyLogo(), copyStyleSheet(), DocParser::findAndCopyImage(), FormulaManager::generateImages(), CitationManager::generatePage(), substituteLatexKeywords(), DocbookDocVisitor::visitPost() , 以及 XmlDocVisitor::visitPre().

◆ correctId()

QCString correctId ( const QCString s)

Some strings have been corrected but the requirement regarding the fact that an id cannot have a digit at the first position. To overcome problems with double labels we always place an "a" in front

在文件 util.cpp3941 行定义.

3942 {
3943  if (s.isEmpty()) return s;
3944  return "a" + s;
3945 }

引用了 QCString::isEmpty().

被这些函数引用 DotGraph::generateCode() , 以及 DotFilePatcher::run().

◆ correctURL()

QCString correctURL ( const QCString url,
const QCString relPath 
)

Corrects URL url according to the relative path relPath.

Returns the corrected URL. For absolute URLs no correction will be done.

在文件 util.cpp6573 行定义.

6574 {
6575  QCString result = url;
6576  if (!relPath.isEmpty() && !isURL(url))
6577  {
6578  result.prepend(relPath);
6579  }
6580  return result;
6581 }

引用了 QCString::isEmpty(), isURL() , 以及 QCString::prepend().

被这些函数引用 startQuickIndexItem(), HtmlDocVisitor::visitPre(), XmlDocVisitor::visitPre() , 以及 writeIndexHierarchyEntries().

◆ countAliasArguments()

int countAliasArguments ( const QCString argList)

在文件 util.cpp6001 行定义.

6002 {
6003  int count=1;
6004  int l = argList.length();
6005  int i;
6006  for (i=0;i<l;i++)
6007  {
6008  char c = argList.at(i);
6009  if (c==',' && (i==0 || argList.at(i-1)!='\\')) count++;
6010  else if (c=='@' || c=='\\')
6011  {
6012  // check if this is the start of another aliased command (see bug704172)
6013  i+=findEndOfCommand(argList.data()+i+1);
6014  }
6015  }
6016  //printf("countAliasArguments=%d\n",count);
6017  return count;
6018 }

引用了 QCString::at(), QCString::data(), findEndOfCommand() , 以及 QCString::length().

被这些函数引用 expandAliasRec().

◆ createSubDirs()

void createSubDirs ( const Dir d)

在文件 util.cpp3677 行定义.

3678 {
3679  if (Config_getBool(CREATE_SUBDIRS))
3680  {
3681  // create 4096 subdirectories
3682  int l1,l2;
3683  for (l1=0;l1<16;l1++)
3684  {
3685  QCString subdir;
3686  subdir.sprintf("d%x",l1);
3687  if (!d.exists(subdir.str()) && !d.mkdir(subdir.str()))
3688  {
3689  term("Failed to create output directory '%s'\n",qPrint(subdir));
3690  }
3691  for (l2=0;l2<256;l2++)
3692  {
3693  QCString subsubdir;
3694  subsubdir.sprintf("d%x/d%02x",l1,l2);
3695  if (!d.exists(subsubdir.str()) && !d.mkdir(subsubdir.str()))
3696  {
3697  term("Failed to create output directory '%s'\n",qPrint(subsubdir));
3698  }
3699  }
3700  }
3701  }
3702 }

引用了 Config_getBool, Dir::exists(), Dir::mkdir(), qPrint(), QCString::sprintf(), QCString::str() , 以及 term().

被这些函数引用 generateOutputViaTemplate(), generateXML(), RTFGenerator::init(), ManGenerator::init(), HtmlGenerator::init(), LatexGenerator::init(), DocbookGenerator::init(), NamespaceDefImpl::writeQuickMemberLinks(), GroupDefImpl::writeQuickMemberLinks(), FileDefImpl::writeQuickMemberLinks() , 以及 ClassDefImpl::writeQuickMemberLinks().

◆ dateToString()

QCString dateToString ( bool  )

在文件 util.cpp1470 行定义.

1471 {
1472  auto current = getCurrentDateTime();
1473  return theTranslator->trDateTime(current.tm_year + 1900,
1474  current.tm_mon + 1,
1475  current.tm_mday,
1476  (current.tm_wday+6)%7+1, // map: Sun=0..Sat=6 to Mon=1..Sun=7
1477  current.tm_hour,
1478  current.tm_min,
1479  current.tm_sec,
1480  includeTime);
1481 }

引用了 getCurrentDateTime(), theTranslator , 以及 Translator::trDateTime().

被这些函数引用 DoxygenContext::Private::date(), RTFGenerator::endIndexSection(), ManGenerator::endTitleHead(), substituteHtmlKeywords(), substituteKeywords(), substituteLatexKeywords() , 以及 HtmlGenerator::writeLogoAsString().

◆ escapeCharsInString()

QCString escapeCharsInString ( const QCString name,
bool  allowDots,
bool  allowUnderscore = FALSE 
)

在文件 util.cpp3442 行定义.

3443 {
3444  if (name.isEmpty()) return name;
3445  bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
3446  bool allowUnicodeNames = Config_getBool(ALLOW_UNICODE_NAMES);
3447  GrowBuf growBuf;
3448  signed char c;
3449  const char *p=name.data();
3450  while ((c=*p++)!=0)
3451  {
3452  switch(c)
3453  {
3454  case '_': if (allowUnderscore) growBuf.addChar('_'); else growBuf.addStr("__"); break;
3455  case '-': growBuf.addChar('-'); break;
3456  case ':': growBuf.addStr("_1"); break;
3457  case '/': growBuf.addStr("_2"); break;
3458  case '<': growBuf.addStr("_3"); break;
3459  case '>': growBuf.addStr("_4"); break;
3460  case '*': growBuf.addStr("_5"); break;
3461  case '&': growBuf.addStr("_6"); break;
3462  case '|': growBuf.addStr("_7"); break;
3463  case '.': if (allowDots) growBuf.addChar('.'); else growBuf.addStr("_8"); break;
3464  case '!': growBuf.addStr("_9"); break;
3465  case ',': growBuf.addStr("_00"); break;
3466  case ' ': growBuf.addStr("_01"); break;
3467  case '{': growBuf.addStr("_02"); break;
3468  case '}': growBuf.addStr("_03"); break;
3469  case '?': growBuf.addStr("_04"); break;
3470  case '^': growBuf.addStr("_05"); break;
3471  case '%': growBuf.addStr("_06"); break;
3472  case '(': growBuf.addStr("_07"); break;
3473  case ')': growBuf.addStr("_08"); break;
3474  case '+': growBuf.addStr("_09"); break;
3475  case '=': growBuf.addStr("_0a"); break;
3476  case '$': growBuf.addStr("_0b"); break;
3477  case '\\': growBuf.addStr("_0c"); break;
3478  case '@': growBuf.addStr("_0d"); break;
3479  case ']': growBuf.addStr("_0e"); break;
3480  case '[': growBuf.addStr("_0f"); break;
3481  case '#': growBuf.addStr("_0g"); break;
3482  default:
3483  if (c<0)
3484  {
3485  bool doEscape = true;
3486  if (allowUnicodeNames)
3487  {
3488  int charLen = getUTF8CharNumBytes(c);
3489  if (charLen>0)
3490  {
3491  growBuf.addStr(p-1,charLen);
3492  p+=charLen;
3493  doEscape = false;
3494  }
3495  }
3496  if (doEscape) // not a valid unicode char or escaping needed
3497  {
3498  char ids[5];
3499  unsigned char id = (unsigned char)c;
3500  ids[0]='_';
3501  ids[1]='x';
3502  ids[2]=hex[id>>4];
3503  ids[3]=hex[id&0xF];
3504  ids[4]=0;
3505  growBuf.addStr(ids);
3506  }
3507  }
3508  else if (caseSenseNames || !isupper(c))
3509  {
3510  growBuf.addChar(c);
3511  }
3512  else
3513  {
3514  growBuf.addChar('_');
3515  growBuf.addChar((char)tolower(c));
3516  }
3517  break;
3518  }
3519  }
3520  growBuf.addChar(0);
3521  return growBuf.get();
3522 }

引用了 GrowBuf::addChar(), GrowBuf::addStr(), Config_getBool, QCString::data(), GrowBuf::get(), getUTF8CharNumBytes(), hex , 以及 QCString::isEmpty().

被这些函数引用 convertNameToFile(), DotGroupCollaboration::getMapLabel(), DotGfxHierarchyTable::getMapLabel(), DotInclDepGraph::getMapLabel(), DotClassGraph::getMapLabel(), DotDirDeps::getMapLabel() , 以及 PageDefImpl::writeDocumentation().

◆ expandAlias()

std::string expandAlias ( const std::string &  aliasName,
const std::string &  aliasValue 
)

在文件 util.cpp6060 行定义.

6061 {
6062  QCString result;
6063  StringUnorderedSet aliasesProcessed;
6064  // avoid expanding this command recursively
6065  aliasesProcessed.insert(aliasName);
6066  // expand embedded commands
6067  //printf("Expanding: '%s'->'%s'\n",qPrint(aliasName),qPrint(aliasValue));
6068  result = expandAliasRec(aliasesProcessed,aliasValue.c_str());
6069  //printf("Expanding result: '%s'->'%s'\n",qPrint(aliasName),qPrint(result));
6070  return result.str();
6071 }

引用了 expandAliasRec(), QCString::insert() , 以及 QCString::str().

被这些函数引用 expandAliases().

◆ externalLinkTarget()

QCString externalLinkTarget ( const bool  parent = false)

在文件 util.cpp6323 行定义.

6324 {
6325  static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
6326  if (extLinksInWindow)
6327  return "target=\"_blank\" ";
6328  else if (parent)
6329  return "target=\"_parent\" ";
6330  else
6331  return "";
6332 }

引用了 Config_getBool.

被这些函数引用 HtmlCodeGenerator::_writeCodeLink(), FTVHelp::generateLink(), Markdown::processLink(), replaceRef(), HtmlGenerator::startIndexItem(), HtmlDocVisitor::startLink(), HtmlGenerator::writeInheritedSectionTitle(), TextGeneratorHtml::writeLink(), writeMapArea() , 以及 HtmlGenerator::writeObjectLink().

◆ externalRef()

QCString externalRef ( const QCString relPath,
const QCString ref,
bool  href 
)

在文件 util.cpp6334 行定义.

6335 {
6336  QCString result;
6337  if (!ref.isEmpty())
6338  {
6339  auto it = Doxygen::tagDestinationMap.find(ref.str());
6340  if (it!=Doxygen::tagDestinationMap.end())
6341  {
6342  result = it->second;
6343  int l = result.length();
6344  if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
6345  { // relative path -> prepend relPath.
6346  result.prepend(relPath);
6347  l+=relPath.length();
6348  }
6349  if (l>0 && result.at(l-1)!='/') result+='/';
6350  if (!href) result.append("\" ");
6351  }
6352  }
6353  else
6354  {
6355  result = relPath;
6356  }
6357  return result;
6358 }

引用了 QCString::append(), QCString::at(), end(), QCString::isEmpty(), QCString::length(), QCString::prepend(), QCString::str() , 以及 Doxygen::tagDestinationMap.

被这些函数引用 HtmlCodeGenerator::_writeCodeLink(), convertMapFile(), generateJSLink(), FTVHelp::generateLink(), SymbolContext::Private::relPath(), replaceRef(), HtmlGenerator::startIndexItem(), HtmlDocVisitor::startLink(), HtmlGenerator::writeInheritedSectionTitle(), writeJavaScriptSearchIndex(), TextGeneratorHtml::writeLink(), writeMapArea(), HtmlGenerator::writeObjectLink() , 以及 HtmlCodeGenerator::writeTooltip().

◆ extractAliasArgs()

QCString extractAliasArgs ( const QCString args,
size_t  pos 
)

在文件 util.cpp6020 行定义.

6021 {
6022  size_t i;
6023  int bc=0;
6024  char prevChar=0;
6025  if (args.at(pos)=='{') // alias has argument
6026  {
6027  for (i=pos;i<args.length();i++)
6028  {
6029  if (prevChar!='\\')
6030  {
6031  if (args.at(i)=='{') bc++;
6032  if (args.at(i)=='}') bc--;
6033  prevChar=args.at(i);
6034  }
6035  else
6036  {
6037  prevChar=0;
6038  }
6039 
6040  if (bc==0)
6041  {
6042  //printf("extractAliasArgs('%s')->'%s'\n",qPrint(args),qPrint(args.mid(pos+1,i-pos-1)));
6043  return args.mid(pos+1,i-pos-1);
6044  }
6045  }
6046  }
6047  return "";
6048 }

引用了 QCString::at(), QCString::length() , 以及 QCString::mid().

被这些函数引用 expandAliasRec() , 以及 findEndOfCommand().

◆ extractBlock()

QCString extractBlock ( const QCString text,
const QCString marker 
)

Returns the section of text, in between a pair of markers.

Full lines are returned, excluding the lines on which the markers appear.

参见
routine lineBlock

在文件 util.cpp6453 行定义.

6454 {
6455  QCString result;
6456  int p=0,i;
6457  bool found=FALSE;
6458 
6459  // find the character positions of the markers
6460  int m1 = text.find(marker);
6461  if (m1==-1) return result;
6462  int m2 = text.find(marker,m1+marker.length());
6463  if (m2==-1) return result;
6464 
6465  // find start and end line positions for the markers
6466  int l1=-1,l2=-1;
6467  while (!found && (i=text.find('\n',p))!=-1)
6468  {
6469  found = (p<=m1 && m1<i); // found the line with the start marker
6470  p=i+1;
6471  }
6472  l1=p;
6473  int lp=i;
6474  if (found)
6475  {
6476  while ((i=text.find('\n',p))!=-1)
6477  {
6478  if (p<=m2 && m2<i) // found the line with the end marker
6479  {
6480  l2=p;
6481  break;
6482  }
6483  p=i+1;
6484  lp=i;
6485  }
6486  }
6487  if (l2==-1) // marker at last line without newline (see bug706874)
6488  {
6489  l2=lp;
6490  }
6491  //printf("text=[%s]\n",qPrint(text.mid(l1,l2-l1)));
6492  return l2>l1 ? text.mid(l1,l2-l1) : QCString();
6493 }

引用了 FALSE, QCString::find(), QCString::length() , 以及 QCString::mid().

被这些函数引用 DocPara::handleInclude(), HtmlDocVisitor::visit(), DocbookDocVisitor::visit(), LatexDocVisitor::visit(), ManDocVisitor::visit(), RTFDocVisitor::visit() , 以及 XmlDocVisitor::visit().

◆ extractClassNameFromType()

int extractClassNameFromType ( const QCString type,
int &  pos,
QCString name,
QCString templSpec,
SrcLangExt  lang 
)

Extracts a (sub-)string from type starting at pos that could form a class. The index of the match is returned and the found class name and a template argument list templSpec. If -1 is returned there are no more matches.

在文件 util.cpp4338 行定义.

4339 {
4340  static reg::Ex re_norm(R"(\a[\w:]*)");
4341  static reg::Ex re_fortran(R"(\a[\w:()=]*)");
4342  static const reg::Ex *re = &re_norm;
4343 
4344  name.resize(0);
4345  templSpec.resize(0);
4346  if (type.isEmpty()) return -1;
4347  int typeLen=(int)type.length();
4348  if (typeLen>0)
4349  {
4350  if (lang == SrcLangExt_Fortran)
4351  {
4352  if (type[pos]==',') return -1;
4353  if (QCString(type).left(4).lower()!="type")
4354  {
4355  re = &re_fortran;
4356  }
4357  }
4358  std::string s = type.str();
4359  reg::Iterator it(s,*re,(int)pos);
4361 
4362  if (it!=end)
4363  {
4364  const auto &match = *it;
4365  int i = (int)match.position();
4366  int l = (int)match.length();
4367  int ts = i+l;
4368  int te = ts;
4369  int tl = 0;
4370 
4371  while (ts<typeLen && type[ts]==' ') ts++,tl++; // skip any whitespace
4372  if (ts<typeLen && type[ts]=='<') // assume template instance
4373  {
4374  // locate end of template
4375  te=ts+1;
4376  int brCount=1;
4377  while (te<typeLen && brCount!=0)
4378  {
4379  if (type[te]=='<')
4380  {
4381  if (te<typeLen-1 && type[te+1]=='<') te++; else brCount++;
4382  }
4383  if (type[te]=='>')
4384  {
4385  if (te<typeLen-1 && type[te+1]=='>') te++; else brCount--;
4386  }
4387  te++;
4388  }
4389  }
4390  name = match.str();
4391  if (te>ts)
4392  {
4393  templSpec = QCString(type).mid(ts,te-ts);
4394  tl+=te-ts;
4395  pos=i+l+tl;
4396  }
4397  else // no template part
4398  {
4399  pos=i+l;
4400  }
4401  //printf("extractClassNameFromType([in] type=%s,[out] pos=%d,[out] name=%s,[out] templ=%s)=TRUE i=%d\n",
4402  // type,pos,qPrint(name),qPrint(templSpec),i);
4403  return i;
4404  }
4405  }
4406  pos = typeLen;
4407  //printf("extractClassNameFromType([in] type=%s,[out] pos=%d,[out] name=%s,[out] templ=%s)=FALSE\n",
4408  // type,pos,qPrint(name),qPrint(templSpec));
4409  return -1;
4410 }

引用了 end(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::lower(), reg::match(), QCString::mid(), QCString::resize(), SrcLangExt_Fortran , 以及 QCString::str().

被这些函数引用 extractCanonicalType() , 以及 findUsedClassesForClass().

◆ extractDirection()

QCString extractDirection ( QCString docs)

Strip the direction part from docs and return it as a string in canonical form The input docs string can start with e.g.

"[in]", "[in, out]", "[inout]", "[out,in]"...

返回
either "[in,out]", "[in]", or "[out]" or the empty string.

在文件 util.cpp6801 行定义.

6802 {
6803  std::string s = docs.str();
6804  static const reg::Ex re(R"(\[([ inout,]+)\])");
6805  reg::Iterator it(s,re);
6807  if (it!=end)
6808  {
6809  const auto &match = *it;
6810  size_t p = match.position();
6811  size_t l = match.length();
6812  if (p==0 && l>2)
6813  {
6814  // make dir the part inside [...] without separators
6815  std::string dir = match[1].str();
6816  // strip , and ' ' from dir
6817  dir.erase(std::remove_if(dir.begin(),dir.end(),
6818  [](const char c) { return c==' ' || c==','; }
6819  ),dir.end());
6820  size_t inIndex, outIndex;
6821  unsigned char ioMask=0;
6822  if (( inIndex=dir.find( "in"))!=std::string::npos) dir.erase( inIndex,2),ioMask|=(1<<0);
6823  if ((outIndex=dir.find("out"))!=std::string::npos) dir.erase(outIndex,3),ioMask|=(1<<1);
6824  if (dir.empty() && ioMask!=0) // only in and/or out attributes found
6825  {
6826  docs = s.substr(l); // strip attributes
6827  if (ioMask==((1<<0)|(1<<1))) return "[in,out]";
6828  else if (ioMask==(1<<0)) return "[in]";
6829  else if (ioMask==(1<<1)) return "[out]";
6830  }
6831  }
6832  }
6833  return "";
6834 }

引用了 end(), reg::match() , 以及 QCString::str().

被这些函数引用 MemberContext::Private::createParamDocs() , 以及 MemberDefImpl::writeDocumentation().

◆ extractNamespaceName()

void extractNamespaceName ( const QCString scopeName,
QCString className,
QCString namespaceName,
bool  allowEmptyClass 
)

Input is a scopeName, output is the scopename split into a namespace part (as large as possible) and a classname part.

在文件 util.cpp3733 行定义.

3736 {
3737  int i,p;
3738  QCString clName=scopeName;
3739  NamespaceDef *nd = 0;
3740  if (!clName.isEmpty() && (nd=getResolvedNamespace(clName)) && getClass(clName)==0)
3741  { // the whole name is a namespace (and not a class)
3742  namespaceName=nd->name();
3743  className.resize(0);
3744  goto done;
3745  }
3746  p=clName.length()-2;
3747  while (p>=0 && (i=clName.findRev("::",p))!=-1)
3748  // see if the first part is a namespace (and not a class)
3749  {
3750  //printf("Trying %s\n",qPrint(clName.left(i)));
3751  if (i>0 && (nd=getResolvedNamespace(clName.left(i))) && getClass(clName.left(i))==0)
3752  {
3753  //printf("found!\n");
3754  namespaceName=nd->name();
3755  className=clName.right(clName.length()-i-2);
3756  goto done;
3757  }
3758  p=i-2; // try a smaller piece of the scope
3759  }
3760  //printf("not found!\n");
3761 
3762  // not found, so we just have to guess.
3763  className=scopeName;
3764  namespaceName.resize(0);
3765 
3766 done:
3767  if (className.isEmpty() && !namespaceName.isEmpty() && !allowEmptyClass)
3768  {
3769  // class and namespace with the same name, correct to return the class.
3770  className=namespaceName;
3771  namespaceName.resize(0);
3772  }
3773  //printf("extractNamespace '%s' => '%s|%s'\n",qPrint(scopeName),
3774  // qPrint(className),qPrint(namespaceName));
3775  if (/*className.right(2)=="-g" ||*/ className.right(2)=="-p")
3776  {
3777  className = className.left(className.length()-2);
3778  }
3779  return;
3780 }

引用了 QCString::findRev(), getClass(), getResolvedNamespace(), QCString::isEmpty(), QCString::left(), QCString::length(), Definition::name(), QCString::resize() , 以及 QCString::right().

被这些函数引用 addClassToContext(), addConceptToContext(), findMember() , 以及 writeAlphabeticalClassList().

◆ fileToString()

QCString fileToString ( const QCString name,
bool  filter,
bool  isSourceCode 
)

reads a file with name name and returns it as a string. If filter is TRUE the file will be filtered by any user specified input filter. If name is "-" the string will be read from standard input.

在文件 util.cpp1394 行定义.

1395 {
1396  if (name.isEmpty()) return QCString();
1397  bool fileOpened=false;
1398  if (name[0]=='-' && name[1]==0) // read from stdin
1399  {
1400  fileOpened=true;
1401  std::string contents;
1402  std::string line;
1403  while (getline(std::cin,line))
1404  {
1405  contents+=line+'\n';
1406  }
1407  return QCString(contents);
1408  }
1409  else // read from file
1410  {
1411  FileInfo fi(name.str());
1412  if (!fi.exists() || !fi.isFile())
1413  {
1414  err("file '%s' not found\n",qPrint(name));
1415  return "";
1416  }
1417  BufStr buf((uint)fi.size());
1418  fileOpened=readInputFile(name,buf,filter,isSourceCode);
1419  if (fileOpened)
1420  {
1421  int s = buf.size();
1422  if (s>1 && buf.at(s-2)!='\n')
1423  {
1424  buf.at(s-1)='\n';
1425  buf.addChar(0);
1426  }
1427  return buf.data();
1428  }
1429  }
1430  if (!fileOpened)
1431  {
1432  err("cannot open file '%s' for reading\n",qPrint(name));
1433  }
1434  return "";
1435 }

引用了 BufStr::addChar(), BufStr::at(), BufStr::data(), err(), FileInfo::exists(), QCString::isEmpty(), FileInfo::isFile(), qPrint(), readInputFile(), FileInfo::size(), BufStr::size() , 以及 QCString::str().

被这些函数引用 DoxygenContext::Private::createMathJaxCodeFile(), FormulaManager::generateImages(), getConvertLatexMacro(), HtmlGenerator::init(), LatexGenerator::init(), LayoutDocManager::parse(), parseCode(), FileDefImpl::parseSource(), parseTagFile(), DocParser::readTextFileByName(), runPlantumlContent(), FileDefImpl::writeSourceBody(), HtmlGenerator::writeStyleInfo() , 以及 writeXMLCodeBlock().

◆ fileVisibleInIndex()

bool fileVisibleInIndex ( const FileDef fd,
bool &  genSourceFile 
)

在文件 util.cpp6712 行定义.

6713 {
6714  static bool allExternals = Config_getBool(ALLEXTERNALS);
6715  bool isDocFile = fd->isDocumentationFile();
6716  genSourceFile = !isDocFile && fd->generateSourceFile();
6717  return ( ((allExternals && fd->isLinkable()) ||
6718  fd->isLinkableInProject()
6719  ) &&
6720  !isDocFile
6721  );
6722 }

引用了 Config_getBool, FileDef::generateSourceFile(), FileDef::isDocumentationFile(), FileDef::isLinkable() , 以及 FileDef::isLinkableInProject().

被这些函数引用 countFiles(), dirHasVisibleChildren(), generateJSTree(), writeDirHierarchy() , 以及 writeDirTreeNode().

◆ filterLatexString()

void filterLatexString ( TextStream t,
const QCString str,
bool  insideTabbing,
bool  insidePre,
bool  insideItem,
bool  insideTable,
bool  keepSpaces 
)

在文件 util.cpp4934 行定义.

4936 {
4937  if (str.isEmpty()) return;
4938  //if (strlen(str)<2) stackTrace();
4939  const unsigned char *p=(const unsigned char *)str.data();
4940  const unsigned char *q;
4941  int cnt;
4942  unsigned char c;
4943  unsigned char pc='\0';
4944  while (*p)
4945  {
4946  c=*p++;
4947 
4948  if (insidePre)
4949  {
4950  switch(c)
4951  {
4952  case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
4953  // the LaTeX command \ucr has been defined in doxygen.sty
4954  if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd)
4955  {
4956  t << "{\\ucr}";
4957  p += 2;
4958  }
4959  else
4960  t << (char)c;
4961  break;
4962  case '\\': t << "\\(\\backslash\\)"; break;
4963  case '{': t << "\\{"; break;
4964  case '}': t << "\\}"; break;
4965  case '_': t << "\\_"; break;
4966  case '&': t << "\\&"; break;
4967  case '%': t << "\\%"; break;
4968  case '#': t << "\\#"; break;
4969  case '$': t << "\\$"; break;
4970  case '"': t << "\"{}"; break;
4971  case '-': t << "-\\/"; break;
4972  case '^': insideTable ? t << "\\string^" : t << (char)c; break;
4973  case '~': t << "\\string~"; break;
4974  case ' ': if (keepSpaces) t << "~"; else t << ' ';
4975  break;
4976  default:
4977  if (c<32) t << ' '; // non printable control character
4978  else t << (char)c;
4979  break;
4980  }
4981  }
4982  else
4983  {
4984  switch(c)
4985  {
4986  case 0xef: // handle U+FFFD i.e. "Replacement character" caused by octal: 357 277 275 / hexadecimal 0xef 0xbf 0xbd
4987  // the LaTeX command \ucr has been defined in doxygen.sty
4988  if ((unsigned char)*(p) == 0xbf && (unsigned char)*(p+1) == 0xbd)
4989  {
4990  t << "{\\ucr}";
4991  p += 2;
4992  }
4993  else
4994  t << (char)c;
4995  break;
4996  case '#': t << "\\#"; break;
4997  case '$': t << "\\$"; break;
4998  case '%': t << "\\%"; break;
4999  case '^': t << "$^\\wedge$"; break;
5000  case '&': // possibility to have a special symbol
5001  q = p;
5002  cnt = 2; // we have to count & and ; as well
5003  while ((*q >= 'a' && *q <= 'z') || (*q >= 'A' && *q <= 'Z') || (*q >= '0' && *q <= '9'))
5004  {
5005  cnt++;
5006  q++;
5007  }
5008  if (*q == ';')
5009  {
5010  --p; // we need & as well
5011  DocSymbol::SymType res = HtmlEntityMapper::instance()->name2sym(QCString((char *)p).left(cnt));
5012  if (res == DocSymbol::Sym_Unknown)
5013  {
5014  p++;
5015  t << "\\&";
5016  }
5017  else
5018  {
5019  t << HtmlEntityMapper::instance()->latex(res);
5020  q++;
5021  p = q;
5022  }
5023  }
5024  else
5025  {
5026  t << "\\&";
5027  }
5028  break;
5029  case '*': t << "$\\ast$"; break;
5030  case '_': if (!insideTabbing) t << "\\+";
5031  t << "\\_";
5032  if (!insideTabbing) t << "\\+";
5033  break;
5034  case '{': t << "\\{"; break;
5035  case '}': t << "\\}"; break;
5036  case '<': t << "$<$"; break;
5037  case '>': t << "$>$"; break;
5038  case '|': t << "$\\vert$"; break;
5039  case '~': t << "$\\sim$"; break;
5040  case '[': if (Config_getBool(PDF_HYPERLINKS) || insideItem)
5041  t << "\\mbox{[}";
5042  else
5043  t << "[";
5044  break;
5045  case ']': if (pc=='[') t << "$\\,$";
5046  if (Config_getBool(PDF_HYPERLINKS) || insideItem)
5047  t << "\\mbox{]}";
5048  else
5049  t << "]";
5050  break;
5051  case '-': t << "-\\/";
5052  break;
5053  case '\\': t << "\\textbackslash{}";
5054  break;
5055  case '"': t << "\\char`\\\"{}";
5056  break;
5057  case '`': t << "\\`{}";
5058  break;
5059  case '\'': t << "\\textquotesingle{}";
5060  break;
5061  case ' ': if (keepSpaces) { if (insideTabbing) t << "\\>"; else t << '~'; } else t << ' ';
5062  break;
5063 
5064  default:
5065  //if (!insideTabbing && forceBreaks && c!=' ' && *p!=' ')
5066  if (!insideTabbing &&
5067  ((c>='A' && c<='Z' && pc!=' ' && !(pc>='A' && pc <= 'Z') && pc!='\0' && *p) || (c==':' && pc!=':') || (pc=='.' && isId(c)))
5068  )
5069  {
5070  t << "\\+";
5071  }
5072  if (c<32)
5073  {
5074  t << ' '; // non-printable control character
5075  }
5076  else
5077  {
5078  t << (char)c;
5079  }
5080  }
5081  }
5082  pc = c;
5083  }
5084 }

引用了 Config_getBool, QCString::data(), insideTable(), HtmlEntityMapper::instance(), QCString::isEmpty(), isId(), HtmlEntityMapper::latex(), HtmlEntityMapper::name2sym() , 以及 DocSymbol::Sym_Unknown.

被这些函数引用 LatexCodeGenerator::codify(), convertToLaTeX(), LatexGenerator::docify(), LatexDocVisitor::filter(), latexEscapeIndexChars(), latexEscapeLabelName(), substituteLatexKeywords() , 以及 TextGeneratorLatex::writeLink().

◆ filterTitle()

QCString filterTitle ( const QCString title)

在文件 util.cpp6254 行定义.

6255 {
6256  std::string tf;
6257  std::string t = title.str();
6258  static const reg::Ex re(R"(%[a-z_A-Z]+)");
6259  reg::Iterator it(t,re);
6261  size_t p = 0;
6262  for (; it!=end ; ++it)
6263  {
6264  const auto &match = *it;
6265  size_t i = match.position();
6266  size_t l = match.length();
6267  if (i>p) tf+=t.substr(p,i-p);
6268  tf+=match.str().substr(1); // skip %
6269  p=i+l;
6270  }
6271  tf+=t.substr(p);
6272  return QCString(tf);
6273 }

引用了 end(), reg::match() , 以及 QCString::str().

被这些函数引用 addToIndices(), PerlModGenerator::generatePerlModForPage(), generateXMLForPage(), mainPageHasOwnTitle(), HtmlGenerator::startFile(), writeExampleIndex(), writeIndex() , 以及 writePages().

◆ findAndRemoveWord()

bool findAndRemoveWord ( QCString sentence,
const char *  word 
)

removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple sequences of spaces.

Example: sentence=cat+ catfish cat cat concat cat, word=cat returns: + catfish concat

在文件 util.cpp5351 行定义.

5352 {
5353  static reg::Ex re(R"(\s*(<\a+>)\s*)");
5354  std::string s = sentence.str();
5355  reg::Iterator it(s,re);
5357  std::string result;
5358  bool found=false;
5359  size_t p=0;
5360  for ( ; it!=end ; ++it)
5361  {
5362  const auto match = *it;
5363  std::string part = match[1].str();
5364  if (part!=word)
5365  {
5366  size_t i = match.position();
5367  size_t l = match.length();
5368  result+=s.substr(p,i-p);
5369  result+=match.str();
5370  p=i+l;
5371  }
5372  else
5373  {
5374  found=true;
5375  size_t i = match[1].position();
5376  size_t l = match[1].length();
5377  result+=s.substr(p,i-p);
5378  p=i+l;
5379  }
5380  }
5381  result+=s.substr(p);
5382  sentence = QCString(result).simplifyWhiteSpace();
5383  return found;
5384 }

引用了 end(), reg::match(), QCString::simplifyWhiteSpace() , 以及 QCString::str().

被这些函数引用 isVarWithConstructor().

◆ findFileDef()

FileDef* findFileDef ( const FileNameLinkedMap fnMap,
const QCString n,
bool &  ambig 
)

在文件 util.cpp3222 行定义.

3223 {
3224  ambig=FALSE;
3225  if (n.isEmpty()) return 0;
3226 
3227  std::lock_guard<std::mutex> lock(g_findFileDefMutex);
3228 
3229  const int maxAddrSize = 20;
3230  char addr[maxAddrSize];
3231  qsnprintf(addr,maxAddrSize,"%p:",(void*)fnMap);
3232  QCString key = addr;
3233  key+=n;
3234 
3235  FindFileCacheElem *cachedResult = g_findFileDefCache.find(key.str());
3236  //printf("key=%s cachedResult=%p\n",qPrint(key),cachedResult);
3237  if (cachedResult)
3238  {
3239  ambig = cachedResult->isAmbig;
3240  //printf("cached: fileDef=%p\n",cachedResult->fileDef);
3241  return cachedResult->fileDef;
3242  }
3243  else
3244  {
3245  cachedResult = g_findFileDefCache.insert(key.str(),FindFileCacheElem(0,FALSE));
3246  }
3247 
3248  QCString name=Dir::cleanDirPath(n.str());
3249  QCString path;
3250  int slashPos;
3251  const FileName *fn;
3252  if (name.isEmpty()) goto exit;
3253  slashPos=std::max(name.findRev('/'),name.findRev('\\'));
3254  if (slashPos!=-1)
3255  {
3256  path=name.left(slashPos+1);
3257  name=name.right(name.length()-slashPos-1);
3258  }
3259  if (name.isEmpty()) goto exit;
3260  if ((fn=fnMap->find(name)))
3261  {
3262  //printf("fn->size()=%zu\n",fn->size());
3263  if (fn->size()==1)
3264  {
3265  const std::unique_ptr<FileDef> &fd = fn->front();
3266  bool isSamePath = Portable::fileSystemIsCaseSensitive() ?
3267  fd->getPath().right(path.length())==path :
3268  fd->getPath().right(path.length()).lower()==path.lower();
3269  if (path.isEmpty() || isSamePath)
3270  {
3271  cachedResult->fileDef = fd.get();
3272  return fd.get();
3273  }
3274  }
3275  else // file name alone is ambiguous
3276  {
3277  int count=0;
3278  FileDef *lastMatch=0;
3279  QCString pathStripped = stripFromIncludePath(path);
3280  for (const auto &fd_p : *fn)
3281  {
3282  FileDef *fd = fd_p.get();
3283  QCString fdStripPath = stripFromIncludePath(fd->getPath());
3284  if (path.isEmpty() || fdStripPath.right(pathStripped.length())==pathStripped)
3285  {
3286  count++;
3287  lastMatch=fd;
3288  }
3289  }
3290 
3291  ambig=(count>1);
3292  cachedResult->isAmbig = ambig;
3293  cachedResult->fileDef = lastMatch;
3294  return lastMatch;
3295  }
3296  }
3297  else
3298  {
3299  //printf("not found!\n");
3300  }
3301 exit:
3302  //delete cachedResult;
3303  return 0;
3304 }

引用了 Dir::cleanDirPath(), FALSE, FindFileCacheElem::fileDef, Portable::fileSystemIsCaseSensitive(), QCString::findRev(), g_findFileDefCache, g_findFileDefMutex, FileDef::getPath(), FindFileCacheElem::isAmbig, QCString::isEmpty(), QCString::left(), QCString::length(), QCString::lower(), qsnprintf, QCString::right(), QCString::str() , 以及 stripFromIncludePath().

被这些函数引用 addIncludeFile(), buildFileList(), DocParser::findAndCopyImage(), DocParser::findDocsForMemberOrCompound(), generateFileRef(), generateFileSources(), DocParser::handleLinkedWord(), DocDotFile::parse(), DocMscFile::parse(), DocDiaFile::parse(), parseFilesMultiThreading(), parseFilesSingleThreading(), Markdown::processLink(), DocParser::readTextFileByName(), resolveLink(), resolveRef(), DocbookDocVisitor::visitPost() , 以及 XmlDocVisitor::visitPre().

◆ findIndex() [1/2]

int findIndex ( const std::string &  s,
const reg::Ex re 
)

find the index of the first occurrence of pattern re in a string s returns -1 if the pattern could not be found

在文件 util.cpp7327 行定义.

7328 {
7329  reg::Match match;
7330  return reg::search(s,match,re) ? (int)match.position() : -1;
7331 }

引用了 reg::match() , 以及 reg::search().

◆ findIndex() [2/2]

int findIndex ( const StringVector sv,
const std::string &  s 
)

find the index of a string in a vector of strings, returns -1 if the string could not be found

在文件 util.cpp7319 行定义.

7320 {
7321  auto it = std::find(sv.begin(),sv.end(),s);
7322  return it!=sv.end() ? (int)(it-sv.begin()) : -1;
7323 }

被这些函数引用 initUCF(), VhdlDocGen::parseForBinding(), VhdlDocGen::parseUCF(), DotFilePatcher::run() , 以及 VhdlDocGen::writeFormatString().

◆ generateFileRef()

void generateFileRef ( OutputDocInterface od,
const QCString ,
const QCString linkTxt = QCString() 
)

在文件 util.cpp3193 行定义.

3194 {
3195  //printf("generateFileRef(%s,%s)\n",name,text);
3196  QCString linkText = text.isEmpty() ? text : name;
3197  //FileInfo *fi;
3198  FileDef *fd;
3199  bool ambig;
3200  if ((fd=findFileDef(Doxygen::inputNameLinkedMap,name,ambig)) &&
3201  fd->isLinkable())
3202  // link to documented input file
3203  od.writeObjectLink(fd->getReference(),fd->getOutputFileBase(),QCString(),linkText);
3204  else
3205  od.docify(linkText);
3206 }

引用了 BaseOutputDocInterface::docify(), findFileDef(), FileDef::getOutputFileBase(), Definition::getReference(), Doxygen::inputNameLinkedMap, QCString::isEmpty(), FileDef::isLinkable() , 以及 BaseOutputDocInterface::writeObjectLink().

◆ generateLink()

bool generateLink ( OutputDocInterface od,
const QCString ,
const QCString ,
bool  inSeeBlock,
const QCString  
)

在文件 util.cpp3151 行定义.

3153 {
3154  //printf("generateLink(clName=%s,lr=%s,lr=%s)\n",clName,lr,lt);
3155  const Definition *compound = 0;
3156  //PageDef *pageDef=0;
3157  QCString anchor,linkText=linkToText(SrcLangExt_Unknown,lt,FALSE);
3158  //printf("generateLink linkText=%s\n",qPrint(linkText));
3159  if (resolveLink(clName,lr,inSeeBlock,&compound,anchor))
3160  {
3161  if (compound) // link to compound
3162  {
3163  if (lt.isEmpty() && anchor.isEmpty() && /* compound link */
3164  compound->definitionType()==Definition::TypeGroup /* is group */
3165  )
3166  {
3167  linkText=(toGroupDef(compound))->groupTitle(); // use group's title as link
3168  }
3169  else if (compound->definitionType()==Definition::TypeFile)
3170  {
3171  linkText=linkToText(compound->getLanguage(),lt,TRUE);
3172  }
3173  od.writeObjectLink(compound->getReference(),
3174  compound->getOutputFileBase(),anchor,linkText);
3175  if (!compound->isReference())
3176  {
3177  writePageRef(od,compound->getOutputFileBase(),anchor);
3178  }
3179  }
3180  else
3181  {
3182  err("%s:%d: Internal error: resolveLink successful but no compound found!",__FILE__,__LINE__);
3183  }
3184  return TRUE;
3185  }
3186  else // link could not be found
3187  {
3188  od.docify(linkText);
3189  return FALSE;
3190  }
3191 }

引用了 Definition::definitionType(), BaseOutputDocInterface::docify(), err(), FALSE, Definition::getLanguage(), Definition::getOutputFileBase(), Definition::getReference(), QCString::isEmpty(), Definition::isReference(), linkToText(), resolveLink(), SrcLangExt_Unknown, toGroupDef(), TRUE, Definition::TypeFile, Definition::TypeGroup, BaseOutputDocInterface::writeObjectLink() , 以及 writePageRef().

◆ generateMarker()

QCString generateMarker ( int  id)

Generate a place holder for a position in a list. Used for translators to be able to specify different elements orders depending on whether text flows from left to right or visa versa.

在文件 util.cpp284 行定义.

285 {
286  const int maxMarkerStrLen = 20;
287  char result[maxMarkerStrLen];
288  qsnprintf(result,maxMarkerStrLen,"@%d",id);
289  return result;
290 }

引用了 qsnprintf.

被这些函数引用 TranslatorPortuguese::trCompoundReference(), TranslatorItalian::trFriends(), TranslatorBrazilian::trNamespaceReference(), TranslatorSpanish::trPrivateSlots(), TranslatorChinese::trWriteList(), TranslatorPersian::trWriteList() , 以及 TranslatorDanish::trWriteList().

◆ getCanonicalTemplateSpec()

QCString getCanonicalTemplateSpec ( const Definition d,
const FileDef fs,
const QCString spec 
)

在文件 util.cpp1594 行定义.

1595 {
1596 
1597  QCString templSpec = spec.stripWhiteSpace();
1598  // this part had been commented out before... but it is needed to match for instance
1599  // std::list<std::string> against list<string> so it is now back again!
1600  if (!templSpec.isEmpty() && templSpec.at(0) == '<')
1601  {
1602  templSpec = "< " + extractCanonicalType(d,fs,templSpec.right(templSpec.length()-1).stripWhiteSpace());
1603  }
1604  QCString resolvedType = resolveTypeDef(d,templSpec);
1605  if (!resolvedType.isEmpty()) // not known as a typedef either
1606  {
1607  templSpec = resolvedType;
1608  }
1609  //printf("getCanonicalTemplateSpec(%s)=%s\n",qPrint(spec),qPrint(templSpec));
1610  return templSpec;
1611 }

引用了 QCString::at(), extractCanonicalType(), QCString::isEmpty(), QCString::length(), resolveTypeDef(), QCString::right() , 以及 QCString::stripWhiteSpace().

被这些函数引用 getCanonicalTypeForIdentifier().

◆ getDefs()

bool getDefs ( const QCString scName,
const QCString mbName,
const QCString args,
const MemberDef *&  md,
const ClassDef *&  cd,
const FileDef *&  fd,
const NamespaceDef *&  nd,
const GroupDef *&  gd,
bool  forceEmptyScope,
const FileDef currentFile,
bool  checkCV 
)

Searches for a member definition given its name 'memberName' as a string. memberName may also include a (partial) scope to indicate the scope in which the member is located.

The parameter 'scName' is a string representing the name of the scope in which the link was found.

In case of a function args contains a string representation of the argument list. Passing 0 means the member has no arguments. Passing "()" means any argument list will do, but "()" is preferred.

The function returns TRUE if the member is known and documented or FALSE if it is not. If TRUE is returned parameter 'md' contains a pointer to the member definition. Furthermore exactly one of the parameter 'cd', 'nd', or 'fd' will be non-zero:

  • if 'cd' is non zero, the member was found in a class pointed to by cd.
  • if 'nd' is non zero, the member was found in a namespace pointed to by nd.
  • if 'fd' is non zero, the member was found in the global namespace of file fd.

在文件 util.cpp2208 行定义.

2220 {
2221  fd=0, md=0, cd=0, nd=0, gd=0;
2222  if (mbName.isEmpty()) return FALSE; /* empty name => nothing to link */
2223 
2224  QCString scopeName=scName;
2225  QCString memberName=mbName;
2226  scopeName = substitute(scopeName,"\\","::"); // for PHP
2227  memberName = substitute(memberName,"\\","::"); // for PHP
2228  //printf("Search for name=%s args=%s in scope=%s forceEmpty=%d\n",
2229  // qPrint(memberName),qPrint(args),qPrint(scopeName),forceEmptyScope);
2230 
2231  int is,im=0,pm=0;
2232  // strip common part of the scope from the scopeName
2233  while ((is=scopeName.findRev("::"))!=-1 &&
2234  (im=memberName.find("::",pm))!=-1 &&
2235  (scopeName.right(scopeName.length()-is-2)==memberName.mid(pm,im-pm))
2236  )
2237  {
2238  scopeName=scopeName.left(is);
2239  pm=im+2;
2240  }
2241  //printf("result after scope corrections scope=%s name=%s\n",
2242  // qPrint(scopeName), qPrint(memberName));
2243 
2244  QCString mName=memberName;
2245  QCString mScope;
2246  if (memberName.left(9)!="operator " && // treat operator conversion methods
2247  // as a special case
2248  (im=memberName.findRev("::"))!=-1 &&
2249  im<(int)memberName.length()-2 // not A::
2250  )
2251  {
2252  mScope=memberName.left(im);
2253  mName=memberName.right(memberName.length()-im-2);
2254  }
2255 
2256  // handle special the case where both scope name and member scope are equal
2257  if (mScope==scopeName) scopeName.resize(0);
2258 
2259  //printf("mScope='%s' mName='%s'\n",qPrint(mScope),qPrint(mName));
2260 
2262  //printf("mName=%s mn=%p\n",qPrint(mName),mn);
2263 
2264  if ((!forceEmptyScope || scopeName.isEmpty()) && // this was changed for bug638856, forceEmptyScope => empty scopeName
2265  mn && !(scopeName.isEmpty() && mScope.isEmpty()))
2266  {
2267  //printf(" >member name '%s' found\n",qPrint(mName));
2268  int scopeOffset=scopeName.length();
2269  do
2270  {
2271  QCString className = scopeName.left(scopeOffset);
2272  if (!className.isEmpty() && !mScope.isEmpty())
2273  {
2274  className+="::"+mScope;
2275  }
2276  else if (!mScope.isEmpty())
2277  {
2278  className=mScope;
2279  }
2280 
2281  SymbolResolver resolver;
2282  const ClassDef *fcd=resolver.resolveClass(Doxygen::globalScope,className);
2283  const MemberDef *tmd=resolver.getTypedef();
2284 
2285  if (fcd==0 && className.find('<')!=-1) // try without template specifiers as well
2286  {
2287  QCString nameWithoutTemplates = stripTemplateSpecifiersFromScope(className,FALSE);
2288  fcd=resolver.resolveClass(Doxygen::globalScope,nameWithoutTemplates);
2289  tmd=resolver.getTypedef();
2290  }
2291  //printf("Trying class scope %s: fcd=%p tmd=%p\n",qPrint(className),fcd,tmd);
2292  // todo: fill in correct fileScope!
2293  if (fcd && // is it a documented class
2294  fcd->isLinkable()
2295  )
2296  {
2297  //printf(" Found fcd=%p\n",fcd);
2298  int mdist=maxInheritanceDepth;
2299  std::unique_ptr<ArgumentList> argList;
2300  if (!args.isEmpty())
2301  {
2302  argList = stringToArgumentList(fcd->getLanguage(),args);
2303  }
2304  for (const auto &mmd_p : *mn)
2305  {
2306  MemberDef *mmd = mmd_p.get();
2307  if (!mmd->isStrongEnumValue())
2308  {
2309  const ArgumentList &mmdAl = mmd->argumentList();
2310  bool match = args.isEmpty() ||
2311  matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),&mmdAl,
2312  fcd, fcd->getFileDef(),argList.get(),
2313  checkCV);
2314  //printf("match=%d\n",match);
2315  if (match)
2316  {
2317  const ClassDef *mcd=mmd->getClassDef();
2318  if (mcd)
2319  {
2320  int m=minClassDistance(fcd,mcd);
2321  if (m<mdist && mcd->isLinkable())
2322  {
2323  mdist=m;
2324  cd=mcd;
2325  md=mmd;
2326  }
2327  }
2328  }
2329  }
2330  }
2331  if (mdist==maxInheritanceDepth && args=="()")
2332  // no exact match found, but if args="()" an arbitrary member will do
2333  {
2334  //printf(" >Searching for arbitrary member\n");
2335  for (const auto &mmd_p : *mn)
2336  {
2337  MemberDef *mmd = mmd_p.get();
2338  //if (mmd->isLinkable())
2339  //{
2340  const ClassDef *mcd=mmd->getClassDef();
2341  //printf(" >Class %s found\n",qPrint(mcd->name()));
2342  if (mcd)
2343  {
2344  int m=minClassDistance(fcd,mcd);
2345  if (m<mdist /* && mcd->isLinkable()*/ )
2346  {
2347  //printf("Class distance %d\n",m);
2348  mdist=m;
2349  cd=mcd;
2350  md=mmd;
2351  }
2352  }
2353  //}
2354  }
2355  }
2356  //printf(" >Success=%d\n",mdist<maxInheritanceDepth);
2357  if (mdist<maxInheritanceDepth)
2358  {
2359  if (!md->isLinkable() || md->isStrongEnumValue())
2360  {
2361  md=0; // avoid returning things we cannot link to
2362  cd=0;
2363  return FALSE; // match found, but was not linkable
2364  }
2365  else
2366  {
2367  gd=md->getGroupDef();
2368  if (gd) cd=0;
2369  return TRUE; /* found match */
2370  }
2371  }
2372  }
2373  if (tmd && tmd->isEnumerate() && tmd->isStrong()) // scoped enum
2374  {
2375  //printf("Found scoped enum!\n");
2376  for (const auto &emd : tmd->enumFieldList())
2377  {
2378  if (emd->localName()==mName)
2379  {
2380  if (emd->isLinkable())
2381  {
2382  cd=tmd->getClassDef();
2383  md=emd;
2384  return TRUE;
2385  }
2386  else
2387  {
2388  cd=0;
2389  md=0;
2390  return FALSE;
2391  }
2392  }
2393  }
2394  }
2395  /* go to the parent scope */
2396  if (scopeOffset==0)
2397  {
2398  scopeOffset=-1;
2399  }
2400  else if ((scopeOffset=scopeName.findRev("::",scopeOffset-1))==-1)
2401  {
2402  scopeOffset=0;
2403  }
2404  } while (scopeOffset>=0);
2405 
2406  }
2407  if (mn && scopeName.isEmpty() && mScope.isEmpty()) // Maybe a related function?
2408  {
2409  //printf("Global symbol\n");
2410  const MemberDef *fuzzy_mmd = 0;
2411  std::unique_ptr<ArgumentList> argList;
2412  bool hasEmptyArgs = args=="()";
2413 
2414  if (!args.isEmpty())
2415  {
2416  argList = stringToArgumentList(SrcLangExt_Cpp, args);
2417  }
2418 
2419  for (const auto &mmd_p : *mn)
2420  {
2421  const MemberDef *mmd = mmd_p.get();
2422  if (!mmd->isLinkable() || (!mmd->isRelated() && !mmd->isForeign()) ||
2423  !mmd->getClassDef())
2424  {
2425  continue;
2426  }
2427 
2428  if (args.isEmpty())
2429  {
2430  fuzzy_mmd = mmd;
2431  break;
2432  }
2433 
2434  const ArgumentList &mmdAl = mmd->argumentList();
2435  if (matchArguments2(mmd->getOuterScope(),mmd->getFileDef(),&mmdAl,
2436  Doxygen::globalScope,mmd->getFileDef(),argList.get(),
2437  checkCV
2438  )
2439  )
2440  {
2441  fuzzy_mmd = mmd;
2442  break;
2443  }
2444 
2445  if (!fuzzy_mmd && hasEmptyArgs)
2446  {
2447  fuzzy_mmd = mmd;
2448  }
2449  }
2450 
2451  if (fuzzy_mmd && !fuzzy_mmd->isStrongEnumValue())
2452  {
2453  md = fuzzy_mmd;
2454  cd = fuzzy_mmd->getClassDef();
2455  return TRUE;
2456  }
2457  }
2458 
2459 
2460  // maybe an namespace, file or group member ?
2461  //printf("Testing for global symbol scopeName='%s' mScope='%s' :: mName='%s'\n",
2462  // qPrint(scopeName), qPrint(mScope), qPrint(mName));
2463  if ((mn=Doxygen::functionNameLinkedMap->find(mName))) // name is known
2464  {
2465  //printf(" >symbol name found\n");
2466  NamespaceDef *fnd=0;
2467  int scopeOffset=scopeName.length();
2468  do
2469  {
2470  QCString namespaceName = scopeName.left(scopeOffset);
2471  if (!namespaceName.isEmpty() && !mScope.isEmpty())
2472  {
2473  namespaceName+="::"+mScope;
2474  }
2475  else if (!mScope.isEmpty())
2476  {
2477  namespaceName=mScope;
2478  }
2479  //printf("Trying namespace %s\n",qPrint(namespaceName));
2480  if (!namespaceName.isEmpty() &&
2481  (fnd=Doxygen::namespaceLinkedMap->find(namespaceName)) &&
2482  fnd->isLinkable()
2483  )
2484  {
2485  //printf("Symbol inside existing namespace '%s' count=%d\n",
2486  // qPrint(namespaceName),mn->count());
2487  bool found=FALSE;
2488  for (const auto &mmd_p : *mn)
2489  {
2490  const MemberDef *mmd = mmd_p.get();
2491  //printf("mmd->getNamespaceDef()=%p fnd=%p\n",
2492  // mmd->getNamespaceDef(),fnd);
2493  const MemberDef *emd = mmd->getEnumScope();
2494  if (emd && emd->isStrong())
2495  {
2496  //printf("yes match %s<->%s!\n",qPrint(mScope),qPrint(emd->localName()));
2497  if (emd->getNamespaceDef()==fnd &&
2498  rightScopeMatch(mScope,emd->localName()))
2499  {
2500  //printf("found it!\n");
2501  nd=fnd;
2502  md=mmd;
2503  found=TRUE;
2504  break;
2505  }
2506  else
2507  {
2508  md=0;
2509  cd=0;
2510  return FALSE;
2511  }
2512  }
2513  else if (mmd->getOuterScope()==fnd /* && mmd->isLinkable() */ )
2514  { // namespace is found
2515  bool match=TRUE;
2516  if (!args.isEmpty() && args!="()")
2517  {
2518  const ArgumentList &mmdAl = mmd->argumentList();
2519  auto argList_p = stringToArgumentList(mmd->getLanguage(),args);
2521  mmd->getOuterScope(),mmd->getFileDef(),&mmdAl,
2522  fnd,mmd->getFileDef(),argList_p.get(),
2523  checkCV);
2524  }
2525  if (match)
2526  {
2527  nd=fnd;
2528  md=mmd;
2529  found=TRUE;
2530  break;
2531  }
2532  }
2533  }
2534  if (!found && args=="()")
2535  // no exact match found, but if args="()" an arbitrary
2536  // member will do
2537  {
2538  for (const auto &mmd_p : *mn)
2539  {
2540  const MemberDef *mmd = mmd_p.get();
2541  if (mmd->getNamespaceDef()==fnd /*&& mmd->isLinkable() */ )
2542  {
2543  nd=fnd;
2544  md=mmd;
2545  found=TRUE;
2546  break;
2547  }
2548  }
2549  }
2550  if (found)
2551  {
2552  if (!md->isLinkable())
2553  {
2554  md=0; // avoid returning things we cannot link to
2555  nd=0;
2556  return FALSE; // match found but not linkable
2557  }
2558  else
2559  {
2560  gd=md->resolveAlias()->getGroupDef();
2561  if (gd && gd->isLinkable()) nd=0; else gd=0;
2562  return TRUE;
2563  }
2564  }
2565  }
2566  else
2567  {
2568  //printf("not a namespace\n");
2569  for (const auto &mmd_p : *mn)
2570  {
2571  const MemberDef *mmd = mmd_p.get();
2572  const MemberDef *tmd = mmd->getEnumScope();
2573  //printf("try member %s tmd=%s\n",qPrint(mmd->name()),tmd ? qPrint(tmd->name()) : "<none>");
2574  int ni=namespaceName.findRev("::");
2575  //printf("namespaceName=%s ni=%d\n",qPrint(namespaceName),ni);
2576  bool notInNS = tmd && ni==-1 && tmd->getNamespaceDef()==0 && (mScope.isEmpty() || mScope==tmd->name());
2577  bool sameNS = tmd && ni>=0 && tmd->getNamespaceDef() && namespaceName.left(ni)==tmd->getNamespaceDef()->name() && namespaceName.mid(ni+2)==tmd->name();
2578  //printf("notInNS=%d sameNS=%d\n",notInNS,sameNS);
2579  if (tmd && tmd->isStrong() && // C++11 enum class
2580  (notInNS || sameNS) &&
2581  namespaceName.length()>0 // enum is part of namespace so this should not be empty
2582  )
2583  {
2584  md=mmd;
2585  fd=mmd->getFileDef();
2586  gd=mmd->getGroupDef();
2587  if (gd && gd->isLinkable()) fd=0; else gd=0;
2588  //printf("Found scoped enum %s fd=%p gd=%p\n",
2589  // qPrint(mmd->name()),fd,gd);
2590  return TRUE;
2591  }
2592  }
2593  }
2594  if (scopeOffset==0)
2595  {
2596  scopeOffset=-1;
2597  }
2598  else if ((scopeOffset=scopeName.findRev("::",scopeOffset-1))==-1)
2599  {
2600  scopeOffset=0;
2601  }
2602  } while (scopeOffset>=0);
2603 
2604  //else // no scope => global function
2605  {
2606  std::vector<const MemberDef *> members;
2607  // search for matches with strict static checking
2608  findMembersWithSpecificName(mn,args,TRUE,currentFile,checkCV,members);
2609  if (members.empty()) // nothing found
2610  {
2611  // search again without strict static checking
2612  findMembersWithSpecificName(mn,args,FALSE,currentFile,checkCV,members);
2613  }
2614  //printf("found %d members\n",members.count());
2615  if (members.size()!=1 && args=="()")
2616  {
2617  // no exact match found, but if args="()" an arbitrary
2618  // member will do
2619  //MemberNameIterator mni(*mn);
2620  //for (mni.toLast();(md=mni.current());--mni)
2621  for (auto it = mn->rbegin(); it!=mn->rend(); ++it)
2622  {
2623  const auto &mmd_p = *it;
2624  const MemberDef *mmd = mmd_p.get();
2625  //printf("Found member '%s'\n",qPrint(mmd->name()));
2626  //printf("member is linkable mmd->name()='%s'\n",qPrint(mmd->name()));
2627  fd=mmd->getFileDef();
2628  gd=mmd->getGroupDef();
2629  const MemberDef *tmd = mmd->getEnumScope();
2630  if (
2631  (gd && gd->isLinkable()) || (fd && fd->isLinkable()) ||
2632  (tmd && tmd->isStrong())
2633  )
2634  {
2635  members.push_back(mmd);
2636  }
2637  }
2638  }
2639  //printf("found %d candidate members\n",members.count());
2640  if (!members.empty()) // at least one match
2641  {
2642  if (currentFile)
2643  {
2644  //printf("multiple results; pick one from file:%s\n",qPrint( currentFile->name()));
2645  for (const auto &rmd : members)
2646  {
2647  if (rmd->getFileDef() && rmd->getFileDef()->name() == currentFile->name())
2648  {
2649  md = rmd;
2650  break; // found match in the current file
2651  }
2652  }
2653  if (!md) // member not in the current file
2654  {
2655  md=members.back();
2656  }
2657  }
2658  else
2659  {
2660  md=members.back();
2661  }
2662  }
2663  if (md && (md->getEnumScope()==0 || !md->getEnumScope()->isStrong()))
2664  // found a matching global member, that is not a scoped enum value (or uniquely matches)
2665  {
2666  fd=md->getFileDef();
2667  gd=md->getGroupDef();
2668  //printf("fd=%p gd=%p gd->isLinkable()=%d\n",fd,gd,gd->isLinkable());
2669  if (gd && gd->isLinkable()) fd=0; else gd=0;
2670  return TRUE;
2671  }
2672  }
2673  }
2674 
2675  // no nothing found
2676  return FALSE;
2677 }

引用了 MemberDef::argumentList(), MemberDef::enumFieldList(), FALSE, LinkedMap< T, Hash, KeyEqual, Map >::find(), QCString::find(), findMembersWithSpecificName(), QCString::findRev(), Doxygen::functionNameLinkedMap, MemberDef::getClassDef(), MemberDef::getEnumScope(), MemberDef::getFileDef(), ClassDef::getFileDef(), MemberDef::getGroupDef(), Definition::getLanguage(), MemberDef::getNamespaceDef(), Definition::getOuterScope(), SymbolResolver::getTypedef(), Doxygen::globalScope, QCString::isEmpty(), MemberDef::isEnumerate(), MemberDef::isForeign(), NamespaceDef::isLinkable(), GroupDef::isLinkable(), FileDef::isLinkable(), MemberDef::isLinkable(), ClassDef::isLinkable(), MemberDef::isRelated(), MemberDef::isStrong(), MemberDef::isStrongEnumValue(), QCString::left(), QCString::length(), Definition::localName(), reg::match(), matchArguments2(), maxInheritanceDepth, Doxygen::memberNameLinkedMap, QCString::mid(), minClassDistance(), FileDef::name(), Definition::name(), Doxygen::namespaceLinkedMap, MemberName::rbegin(), MemberName::rend(), QCString::resize(), MemberDef::resolveAlias(), SymbolResolver::resolveClass(), QCString::right(), rightScopeMatch(), SrcLangExt_Cpp, stringToArgumentList(), stripTemplateSpecifiersFromScope(), substitute() , 以及 TRUE.

被这些函数引用 DocParser::findDocsForMemberOrCompound(), linkifyText() , 以及 resolveRef().

◆ getDotImageExtension()

◆ getFileFilter()

QCString getFileFilter ( const QCString name,
bool  isSourceCode 
)

looks for a filter for the file name. Returns the name of the filter if there is a match for the file name, otherwise an empty string. In case inSourceCode is TRUE then first the source filter list is considered.

在文件 util.cpp1315 行定义.

1316 {
1317  // sanity check
1318  if (name.isEmpty()) return "";
1319 
1320  const StringVector& filterSrcList = Config_getList(FILTER_SOURCE_PATTERNS);
1321  const StringVector& filterList = Config_getList(FILTER_PATTERNS);
1322 
1323  QCString filterName;
1324  bool found=FALSE;
1325  if (isSourceCode && !filterSrcList.empty())
1326  { // first look for source filter pattern list
1327  filterName = getFilterFromList(name,filterSrcList,found);
1328  }
1329  if (!found && filterName.isEmpty())
1330  { // then look for filter pattern list
1331  filterName = getFilterFromList(name,filterList,found);
1332  }
1333  if (!found)
1334  { // then use the generic input filter
1335  return Config_getString(INPUT_FILTER);
1336  }
1337  else
1338  {
1339  /* remove surrounding double quotes */
1340  if ((filterName.right(1) == "\"") && (filterName.left(1) == "\""))
1341  {
1342  filterName.remove(filterName.length() - 1, 1);
1343  filterName.remove(0, 1);
1344  }
1345  return filterName;
1346  }
1347 }

引用了 Config_getList, Config_getString, FALSE, getFilterFromList(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::remove() , 以及 QCString::right().

被这些函数引用 FilterCache::getFileContents(), readCodeFragment(), readInputFile() , 以及 FileDefImpl::writeSourceBody().

◆ getFileNameExtension()

QCString getFileNameExtension ( const QCString fn)

◆ getLanguageFromCodeLang()

SrcLangExt getLanguageFromCodeLang ( QCString fileName)

Routine to handle the language attribute of the \code command

在文件 util.cpp5592 行定义.

5593 {
5594  // try the extension
5596  if (lang == SrcLangExt_Unknown)
5597  {
5598  // try the language names
5599  const Lang2ExtMap *p = g_lang2extMap;
5600  QCString langName = fileName.lower();
5601  if (langName.at(0)=='.') langName = langName.mid(1);
5602  while (p->langName)
5603  {
5604  if (langName==p->langName)
5605  {
5606  // found the language
5607  lang = p->parserId;
5608  fileName = p->defExt;
5609  break;
5610  }
5611  p++;
5612  }
5613  if (!p->langName)
5614  {
5615  return SrcLangExt_Cpp;
5616  }
5617  }
5618  return lang;
5619 }

引用了 QCString::at(), Lang2ExtMap::defExt, g_lang2extMap, getLanguageFromFileName(), Lang2ExtMap::langName, QCString::lower(), QCString::mid(), Lang2ExtMap::parserId, SrcLangExt_Cpp , 以及 SrcLangExt_Unknown.

被这些函数引用 HtmlDocVisitor::visit(), DocbookDocVisitor::visit(), LatexDocVisitor::visit(), ManDocVisitor::visit(), RTFDocVisitor::visit() , 以及 XmlDocVisitor::visit().

◆ getLanguageFromFileName()

SrcLangExt getLanguageFromFileName ( const QCString fileName,
SrcLangExt  defLang = SrcLangExt_Cpp 
)

在文件 util.cpp5574 行定义.

5575 {
5576  FileInfo fi(fileName.str());
5577  // we need only the part after the last ".", newer implementations of FileInfo have 'suffix()' for this.
5578  QCString extName = QCString(fi.extension(FALSE)).lower();
5579  if (extName.isEmpty()) extName=".no_extension";
5580  if (extName.at(0)!='.') extName.prepend(".");
5581  auto it = g_extLookup.find(extName.str());
5582  if (it!=g_extLookup.end()) // listed extension
5583  {
5584  //printf("getLanguageFromFileName(%s)=%x\n",qPrint(fi.extension()),*pVal);
5585  return (SrcLangExt)it->second;
5586  }
5587  //printf("getLanguageFromFileName(%s) not found!\n",qPrint(fileName));
5588  return defLang; // not listed => assume C-ish language.
5589 }

引用了 QCString::at(), FileInfo::extension(), FALSE, g_extLookup, QCString::isEmpty(), QCString::lower(), QCString::prepend() , 以及 QCString::str().

被这些函数引用 MemberDefImpl::_writeMultiLineInitializer(), DocRef::DocRef(), FileDefImpl::FileDefImpl(), getLanguageFromCodeLang(), ClassDefImpl::IMPL::init(), FileDefImpl::isDocumentationFile(), DocSecRefItem::parse(), Markdown::processLink(), readCodeFragment(), HtmlDocVisitor::visit(), LatexDocVisitor::visit(), DocbookDocVisitor::visit(), RTFDocVisitor::visit(), ManDocVisitor::visit(), XmlDocVisitor::visit() , 以及 writeXMLCodeBlock().

◆ getLanguageSpecificSeparator()

◆ getOverloadDocs()

QCString getOverloadDocs ( )

Returns the standard string that is generated when the \overload command is used.

在文件 util.cpp4212 行定义.

4213 {
4214  return theTranslator->trOverloadText();
4215  //"This is an overloaded member function, "
4216  // "provided for convenience. It differs from the above "
4217  // "function only in what argument(s) it accepts.";
4218 }

引用了 theTranslator , 以及 Translator::trOverloadText().

被这些函数引用 addMemberDocs() , 以及 addOverloaded().

◆ getPrefixIndex()

int getPrefixIndex ( const QCString name)

Returns the character index within name of the first prefix in Config_getList(IGNORE_PREFIX) that matches name at the left hand side, or zero if no match was found

在文件 util.cpp3357 行定义.

3358 {
3359  if (name.isEmpty()) return 0;
3360  const StringVector &sl = Config_getList(IGNORE_PREFIX);
3361  for (const auto &s : sl)
3362  {
3363  const char *ps=s.c_str();
3364  const char *pd=name.data();
3365  int i=0;
3366  while (*ps!=0 && *pd!=0 && *ps==*pd) ps++,pd++,i++;
3367  if (*ps==0 && *pd!=0)
3368  {
3369  return i;
3370  }
3371  }
3372  return 0;
3373 }

引用了 Config_getList, QCString::data() , 以及 QCString::isEmpty().

被这些函数引用 addClassMemberNameToIndex(), addFileMemberNameToIndex(), addNamespaceMemberNameToIndex(), SearchIndex::addWord(), FilterAlphaIndex::determineSortKey(), parseInput(), writeAlphabeticalClassList() , 以及 writeMemberList().

◆ getScopeFragment()

int getScopeFragment ( const QCString s,
int  p,
int *  l 
)

Returns a fragment from scope s, starting at position p.

参数
sthe scope name as a string.
pthe start position (0 is the first).
lthe resulting length of the fragment.
返回
the location of the fragment, or -1 if non is found.

在文件 util.cpp4702 行定义.

4703 {
4704  int sl=s.length();
4705  int sp=p;
4706  int count=0;
4707  bool done;
4708  if (sp>=sl) return -1;
4709  while (sp<sl)
4710  {
4711  char c=s.at(sp);
4712  if (c==':') sp++,p++; else break;
4713  }
4714  while (sp<sl)
4715  {
4716  char c=s.at(sp);
4717  switch (c)
4718  {
4719  case ':': // found next part
4720  goto found;
4721  case '<': // skip template specifier
4722  count=1;sp++;
4723  done=FALSE;
4724  while (sp<sl && !done)
4725  {
4726  // TODO: deal with << and >> operators!
4727  c=s.at(sp++);
4728  switch(c)
4729  {
4730  case '<': count++; break;
4731  case '>': count--; if (count==0) done=TRUE; break;
4732  default: break;
4733  }
4734  }
4735  break;
4736  default:
4737  sp++;
4738  break;
4739  }
4740  }
4741 found:
4742  *l=sp-p;
4743  //printf("getScopeFragment(%s,%d)=%s\n",qPrint(s),p,qPrint(s.mid(p,*l)));
4744  return p;
4745 }

引用了 QCString::at(), FALSE, QCString::length() , 以及 TRUE.

被这些函数引用 buildScopeFromQualifiedName(), findScopeFromQualifiedName(), SymbolResolver::Private::followPath(), resolveTypeDef() , 以及 stripAnonymousNamespaceScope().

◆ guessSection()

int guessSection ( const QCString name)

try to determine if name is a source or a header file name by looking at the extension. A number of variations is allowed in both upper and lower case) If anyone knows or uses another extension please let me know :-)

在文件 util.cpp331 行定义.

332 {
333  QCString n=name.lower();
334  if (n.right(2)==".c" || // source
335  n.right(3)==".cc" ||
336  n.right(4)==".cxx" ||
337  n.right(4)==".cpp" ||
338  n.right(4)==".c++" ||
339  n.right(5)==".java" ||
340  n.right(2)==".m" ||
341  n.right(3)==".mm" ||
342  n.right(3)==".ii" || // inline
343  n.right(4)==".ixx" ||
344  n.right(4)==".ipp" ||
345  n.right(4)==".i++" ||
346  n.right(4)==".inl" ||
347  n.right(4)==".xml" ||
348  n.right(4)==".lex" ||
349  n.right(4)==".sql"
350  ) return Entry::SOURCE_SEC;
351  if (n.right(2)==".h" || // header
352  n.right(3)==".hh" ||
353  n.right(4)==".hxx" ||
354  n.right(4)==".hpp" ||
355  n.right(4)==".h++" ||
356  n.right(4)==".idl" ||
357  n.right(4)==".ddl" ||
358  n.right(5)==".pidl" ||
359  n.right(4)==".ice"
360  ) return Entry::HEADER_SEC;
361  return 0;
362 }

引用了 Entry::HEADER_SEC, QCString::lower(), QCString::right() , 以及 Entry::SOURCE_SEC.

被这些函数引用 addIncludeFile(), TagFileParser::buildLists(), computeClassRelations(), FileDefImpl::FileDefImpl(), FileDefImpl::generateSourceFile() , 以及 ClassDefImpl::IMPL::init().

◆ initDefaultExtensionMapping()

void initDefaultExtensionMapping ( )

在文件 util.cpp5505 行定义.

5506 {
5507  // NOTE: when adding an extension, also add the extension in config.xml
5508  // extension parser id
5509  updateLanguageMapping(".dox", "c");
5510  updateLanguageMapping(".txt", "c"); // see bug 760836
5511  updateLanguageMapping(".doc", "c");
5512  updateLanguageMapping(".c", "c");
5513  updateLanguageMapping(".C", "c");
5514  updateLanguageMapping(".cc", "c");
5515  updateLanguageMapping(".CC", "c");
5516  updateLanguageMapping(".cxx", "c");
5517  updateLanguageMapping(".cpp", "c");
5518  updateLanguageMapping(".c++", "c");
5519  updateLanguageMapping(".ii", "c");
5520  updateLanguageMapping(".ixx", "c");
5521  updateLanguageMapping(".ipp", "c");
5522  updateLanguageMapping(".i++", "c");
5523  updateLanguageMapping(".inl", "c");
5524  updateLanguageMapping(".h", "c");
5525  updateLanguageMapping(".H", "c");
5526  updateLanguageMapping(".hh", "c");
5527  updateLanguageMapping(".HH", "c");
5528  updateLanguageMapping(".hxx", "c");
5529  updateLanguageMapping(".hpp", "c");
5530  updateLanguageMapping(".h++", "c");
5531  updateLanguageMapping(".idl", "idl");
5532  updateLanguageMapping(".ddl", "idl");
5533  updateLanguageMapping(".odl", "idl");
5534  updateLanguageMapping(".java", "java");
5535  //updateLanguageMapping(".as", "javascript"); // not officially supported
5536  //updateLanguageMapping(".js", "javascript"); // not officially supported
5537  updateLanguageMapping(".cs", "csharp");
5538  updateLanguageMapping(".d", "d");
5539  updateLanguageMapping(".php", "php");
5540  updateLanguageMapping(".php4", "php");
5541  updateLanguageMapping(".php5", "php");
5542  updateLanguageMapping(".inc", "php");
5543  updateLanguageMapping(".phtml", "php");
5544  updateLanguageMapping(".m", "objective-c");
5545  updateLanguageMapping(".M", "objective-c");
5546  updateLanguageMapping(".mm", "c"); // see bug746361
5547  updateLanguageMapping(".py", "python");
5548  updateLanguageMapping(".pyw", "python");
5549  updateLanguageMapping(".f", "fortran");
5550  updateLanguageMapping(".for", "fortran");
5551  updateLanguageMapping(".f90", "fortran");
5552  updateLanguageMapping(".f95", "fortran");
5553  updateLanguageMapping(".f03", "fortran");
5554  updateLanguageMapping(".f08", "fortran");
5555  updateLanguageMapping(".f18", "fortran");
5556  updateLanguageMapping(".vhd", "vhdl");
5557  updateLanguageMapping(".vhdl", "vhdl");
5558  updateLanguageMapping(".ucf", "vhdl");
5559  updateLanguageMapping(".qsf", "vhdl");
5560  updateLanguageMapping(".md", "md");
5561  updateLanguageMapping(".markdown", "md");
5562  updateLanguageMapping(".ice", "slice");
5563  updateLanguageMapping(".l", "lex");
5564  updateLanguageMapping(".doxygen_lex_c", "c"); // this is a placeholder so we can map initializations
5565  // in the lex scanning to cpp
5566 }

引用了 updateLanguageMapping().

被这些函数引用 initDoxygen().

◆ insertTemplateSpecifierInScope()

QCString insertTemplateSpecifierInScope ( const QCString scope,
const QCString templ 
)

在文件 util.cpp3782 行定义.

3783 {
3784  QCString result=scope;
3785  if (!templ.isEmpty() && scope.find('<')==-1)
3786  {
3787  int si,pi=0;
3788  ClassDef *cd=0;
3789  while (
3790  (si=scope.find("::",pi))!=-1 && !getClass(scope.left(si)+templ) &&
3791  ((cd=getClass(scope.left(si)))==0 || cd->templateArguments().empty())
3792  )
3793  {
3794  //printf("Tried '%s'\n",qPrint((scope.left(si)+templ)));
3795  pi=si+2;
3796  }
3797  if (si==-1) // not nested => append template specifier
3798  {
3799  result+=templ;
3800  }
3801  else // nested => insert template specifier before after first class name
3802  {
3803  result=scope.left(si) + templ + scope.right(scope.length()-si);
3804  }
3805  }
3806  //printf("insertTemplateSpecifierInScope('%s','%s')=%s\n",
3807  // qPrint(scope),qPrint(templ),qPrint(result));
3808  return result;
3809 }

引用了 ArgumentList::empty(), QCString::find(), getClass(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::right() , 以及 ClassDef::templateArguments().

被这些函数引用 DotClassGraph::addClass(), generateXMLForClass(), InheritanceListContext::InheritanceListContext(), DiagramItem::label() , 以及 ClassDefImpl::writeInheritanceGraph().

◆ integerToAlpha()

QCString integerToAlpha ( int  n,
bool  upper = true 
)

在文件 util.cpp7347 行定义.

7348 {
7349  QCString result;
7350  int residual = n;
7351 
7352  char modVal[2];
7353  modVal[1] = 0;
7354  while (residual > 0)
7355  {
7356  modVal[0] = (upper ? 'A': 'a') + (residual-1)%26;
7357  result = modVal + result;
7358  residual = (residual-1) / 26;
7359  }
7360  return result;
7361 }

被这些函数引用 ManDocVisitor::visitPre() , 以及 RTFDocVisitor::visitPre().

◆ integerToRoman()

QCString integerToRoman ( int  n,
bool  upper = true 
)

在文件 util.cpp7363 行定义.

7364 {
7365  static const char *str_romans_upper[] = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" };
7366  static const char *str_romans_lower[] = { "m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv", "i" };
7367  static const int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
7368  static const char **str_romans = upper ? str_romans_upper : str_romans_lower;
7369 
7370  QCString result;
7371  int residual = n;
7372 
7373  for (int i = 0; i < 13; ++i)
7374  {
7375  while (residual - values[i] >= 0)
7376  {
7377  result += str_romans[i];
7378  residual -= values[i];
7379  }
7380  }
7381 
7382  return result;
7383 }

被这些函数引用 LatexDocVisitor::visitPre(), RTFDocVisitor::visitPre() , 以及 ManDocVisitor::visitPre().

◆ isId()

◆ isIdJS()

bool isIdJS ( int  c)
inline

在文件 util.h176 行定义.

177 {
178  return c>=128 || c<0 || isalnum(c);
179 }

引用了 reg::isalnum().

被这些函数引用 searchId().

◆ isURL()

bool isURL ( const QCString url)

Checks whether the given url starts with a supported protocol

在文件 util.cpp6561 行定义.

6562 {
6563  QCString loc_url = url.stripWhiteSpace();
6564  return loc_url.left(5)=="http:" || loc_url.left(6)=="https:" ||
6565  loc_url.left(4)=="ftp:" || loc_url.left(5)=="ftps:" ||
6566  loc_url.left(5)=="sftp:" || loc_url.left(5)=="file:" ||
6567  loc_url.left(5)=="news:" || loc_url.left(4)=="irc:" ||
6568  loc_url.left(5)=="ircs:";
6569 }

引用了 QCString::left() , 以及 QCString::stripWhiteSpace().

被这些函数引用 correctURL() , 以及 Markdown::processLink().

◆ join()

std::string join ( const StringVector s,
const std::string &  delimiter 
)

create a string where the string in the vector are joined by the given delimiter

在文件 util.cpp7334 行定义.

7335 {
7336  std::string result;
7337  bool first=true;
7338  for (const auto &s : sv)
7339  {
7340  if (!first) result+=delimiter;
7341  first=false;
7342  result+=s;
7343  }
7344  return result;
7345 }

◆ langToString()

QCString langToString ( SrcLangExt  lang)

Returns a string representation of lang.

在文件 util.cpp6519 行定义.

6520 {
6521  switch(lang)
6522  {
6523  case SrcLangExt_Unknown: return "Unknown";
6524  case SrcLangExt_IDL: return "IDL";
6525  case SrcLangExt_Java: return "Java";
6526  case SrcLangExt_CSharp: return "C#";
6527  case SrcLangExt_D: return "D";
6528  case SrcLangExt_PHP: return "PHP";
6529  case SrcLangExt_ObjC: return "Objective-C";
6530  case SrcLangExt_Cpp: return "C++";
6531  case SrcLangExt_JS: return "JavaScript";
6532  case SrcLangExt_Python: return "Python";
6533  case SrcLangExt_Fortran: return "Fortran";
6534  case SrcLangExt_VHDL: return "VHDL";
6535  case SrcLangExt_XML: return "XML";
6536  case SrcLangExt_SQL: return "SQL";
6537  case SrcLangExt_Markdown: return "Markdown";
6538  case SrcLangExt_Slice: return "Slice";
6539  case SrcLangExt_Lex: return "Lex";
6540  }
6541  return "Unknown";
6542 }

引用了 SrcLangExt_Cpp, SrcLangExt_CSharp, SrcLangExt_D, SrcLangExt_Fortran, SrcLangExt_IDL, SrcLangExt_Java, SrcLangExt_JS, SrcLangExt_Lex, SrcLangExt_Markdown, SrcLangExt_ObjC, SrcLangExt_PHP, SrcLangExt_Python, SrcLangExt_Slice, SrcLangExt_SQL, SrcLangExt_Unknown, SrcLangExt_VHDL , 以及 SrcLangExt_XML.

被这些函数引用 generateXMLForClass(), generateXMLForFile() , 以及 generateXMLForNamespace().

◆ latexEscapeIndexChars()

QCString latexEscapeIndexChars ( const QCString s)

在文件 util.cpp5129 行定义.

5130 {
5131  if (s.isEmpty()) return s;
5132  QCString tmp(s.length()+1);
5133  TextStream t;
5134  const char *p=s.data();
5135  char c;
5136  int i;
5137  while ((c=*p++))
5138  {
5139  switch (c)
5140  {
5141  case '!': t << "\"!"; break;
5142  case '"': t << "\"\""; break;
5143  case '@': t << "\"@"; break;
5144  case '|': t << "\\texttt{\"|}"; break;
5145  case '[': t << "["; break;
5146  case ']': t << "]"; break;
5147  case '{': t << "\\lcurly{}"; break;
5148  case '}': t << "\\rcurly{}"; break;
5149  // NOTE: adding a case here, means adding it to while below as well!
5150  default:
5151  i=0;
5152  // collect as long string as possible, before handing it to docify
5153  tmp[i++]=c;
5154  while ((c=*p) && c!='"' && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
5155  {
5156  tmp[i++]=c;
5157  p++;
5158  }
5159  tmp[i]=0;
5160  filterLatexString(t,tmp,
5161  true, // insideTabbing
5162  false, // insidePre
5163  false, // insideItem
5164  false, // insideTable
5165  false // keepSpaces
5166  );
5167  break;
5168  }
5169  }
5170  return t.str();
5171 }

引用了 QCString::data(), filterLatexString(), QCString::isEmpty(), QCString::length() , 以及 TextStream::str().

被这些函数引用 LatexGenerator::addIndexItem(), FilterTexIndex::apply(), LatexGenerator::endTitleHead(), LatexGenerator::startMemberDoc() , 以及 LatexDocVisitor::visit().

◆ latexEscapeLabelName()

QCString latexEscapeLabelName ( const QCString s)

在文件 util.cpp5086 行定义.

5087 {
5088  if (s.isEmpty()) return s;
5089  QCString tmp(s.length()+1);
5090  TextStream t;
5091  const char *p=s.data();
5092  char c;
5093  int i;
5094  while ((c=*p++))
5095  {
5096  switch (c)
5097  {
5098  case '|': t << "\\texttt{\"|}"; break;
5099  case '!': t << "\"!"; break;
5100  case '@': t << "\"@"; break;
5101  case '%': t << "\\%"; break;
5102  case '{': t << "\\lcurly{}"; break;
5103  case '}': t << "\\rcurly{}"; break;
5104  case '~': t << "````~"; break; // to get it a bit better in index together with other special characters
5105  // NOTE: adding a case here, means adding it to while below as well!
5106  default:
5107  i=0;
5108  // collect as long string as possible, before handing it to docify
5109  tmp[i++]=c;
5110  while ((c=*p) && c!='@' && c!='[' && c!=']' && c!='!' && c!='{' && c!='}' && c!='|')
5111  {
5112  tmp[i++]=c;
5113  p++;
5114  }
5115  tmp[i]=0;
5116  filterLatexString(t,tmp,
5117  true, // insideTabbing
5118  false, // insidePre
5119  false, // insideItem
5120  false, // insideTable
5121  false // keepSpaces
5122  );
5123  break;
5124  }
5125  }
5126  return t.str();
5127 }

引用了 QCString::data(), filterLatexString(), QCString::isEmpty(), QCString::length() , 以及 TextStream::str().

被这些函数引用 LatexGenerator::addIndexItem(), FilterTexLabel::apply(), LatexGenerator::endTitleHead(), LatexGenerator::startMemberDoc() , 以及 LatexDocVisitor::visit().

◆ latexEscapePDFString()

QCString latexEscapePDFString ( const QCString s)

在文件 util.cpp5173 行定义.

5174 {
5175  if (s.isEmpty()) return s;
5176  TextStream t;
5177  const char *p=s.data();
5178  char c;
5179  while ((c=*p++))
5180  {
5181  switch (c)
5182  {
5183  case '\\': t << "\\textbackslash{}"; break;
5184  case '{': t << "\\{"; break;
5185  case '}': t << "\\}"; break;
5186  case '_': t << "\\_"; break;
5187  case '%': t << "\\%"; break;
5188  case '&': t << "\\&"; break;
5189  default:
5190  t << c;
5191  break;
5192  }
5193  }
5194  return t.str();
5195 }

引用了 QCString::data(), QCString::isEmpty() , 以及 TextStream::str().

被这些函数引用 LatexGenerator::startMemberDoc().

◆ latexFilterURL()

QCString latexFilterURL ( const QCString s)

在文件 util.cpp5197 行定义.

5198 {
5199  if (s.isEmpty()) return s;
5200  TextStream t;
5201  const signed char *p=(const signed char*)s.data();
5202  char c;
5203  while ((c=*p++))
5204  {
5205  switch (c)
5206  {
5207  case '#': t << "\\#"; break;
5208  case '%': t << "\\%"; break;
5209  case '\\': t << "\\\\"; break;
5210  default:
5211  if (c<0)
5212  {
5213  unsigned char id = (unsigned char)c;
5214  t << "\\%" << hex[id>>4] << hex[id&0xF];
5215  }
5216  else
5217  {
5218  t << c;
5219  }
5220  break;
5221  }
5222  }
5223  return t.str();
5224 }

引用了 QCString::data(), hex, QCString::isEmpty() , 以及 TextStream::str().

被这些函数引用 LatexGenerator::startHtmlLink(), LatexDocVisitor::visit() , 以及 LatexDocVisitor::visitPre().

◆ leftScopeMatch()

bool leftScopeMatch ( const QCString scope,
const QCString name 
)

在文件 util.cpp874 行定义.

875 {
876  int sl=scope.length();
877  int nl=name.length();
878  return (name==scope || // equal
879  (scope.left(nl)==name && // substring
880  sl>nl+1 && scope.at(nl)==':' && scope.at(nl+1)==':' // scope
881  )
882  );
883 }

引用了 QCString::at(), QCString::left() , 以及 QCString::length().

被这些函数引用 addClassToContext(), addConceptToContext(), mergeScopes() , 以及 substituteTemplateArgumentsInString().

◆ lineBlock()

int lineBlock ( const QCString text,
const QCString marker 
)

Returns the line number of the line following the line with the marker.

参见
routine extractBlock

在文件 util.cpp6498 行定义.

6499 {
6500  int result = 1;
6501  int p=0,i;
6502  bool found=FALSE;
6503 
6504  // find the character positions of the first marker
6505  int m1 = text.find(marker);
6506  if (m1==-1) return result;
6507 
6508  // find start line positions for the markers
6509  while (!found && (i=text.find('\n',p))!=-1)
6510  {
6511  found = (p<=m1 && m1<i); // found the line with the start marker
6512  p=i+1;
6513  result++;
6514  }
6515  return result;
6516 }

引用了 FALSE , 以及 QCString::find().

被这些函数引用 DocPara::handleInclude(), HtmlDocVisitor::visit(), DocbookDocVisitor::visit(), LatexDocVisitor::visit(), ManDocVisitor::visit(), RTFDocVisitor::visit() , 以及 XmlDocVisitor::visit().

◆ linkifyText()

void linkifyText ( const TextGeneratorIntf ol,
const Definition scope,
const FileDef fileScope,
const Definition self,
const QCString text,
bool  autoBreak = FALSE,
bool  external = TRUE,
bool  keepSpaces = FALSE,
int  indentLevel = 0 
)

在文件 util.cpp886 行定义.

890 {
891  if (text.isEmpty()) return;
892  //printf("linkify='%s'\n",text);
893  std::string txtStr=text.str();
894  size_t strLen = txtStr.length();
895  if (strLen==0) return;
896 
897  static const reg::Ex regExp(R"(\a[\w~!\\.:$]*)");
898  reg::Iterator it(txtStr,regExp);
900 
901  //printf("linkifyText scope=%s fileScope=%s strtxt=%s strlen=%d external=%d\n",
902  // scope ? qPrint(scope->name()):"<none>",
903  // fileScope ? qPrint(fileScope->name()) : "<none>",
904  // qPrint(txtStr),strLen,external);
905  size_t index=0;
906  size_t skipIndex=0;
907  size_t floatingIndex=0;
908  for (; it!=end ; ++it) // for each word from the text string
909  {
910  const auto &match = *it;
911  size_t newIndex = match.position();
912  size_t matchLen = match.length();
913  floatingIndex+=newIndex-skipIndex+matchLen;
914  if (newIndex>0 && txtStr.at(newIndex-1)=='0') // ignore hex numbers (match x00 in 0x00)
915  {
916  std::string part = txtStr.substr(skipIndex,newIndex+matchLen-skipIndex);
917  out.writeString(part.c_str(),keepSpaces);
918  skipIndex=index=newIndex+matchLen;
919  continue;
920  }
921 
922  // add non-word part to the result
923  bool insideString=FALSE;
924  for (size_t i=index;i<newIndex;i++)
925  {
926  if (txtStr.at(i)=='"') insideString=!insideString;
927  }
928 
929  //printf("floatingIndex=%d strlen=%d autoBreak=%d\n",floatingIndex,strLen,autoBreak);
930  if (strLen>35 && floatingIndex>30 && autoBreak) // try to insert a split point
931  {
932  std::string splitText = txtStr.substr(skipIndex,newIndex-skipIndex);
933  size_t splitLength = splitText.length();
934  size_t offset=1;
935  size_t i = splitText.find(',');
936  if (i==std::string::npos) { i=splitText.find('<'); if (i!=std::string::npos) offset=0; }
937  if (i==std::string::npos) i=splitText.find('>');
938  if (i==std::string::npos) i=splitText.find(' ');
939  //printf("splitText=[%s] len=%d i=%d offset=%d\n",qPrint(splitText),splitLength,i,offset);
940  if (i!=std::string::npos) // add a link-break at i in case of Html output
941  {
942  std::string part1 = splitText.substr(0,i+offset);
943  out.writeString(part1.c_str(),keepSpaces);
944  out.writeBreak(indentLevel==0 ? 0 : indentLevel+1);
945  std::string part2 = splitText.substr(i+offset);
946  out.writeString(part2.c_str(),keepSpaces);
947  floatingIndex=splitLength-i-offset+matchLen;
948  }
949  else
950  {
951  out.writeString(splitText.c_str(),keepSpaces);
952  }
953  }
954  else
955  {
956  //ol.docify(txtStr.mid(skipIndex,newIndex-skipIndex));
957  std::string part = txtStr.substr(skipIndex,newIndex-skipIndex);
958  out.writeString(part.c_str(),keepSpaces);
959  }
960  // get word from string
961  std::string word=txtStr.substr(newIndex,matchLen);
962  QCString matchWord = substitute(substitute(QCString(word),"\\","::"),".","::");
963  //printf("linkifyText word=%s matchWord=%s scope=%s\n",
964  // qPrint(word),qPrint(matchWord),scope ? qPrint(scope->name()) : "<none>");
965  bool found=FALSE;
966  if (!insideString)
967  {
968  const MemberDef *md=0;
969  const ClassDef *cd=0;
970  const FileDef *fd=0;
971  const NamespaceDef *nd=0;
972  const GroupDef *gd=0;
973  const ConceptDef *cnd=0;
974  //printf("** Match word '%s'\n",qPrint(matchWord));
975 
976  SymbolResolver resolver(fileScope);
977  cd=resolver.resolveClass(scope,matchWord);
978  const MemberDef *typeDef = resolver.getTypedef();
979  if (typeDef) // First look at typedef then class, see bug 584184.
980  {
981  //printf("Found typedef %s\n",qPrint(typeDef->name()));
982  if (external ? typeDef->isLinkable() : typeDef->isLinkableInProject())
983  {
984  if (typeDef->getOuterScope()!=self)
985  {
986  out.writeLink(typeDef->getReference(),
987  typeDef->getOutputFileBase(),
988  typeDef->anchor(),
989  word.c_str());
990  found=TRUE;
991  }
992  }
993  }
994  if (!found && (cd || (cd=getClass(matchWord))))
995  {
996  //printf("Found class %s\n",qPrint(cd->name()));
997  // add link to the result
998  if (external ? cd->isLinkable() : cd->isLinkableInProject())
999  {
1000  if (cd!=self)
1001  {
1002  out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word.c_str());
1003  found=TRUE;
1004  }
1005  }
1006  }
1007  else if ((cd=getClass(matchWord+"-p"))) // search for Obj-C protocols as well
1008  {
1009  // add link to the result
1010  if (external ? cd->isLinkable() : cd->isLinkableInProject())
1011  {
1012  if (cd!=self)
1013  {
1014  out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word.c_str());
1015  found=TRUE;
1016  }
1017  }
1018  }
1019  else if ((cnd=getConcept(matchWord)))
1020  {
1021  // add link to the result
1022  if (external ? cnd->isLinkable() : cnd->isLinkableInProject())
1023  {
1024  if (cnd!=self)
1025  {
1026  out.writeLink(cnd->getReference(),cnd->getOutputFileBase(),cnd->anchor(),word.c_str());
1027  found=TRUE;
1028  }
1029  }
1030  }
1031  else
1032  {
1033  //printf(" -> nothing\n");
1034  }
1035 
1036  int m = matchWord.findRev("::");
1037  QCString scopeName;
1038  if (scope &&
1041  )
1042  )
1043  {
1044  scopeName=scope->name();
1045  }
1046  else if (m!=-1)
1047  {
1048  scopeName = matchWord.left(m);
1049  matchWord = matchWord.mid(m+2);
1050  }
1051 
1052  //printf("ScopeName=%s\n",qPrint(scopeName));
1053  //if (!found) printf("Trying to link %s in %s\n",qPrint(word),qPrint(scopeName));
1054  if (!found &&
1055  getDefs(scopeName,matchWord,QCString(),md,cd,fd,nd,gd) &&
1056  //(md->isTypedef() || md->isEnumerate() ||
1057  // md->isReference() || md->isVariable()
1058  //) &&
1059  (external ? md->isLinkable() : md->isLinkableInProject())
1060  )
1061  {
1062  //printf("Found ref scope=%s\n",d ? qPrint(d->name()) : "<global>");
1063  //ol.writeObjectLink(d->getReference(),d->getOutputFileBase(),
1064  // md->anchor(),word);
1065  if (md!=self && (self==0 || md->name()!=self->name()))
1066  // name check is needed for overloaded members, where getDefs just returns one
1067  {
1068  /* in case of Fortran scop and the variable is a non Fortran variable: don't link,
1069  * see also getLink in fortrancode.l
1070  */
1071  if (!(scope && (scope->getLanguage() == SrcLangExt_Fortran) && md->isVariable() && (md->getLanguage() != SrcLangExt_Fortran)))
1072  {
1073  out.writeLink(md->getReference(),md->getOutputFileBase(),
1074  md->anchor(),word.c_str());
1075  //printf("found symbol %s\n",qPrint(matchWord));
1076  found=TRUE;
1077  }
1078  }
1079  }
1080  }
1081 
1082  if (!found) // add word to the result
1083  {
1084  out.writeString(word.c_str(),keepSpaces);
1085  }
1086  // set next start point in the string
1087  //printf("index=%d/%d\n",index,txtStr.length());
1088  skipIndex=index=newIndex+matchLen;
1089  }
1090  // add last part of the string to the result.
1091  //ol.docify(txtStr.right(txtStr.length()-skipIndex));
1092  std::string lastPart = txtStr.substr(skipIndex);
1093  out.writeString(lastPart.c_str(),keepSpaces);
1094 }

引用了 ConceptDef::anchor(), MemberDef::anchor(), ClassDef::anchor(), Definition::definitionType(), end(), FALSE, QCString::findRev(), getClass(), getConcept(), getDefs(), Definition::getLanguage(), Definition::getOuterScope(), ConceptDef::getOutputFileBase(), MemberDef::getOutputFileBase(), ClassDef::getOutputFileBase(), MemberDef::getReference(), ClassDef::getReference(), Definition::getReference(), SymbolResolver::getTypedef(), QCString::isEmpty(), ConceptDef::isLinkable(), MemberDef::isLinkable(), ClassDef::isLinkable(), ConceptDef::isLinkableInProject(), MemberDef::isLinkableInProject(), ClassDef::isLinkableInProject(), MemberDef::isVariable(), QCString::left(), reg::match(), QCString::mid(), Definition::name(), SymbolResolver::resolveClass(), SrcLangExt_Fortran, QCString::str(), substitute(), TRUE, Definition::TypeClass, Definition::TypeNamespace, TextGeneratorIntf::writeBreak(), TextGeneratorIntf::writeLink() , 以及 TextGeneratorIntf::writeString().

被这些函数引用 MemberDefImpl::_writeTemplatePrefix(), createLinkedText(), generateXMLForClass(), generateXMLForConcept(), generateXMLForMember(), MemberDefImpl::writeDeclaration(), writeDefArgumentList(), MemberDefImpl::writeDocumentation(), writeExceptionListImpl(), MemberDefImpl::writeMemberDocSimple(), writeTemplateArgumentList(), ClassDefImpl::writeTemplateSpec() , 以及 writeTypeConstraints().

◆ linkToText()

QCString linkToText ( SrcLangExt  lang,
const QCString link,
bool  isFileName 
)

在文件 util.cpp2943 行定义.

2944 {
2945  //static bool optimizeOutputJava = Config_getBool(OPTIMIZE_OUTPUT_JAVA);
2946  QCString result=link;
2947  if (!result.isEmpty())
2948  {
2949  // replace # by ::
2950  result=substitute(result,"#","::");
2951  // replace . by ::
2952  if (!isFileName && result.find('<')==-1) result=substitute(result,".","::",3);
2953  // strip leading :: prefix if present
2954  if (result.at(0)==':' && result.at(1)==':')
2955  {
2956  result=result.right(result.length()-2);
2957  }
2959  if (sep!="::")
2960  {
2961  result=substitute(result,"::",sep);
2962  }
2963  }
2964  return result;
2965 }

引用了 QCString::at(), QCString::find(), getLanguageSpecificSeparator(), QCString::isEmpty(), QCString::length(), QCString::right() , 以及 substitute().

被这些函数引用 DotCallGraph::buildGraph(), DocRef::DocRef(), DotCallGraph::DotCallGraph(), generateLink() , 以及 DocParser::handleLinkedWord().

◆ mainPageHasTitle()

bool mainPageHasTitle ( )

在文件 util.cpp7027 行定义.

7028 {
7029  return Doxygen::mainPage!=0 && Doxygen::mainPage->hasTitle();
7030 }

引用了 Doxygen::mainPage.

被这些函数引用 RTFGenerator::endIndexSection(), generateJSNavTree(), generateXMLForPage(), mainPageHasOwnTitle() , 以及 writeIndex().

◆ matchArguments2()

bool matchArguments2 ( const Definition srcScope,
const FileDef srcFileScope,
const ArgumentList srcAl,
const Definition dstScope,
const FileDef dstFileScope,
const ArgumentList dstAl,
bool  checkCV 
)

在文件 util.cpp1919 行定义.

1922 {
1923  ASSERT(srcScope!=0 && dstScope!=0);
1924 
1925  if (srcAl==0 || dstAl==0)
1926  {
1927  bool match = srcAl==dstAl;
1928  if (match)
1929  {
1930  MATCH
1931  return TRUE;
1932  }
1933  else
1934  {
1935  NOMATCH
1936  return FALSE;
1937  }
1938  }
1939 
1940  // handle special case with void argument
1941  if ( srcAl->empty() && dstAl->size()==1 && dstAl->front().type=="void" )
1942  { // special case for finding match between func() and func(void)
1943  Argument a;
1944  a.type = "void";
1945  const_cast<ArgumentList*>(srcAl)->push_back(a);
1946  MATCH
1947  return TRUE;
1948  }
1949  if ( dstAl->empty() && srcAl->size()==1 && srcAl->front().type=="void" )
1950  { // special case for finding match between func(void) and func()
1951  Argument a;
1952  a.type = "void";
1953  const_cast<ArgumentList*>(dstAl)->push_back(a);
1954  MATCH
1955  return TRUE;
1956  }
1957 
1958  if (srcAl->size() != dstAl->size())
1959  {
1960  NOMATCH
1961  return FALSE; // different number of arguments -> no match
1962  }
1963 
1964  if (checkCV)
1965  {
1966  if (srcAl->constSpecifier() != dstAl->constSpecifier())
1967  {
1968  NOMATCH
1969  return FALSE; // one member is const, the other not -> no match
1970  }
1971  if (srcAl->volatileSpecifier() != dstAl->volatileSpecifier())
1972  {
1973  NOMATCH
1974  return FALSE; // one member is volatile, the other not -> no match
1975  }
1976  }
1977 
1978  if (srcAl->refQualifier() != dstAl->refQualifier())
1979  {
1980  NOMATCH
1981  return FALSE; // one member is has a different ref-qualifier than the other
1982  }
1983 
1984  // so far the argument list could match, so we need to compare the types of
1985  // all arguments.
1986  auto srcIt = srcAl->begin();
1987  auto dstIt = dstAl->begin();
1988  for (;srcIt!=srcAl->end() && dstIt!=dstAl->end();++srcIt,++dstIt)
1989  {
1990  Argument &srcA = const_cast<Argument&>(*srcIt);
1991  Argument &dstA = const_cast<Argument&>(*dstIt);
1992  if (!matchArgument2(srcScope,srcFileScope,srcA,
1993  dstScope,dstFileScope,dstA)
1994  )
1995  {
1996  NOMATCH
1997  return FALSE;
1998  }
1999  }
2000  MATCH
2001  return TRUE; // all arguments match
2002 }

引用了 ASSERT, ArgumentList::begin(), ArgumentList::constSpecifier(), ArgumentList::empty(), ArgumentList::end(), FALSE, ArgumentList::front(), reg::match(), MATCH, matchArgument2(), NOMATCH, ArgumentList::refQualifier(), ArgumentList::size(), TRUE, Argument::type , 以及 ArgumentList::volatileSpecifier().

被这些函数引用 addMemberDocs(), addMemberFunction(), combineDeclarationAndDefinition(), computeMemberRelations(), findGlobalMember(), findMember(), findMembersWithSpecificName(), getDefs(), GroupDefImpl::insertMember(), ClassDefImpl::mergeMembers(), transferFunctionReferences() , 以及 transferRelatedFunctionDocumentation().

◆ mergeArguments()

void mergeArguments ( ArgumentList ,
ArgumentList ,
bool  forceNameOverwrite = FALSE 
)

在文件 util.cpp2008 行定义.

2009 {
2010  //printf("mergeArguments '%s', '%s'\n",
2011  // qPrint(argListToString(srcAl)),qPrint(argListToString(dstAl)));
2012 
2013  if (srcAl.size()!=dstAl.size())
2014  {
2015  return; // invalid argument lists -> do not merge
2016  }
2017 
2018  auto srcIt=srcAl.begin();
2019  auto dstIt=dstAl.begin();
2020  while (srcIt!=srcAl.end() && dstIt!=dstAl.end())
2021  {
2022  Argument &srcA = *srcIt;
2023  Argument &dstA = *dstIt;
2024 
2025  if (srcA.defval.isEmpty() && !dstA.defval.isEmpty())
2026  {
2027  //printf("Defval changing '%s'->'%s'\n",qPrint(srcA.defval),qPrint(dstA.defval));
2028  srcA.defval=dstA.defval;
2029  }
2030  else if (!srcA.defval.isEmpty() && dstA.defval.isEmpty())
2031  {
2032  //printf("Defval changing '%s'->'%s'\n",qPrint(dstA.defval),qPrint(srcA.defval));
2033  dstA.defval=srcA.defval;
2034  }
2035 
2036  // fix wrongly detected const or volatile specifiers before merging.
2037  // example: "const A *const" is detected as type="const A *" name="const"
2038  if (srcA.name=="const" || srcA.name=="volatile")
2039  {
2040  srcA.type+=" "+srcA.name;
2041  srcA.name.resize(0);
2042  }
2043  if (dstA.name=="const" || dstA.name=="volatile")
2044  {
2045  dstA.type+=" "+dstA.name;
2046  dstA.name.resize(0);
2047  }
2048 
2049  if (srcA.type==dstA.type)
2050  {
2051  //printf("1. merging %s:%s <-> %s:%s\n",qPrint(srcA.type),qPrint(srcA.name),qPrint(dstA.type),qPrint(dstA.name));
2052  if (srcA.name.isEmpty() && !dstA.name.isEmpty())
2053  {
2054  //printf("type: '%s':='%s'\n",qPrint(srcA.type),qPrint(dstA.type));
2055  //printf("name: '%s':='%s'\n",qPrint(srcA.name),qPrint(dstA.name));
2056  srcA.type = dstA.type;
2057  srcA.name = dstA.name;
2058  }
2059  else if (!srcA.name.isEmpty() && dstA.name.isEmpty())
2060  {
2061  //printf("type: '%s':='%s'\n",qPrint(dstA.type),qPrint(srcA.type));
2062  //printf("name: '%s':='%s'\n",qPrint(dstA.name),qPrint(srcA.name));
2063  dstA.type = srcA.type;
2064  dstA.name = srcA.name;
2065  }
2066  else if (!srcA.name.isEmpty() && !dstA.name.isEmpty())
2067  {
2068  //printf("srcA.name=%s dstA.name=%s\n",qPrint(srcA.name),qPrint(dstA.name));
2069  if (forceNameOverwrite)
2070  {
2071  srcA.name = dstA.name;
2072  }
2073  else
2074  {
2075  if (srcA.docs.isEmpty() && !dstA.docs.isEmpty())
2076  {
2077  srcA.name = dstA.name;
2078  }
2079  else if (!srcA.docs.isEmpty() && dstA.docs.isEmpty())
2080  {
2081  dstA.name = srcA.name;
2082  }
2083  }
2084  }
2085  }
2086  else
2087  {
2088  //printf("2. merging '%s':'%s' <-> '%s':'%s'\n",qPrint(srcA.type),qPrint(srcA.name),qPrint(dstA.type),qPrint(dstA.name));
2089  srcA.type=srcA.type.stripWhiteSpace();
2090  dstA.type=dstA.type.stripWhiteSpace();
2091  if (srcA.type+" "+srcA.name==dstA.type) // "unsigned long:int" <-> "unsigned long int:bla"
2092  {
2093  srcA.type+=" "+srcA.name;
2094  srcA.name=dstA.name;
2095  }
2096  else if (dstA.type+" "+dstA.name==srcA.type) // "unsigned long int bla" <-> "unsigned long int"
2097  {
2098  dstA.type+=" "+dstA.name;
2099  dstA.name=srcA.name;
2100  }
2101  else if (srcA.name.isEmpty() && !dstA.name.isEmpty())
2102  {
2103  srcA.name = dstA.name;
2104  }
2105  else if (dstA.name.isEmpty() && !srcA.name.isEmpty())
2106  {
2107  dstA.name = srcA.name;
2108  }
2109  }
2110  int i1=srcA.type.find("::"),
2111  i2=dstA.type.find("::"),
2112  j1=srcA.type.length()-i1-2,
2113  j2=dstA.type.length()-i2-2;
2114  if (i1!=-1 && i2==-1 && srcA.type.right(j1)==dstA.type)
2115  {
2116  //printf("type: '%s':='%s'\n",qPrint(dstA.type),qPrint(srcA.type));
2117  //printf("name: '%s':='%s'\n",qPrint(dstA.name),qPrint(srcA.name));
2118  dstA.type = srcA.type.left(i1+2)+dstA.type;
2119  dstA.name = srcA.name;
2120  }
2121  else if (i1==-1 && i2!=-1 && dstA.type.right(j2)==srcA.type)
2122  {
2123  //printf("type: '%s':='%s'\n",qPrint(srcA.type),qPrint(dstA.type));
2124  //printf("name: '%s':='%s'\n",qPrint(dstA.name),qPrint(srcA.name));
2125  srcA.type = dstA.type.left(i2+2)+srcA.type;
2126  srcA.name = dstA.name;
2127  }
2128  if (srcA.docs.isEmpty() && !dstA.docs.isEmpty())
2129  {
2130  srcA.docs = dstA.docs;
2131  }
2132  else if (dstA.docs.isEmpty() && !srcA.docs.isEmpty())
2133  {
2134  dstA.docs = srcA.docs;
2135  }
2136  //printf("Merge argument '%s|%s' '%s|%s'\n",
2137  // qPrint(srcA.type), qPrint(srcA.name),
2138  // qPrint(dstA.type), qPrint(dstA.name));
2139  ++srcIt;
2140  ++dstIt;
2141  }
2142 }

引用了 ArgumentList::begin(), Argument::defval, Argument::docs, ArgumentList::end(), QCString::find(), QCString::isEmpty(), QCString::left(), QCString::length(), Argument::name, QCString::resize(), QCString::right(), ArgumentList::size(), QCString::stripWhiteSpace() , 以及 Argument::type.

被这些函数引用 addMemberDocs().

◆ mergeScopes()

QCString mergeScopes ( const QCString leftScope,
const QCString rightScope 
)

Merges two scope parts together. The parts may (partially) overlap. Example1: A::B and B::C will result in A::B::C
Example2: A and B will be A::B
Example3: A::B and B will be A::B

参数
leftScopethe left hand part of the scope.
rightScopethe right hand part of the scope.
返回
the merged scope.

在文件 util.cpp4667 行定义.

4668 {
4669  // case leftScope=="A" rightScope=="A::B" => result = "A::B"
4670  if (leftScopeMatch(rightScope,leftScope)) return rightScope;
4671  QCString result;
4672  int i=0,p=leftScope.length();
4673 
4674  // case leftScope=="A::B" rightScope=="B::C" => result = "A::B::C"
4675  // case leftScope=="A::B" rightScope=="B" => result = "A::B"
4676  bool found=FALSE;
4677  while ((i=leftScope.findRev("::",p))>0)
4678  {
4679  if (leftScopeMatch(rightScope,leftScope.right(leftScope.length()-i-2)))
4680  {
4681  result = leftScope.left(i+2)+rightScope;
4682  found=TRUE;
4683  }
4684  p=i-1;
4685  }
4686  if (found) return result;
4687 
4688  // case leftScope=="A" rightScope=="B" => result = "A::B"
4689  result=leftScope;
4690  if (!result.isEmpty() && !rightScope.isEmpty()) result+="::";
4691  result+=rightScope;
4692  return result;
4693 }

引用了 FALSE, QCString::findRev(), QCString::isEmpty(), QCString::left(), leftScopeMatch(), QCString::length(), QCString::right() , 以及 TRUE.

被这些函数引用 addEnumValuesToEnums(), findEnums() , 以及 findMember().

◆ nextUtf8CharPosition()

int nextUtf8CharPosition ( const QCString utf8Str,
uint  len,
uint  startPos 
)

◆ normalizeNonTemplateArgumentsInString()

QCString normalizeNonTemplateArgumentsInString ( const QCString name,
const Definition context,
const ArgumentList formalArgs 
)

在文件 util.cpp4412 行定义.

4416 {
4417  // skip until <
4418  int p=name.find('<');
4419  if (p==-1) return name;
4420  p++;
4421  QCString result = name.left(p);
4422 
4423  std::string s = result.mid(p).str();
4424  static const reg::Ex re(R"([\a:][\w:]*)");
4425  reg::Iterator it(s,re);
4427  size_t pi=0;
4428  // for each identifier in the template part (e.g. B<T> -> T)
4429  for (; it!=end ; ++it)
4430  {
4431  const auto &match = *it;
4432  size_t i = match.position();
4433  size_t l = match.length();
4434  result += s.substr(pi,i-pi);
4435  QCString n(match.str());
4436  bool found=FALSE;
4437  for (const Argument &formArg : formalArgs)
4438  {
4439  if (formArg.name == n)
4440  {
4441  found=TRUE;
4442  break;
4443  }
4444  }
4445  if (!found)
4446  {
4447  // try to resolve the type
4448  SymbolResolver resolver;
4449  const ClassDef *cd = resolver.resolveClass(context,n);
4450  if (cd)
4451  {
4452  result+=cd->name();
4453  }
4454  else
4455  {
4456  result+=n;
4457  }
4458  }
4459  else
4460  {
4461  result+=n;
4462  }
4463  pi=i+l;
4464  }
4465  result+=s.substr(pi);
4466  //printf("normalizeNonTemplateArgumentInString(%s)=%s\n",qPrint(name),qPrint(result));
4467  return removeRedundantWhiteSpace(result);
4468 }

引用了 end(), FALSE, QCString::find(), QCString::left(), reg::match(), QCString::mid(), Definition::name(), removeRedundantWhiteSpace(), SymbolResolver::resolveClass(), QCString::str() , 以及 TRUE.

被这些函数引用 findUsedClassesForClass().

◆ openOutputFile()

bool openOutputFile ( const QCString outFile,
std::ofstream &  f 
)

在文件 util.cpp7039 行定义.

7040 {
7041  assert(!f.is_open());
7042  bool fileOpened=FALSE;
7043  bool writeToStdout=outFile=="-";
7044  if (writeToStdout) // write to stdout
7045  {
7046  f.basic_ios<char>::rdbuf(std::cout.rdbuf());
7047  fileOpened = true;
7048  }
7049  else // write to file
7050  {
7051  FileInfo fi(outFile.str());
7052  if (fi.exists()) // create a backup
7053  {
7054  Dir dir;
7055  FileInfo backup(fi.fileName()+".bak");
7056  if (backup.exists()) // remove existing backup
7057  dir.remove(backup.fileName());
7058  dir.rename(fi.fileName(),fi.fileName()+".bak");
7059  }
7060  f.open(outFile.str(),std::ofstream::out | std::ofstream::binary);
7061  fileOpened = f.is_open();
7062  }
7063  return fileOpened;
7064 }

引用了 FileInfo::exists(), FALSE, FileInfo::fileName(), Dir::remove(), Dir::rename() , 以及 QCString::str().

被这些函数引用 compareDoxyfile(), generateConfigFile(), readConfiguration() , 以及 writeDefaultLayoutFile().

◆ parseCommentAsText()

QCString parseCommentAsText ( const Definition scope,
const MemberDef member,
const QCString doc,
const QCString fileName,
int  lineNr 
)

在文件 util.cpp5738 行定义.

5740 {
5741  if (doc.isEmpty()) return "";
5742  //printf("parseCommentAsText(%s)\n",qPrint(doc));
5743  TextStream t;
5744  std::unique_ptr<IDocParser> parser { createDocParser() };
5745  std::unique_ptr<DocRoot> root { validatingParseDoc(*parser.get(),
5746  fileName,lineNr,
5747  (Definition*)scope,(MemberDef*)md,doc,FALSE,FALSE,
5748  QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT)) };
5749  auto visitor = std::make_unique<TextDocVisitor>(t);
5750  root->accept(visitor.get());
5751  QCString result = convertCharEntitiesToUTF8(t.str().c_str()).stripWhiteSpace();
5752  int i=0;
5753  int charCnt=0;
5754  int l=result.length();
5755  while ((i=nextUTF8CharPosition(result,l,i))<l)
5756  {
5757  charCnt++;
5758  if (charCnt>=80) break;
5759  }
5760  if (charCnt>=80) // try to truncate the string
5761  {
5762  while ((i=nextUTF8CharPosition(result,l,i))<l && charCnt<100)
5763  {
5764  charCnt++;
5765  if (result.at(i)==',' ||
5766  result.at(i)=='.' ||
5767  result.at(i)=='!' ||
5768  result.at(i)=='?')
5769  {
5770  i++; // we want to be "behind" last inspected character
5771  break;
5772  }
5773  }
5774  }
5775  if ( i < l) result=result.left(i)+"...";
5776  return result.data();
5777 }

引用了 QCString::at(), Config_getBool, convertCharEntitiesToUTF8(), createDocParser(), QCString::data(), FALSE, QCString::isEmpty(), QCString::left(), QCString::length(), nextUTF8CharPosition(), TextStream::str(), QCString::stripWhiteSpace() , 以及 validatingParseDoc().

被这些函数引用 DefinitionImpl::computeTooltip() , 以及 formatBriefNote().

◆ patternMatch()

bool patternMatch ( const FileInfo fi,
const StringVector patList 
)

在文件 util.cpp6279 行定义.

6280 {
6281  bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
6282  bool found = FALSE;
6283 
6284  // For platforms where the file system is non case sensitive overrule the setting
6286  {
6287  caseSenseNames = FALSE;
6288  }
6289 
6290  if (!patList.empty())
6291  {
6292  std::string fn = fi.fileName();
6293  std::string fp = fi.filePath();
6294  std::string afp= fi.absFilePath();
6295 
6296  for (auto pattern: patList)
6297  {
6298  if (!pattern.empty())
6299  {
6300  size_t i=pattern.find('=');
6301  if (i!=std::string::npos) pattern=pattern.substr(0,i); // strip of the extension specific filter name
6302 
6303  if (!caseSenseNames)
6304  {
6305  pattern = QCString(pattern).lower().str();
6306  fn = QCString(fn).lower().str();
6307  fp = QCString(fp).lower().str();
6308  afp = QCString(afp).lower().str();
6309  }
6310  reg::Ex re(pattern,reg::Ex::Mode::Wildcard);
6311  found = re.isValid() && (reg::match(fn,re) ||
6312  (fn!=fp && reg::match(fp,re)) ||
6313  (fn!=afp && fp!=afp && reg::match(afp,re)));
6314  if (found) break;
6315  //printf("Matching '%s' against pattern '%s' found=%d\n",
6316  // qPrint(fi->fileName()),qPrint(pattern),found);
6317  }
6318  }
6319  }
6320  return found;
6321 }

引用了 FileInfo::absFilePath(), Config_getBool, FALSE, FileInfo::fileName(), FileInfo::filePath(), Portable::fileSystemIsCaseSensitive(), reg::Ex::isValid(), QCString::lower(), reg::match(), QCString::str() , 以及 reg::Ex::Wildcard.

被这些函数引用 readDir().

◆ processMarkup()

QCString processMarkup ( const QCString s)

◆ protectionLevelVisible()

bool protectionLevelVisible ( Protection  prot)

◆ readInputFile()

bool readInputFile ( const QCString fileName,
BufStr inBuf,
bool  filter = TRUE,
bool  isSourceCode = FALSE 
)

read a file name fileName and optionally filter and transcode it

在文件 util.cpp6158 行定义.

6159 {
6160  // try to open file
6161  int size=0;
6162 
6163  FileInfo fi(fileName.str());
6164  if (!fi.exists()) return FALSE;
6165  QCString filterName = getFileFilter(fileName,isSourceCode);
6166  if (filterName.isEmpty() || !filter)
6167  {
6168  std::ifstream f(fileName.str(),std::ifstream::in | std::ifstream::binary);
6169  if (!f.is_open())
6170  {
6171  err("could not open file %s\n",qPrint(fileName));
6172  return FALSE;
6173  }
6174  size=(int)fi.size();
6175  // read the file
6176  inBuf.skip(size);
6177  f.read(inBuf.data(),size);
6178  if (f.fail())
6179  {
6180  err("problems while reading file %s\n",qPrint(fileName));
6181  return FALSE;
6182  }
6183  }
6184  else
6185  {
6186  QCString cmd=filterName+" \""+fileName+"\"";
6187  Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",qPrint(cmd));
6188  FILE *f=Portable::popen(cmd,"r");
6189  if (!f)
6190  {
6191  err("could not execute filter %s\n",qPrint(filterName));
6192  return FALSE;
6193  }
6194  const int bufSize=1024;
6195  char buf[bufSize];
6196  int numRead;
6197  while ((numRead=(int)fread(buf,1,bufSize,f))>0)
6198  {
6199  //printf(">>>>>>>>Reading %d bytes\n",numRead);
6200  inBuf.addArray(buf,numRead),size+=numRead;
6201  }
6202  Portable::pclose(f);
6203  inBuf.at(inBuf.curPos()) ='\0';
6204  Debug::print(Debug::FilterOutput, 0, "Filter output\n");
6205  Debug::print(Debug::FilterOutput,0,"-------------\n%s\n-------------\n",qPrint(inBuf));
6206  }
6207 
6208  int start=0;
6209  if (size>=2 &&
6210  ((uchar)inBuf.at(0)==0xFF && (uchar)inBuf.at(1)==0xFE) // Little endian BOM
6211  ) // UCS-2LE encoded file
6212  {
6213  transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
6214  "UCS-2LE","UTF-8");
6215  }
6216  else if (size>=2 &&
6217  ((uchar)inBuf.at(0)==0xFE && (uchar)inBuf.at(1)==0xFF) // big endian BOM
6218  ) // UCS-2BE encoded file
6219  {
6220  transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
6221  "UCS-2BE","UTF-8");
6222  }
6223  else if (size>=3 &&
6224  (uchar)inBuf.at(0)==0xEF &&
6225  (uchar)inBuf.at(1)==0xBB &&
6226  (uchar)inBuf.at(2)==0xBF
6227  ) // UTF-8 encoded file
6228  {
6229  inBuf.dropFromStart(3); // remove UTF-8 BOM: no translation needed
6230  }
6231  else // transcode according to the INPUT_ENCODING setting
6232  {
6233  // do character transcoding if needed.
6234  transcodeCharacterBuffer(fileName,inBuf,inBuf.curPos(),
6235  Config_getString(INPUT_ENCODING),"UTF-8");
6236  }
6237 
6238  //inBuf.addChar('\n'); /* to prevent problems under Windows ? */
6239 
6240  // and translate CR's
6241  size=inBuf.curPos()-start;
6242  int newSize=filterCRLF(inBuf.data()+start,size);
6243  //printf("filter char at %p size=%d newSize=%d\n",qPrint(dest)+oldPos,size,newSize);
6244  if (newSize!=size) // we removed chars
6245  {
6246  inBuf.shrink(newSize); // resize the array
6247  //printf(".......resizing from %d to %d result=[%s]\n",oldPos+size,oldPos+newSize,qPrint(dest));
6248  }
6249  inBuf.addChar(0);
6250  return TRUE;
6251 }

引用了 BufStr::addArray(), BufStr::addChar(), BufStr::at(), Config_getString, BufStr::curPos(), BufStr::data(), BufStr::dropFromStart(), err(), FileInfo::exists(), Debug::ExtCmd, FALSE, filterCRLF(), Debug::FilterOutput, getFileFilter(), QCString::isEmpty(), Portable::pclose(), Portable::popen(), Debug::print(), qPrint(), BufStr::shrink(), FileInfo::size(), BufStr::skip(), QCString::str(), transcodeCharacterBuffer() , 以及 TRUE.

被这些函数引用 fileToString() , 以及 parseFile().

◆ recodeString()

QCString recodeString ( const QCString str,
const char *  fromEncoding,
const char *  toEncoding 
)

◆ recognizeFixedForm()

bool recognizeFixedForm ( const QCString contents,
FortranFormat  format 
)

在文件 util.cpp7112 行定义.

7113 {
7114  int column=0;
7115  bool skipLine=FALSE;
7116 
7117  if (format == FortranFormat_Fixed) return TRUE;
7118  if (format == FortranFormat_Free) return FALSE;
7119 
7120  for (int i=0;;i++)
7121  {
7122  column++;
7123 
7124  switch(contents[i])
7125  {
7126  case '\n':
7127  column=0;
7128  skipLine=FALSE;
7129  break;
7130  case ' ':
7131  break;
7132  case '\000':
7133  return FALSE;
7134  case '#':
7135  skipLine=TRUE;
7136  break;
7137  case 'C':
7138  case 'c':
7139  case '*':
7140  if (column==1) return TRUE;
7141  if (skipLine) break;
7142  return FALSE;
7143  case '!':
7144  if (column>1 && column<7) return FALSE;
7145  skipLine=TRUE;
7146  break;
7147  default:
7148  if (skipLine) break;
7149  if (column>=7) return TRUE;
7150  return FALSE;
7151  }
7152  }
7153  return FALSE;
7154 }

引用了 FALSE, FortranFormat_Fixed, FortranFormat_Free , 以及 TRUE.

◆ relativePathToRoot()

QCString relativePathToRoot ( const QCString name)

在文件 util.cpp3656 行定义.

3657 {
3658  QCString result;
3659  if (Config_getBool(CREATE_SUBDIRS))
3660  {
3661  if (name.isEmpty())
3662  {
3663  return REL_PATH_TO_ROOT;
3664  }
3665  else
3666  {
3667  int i = name.findRev('/');
3668  if (i!=-1)
3669  {
3670  result=REL_PATH_TO_ROOT;
3671  }
3672  }
3673  }
3674  return result;
3675 }

引用了 Config_getBool, QCString::findRev(), QCString::isEmpty() , 以及 REL_PATH_TO_ROOT.

被这些函数引用 generateBriefDoc(), RTFGenerator::startFile(), HtmlGenerator::startFile(), LatexGenerator::startFile(), DocbookGenerator::startFile() , 以及 validatingParseDoc().

◆ removeAnonymousScopes()

QCString removeAnonymousScopes ( const QCString str)

Removes all anonymous scopes from string s Possible examples:

   "bla::@10::blep"      => "bla::blep"
   "bla::@10::@11::blep" => "bla::blep"
   "@10::blep"           => "blep"
   " @10::blep"          => "blep"
   "@9::@10::blep"       => "blep"
   "bla::@1"             => "bla"
   "bla::@1::@2"         => "bla"
   "bla @1"              => "bla"

在文件 util.cpp166 行定义.

167 {
168  std::string result;
169  if (str.isEmpty()) return QCString(result);
170 
171  // helper to check if the found delimiter starts with a colon
172  auto startsWithColon = [](const std::string &del)
173  {
174  for (size_t i=0;i<del.size();i++)
175  {
176  if (del[i]=='@') return false;
177  else if (del[i]==':') return true;
178  }
179  return false;
180  };
181 
182  // helper to check if the found delimiter ends with a colon
183  auto endsWithColon = [](const std::string &del)
184  {
185  for (int i=(int)del.size()-1;i>=0;i--)
186  {
187  if (del[i]=='@') return false;
188  else if (del[i]==':') return true;
189  }
190  return false;
191  };
192 
193  static const reg::Ex re(R"([\s:]*@\d+[\s:]*)");
194  std::string s = str.str();
195  reg::Iterator iter(s,re);
197  size_t p=0;
198  size_t sl=s.length();
199  bool needsSeparator=false;
200  for ( ; iter!=end ; ++iter)
201  {
202  const auto &match = *iter;
203  size_t i = match.position();
204  if (i>p) // add non-matching prefix
205  {
206  if (needsSeparator) result+="::";
207  needsSeparator=false;
208  result+=s.substr(p,i-p);
209  }
210  std::string delim = match.str();
211  needsSeparator = needsSeparator || (startsWithColon(delim) && endsWithColon(delim));
212  p = match.position()+match.length();
213  }
214  if (p<sl) // add trailing remainder
215  {
216  if (needsSeparator) result+="::";
217  result+=s.substr(p);
218  }
219  return result;
220 }

引用了 end(), reg::match() , 以及 TextStream::str().

被这些函数引用 createTagLessInstance(), makeDisplayName(), simplifyTypeForTable() , 以及 MemberDefImpl::writeDeclaration().

◆ removeEmptyLines()

QCString removeEmptyLines ( const QCString s)

在文件 util.cpp7251 行定义.

7252 {
7253  BufStr out(s.length()+1);
7254  const char *p=s.data();
7255  if (p)
7256  {
7257  char c;
7258  while ((c=*p++))
7259  {
7260  if (c=='\n')
7261  {
7262  const char *e = p;
7263  while (*e==' ' || *e=='\t') e++;
7264  if (*e=='\n')
7265  {
7266  p=e;
7267  }
7268  else out.addChar(c);
7269  }
7270  else
7271  {
7272  out.addChar(c);
7273  }
7274  }
7275  }
7276  out.addChar('\0');
7277  //printf("removeEmptyLines(%s)=%s\n",qPrint(s),qPrint(out));
7278  return out.data();
7279 }

引用了 BufStr::addChar(), BufStr::data(), QCString::data() , 以及 QCString::length().

被这些函数引用 substituteHtmlKeywords() , 以及 substituteLatexKeywords().

◆ removeRedundantWhiteSpace()

QCString removeRedundantWhiteSpace ( const QCString s)

在文件 util.cpp544 行定义.

545 {
546  bool cliSupport = Config_getBool(CPP_CLI_SUPPORT);
547  bool vhdl = Config_getBool(OPTIMIZE_OUTPUT_VHDL);
548 
549  if (s.isEmpty() || vhdl) return s;
550 
551  // We use a static character array to
552  // improve the performance of this function
553  // and thread_local is needed to make it multi-thread safe
554  static THREAD_LOCAL char *growBuf = 0;
555  static THREAD_LOCAL int growBufLen = 0;
556  if ((int)s.length()*3>growBufLen) // For input character we produce at most 3 output characters,
557  {
558  growBufLen = s.length()*3;
559  growBuf = (char *)realloc(growBuf,growBufLen+1); // add 1 for 0-terminator
560  }
561  if (growBuf==0) return s; // should not happen, only we run out of memory
562 
563  const char *src=s.data();
564  char *dst=growBuf;
565 
566  uint i=0;
567  uint l=s.length();
568  uint csp=0;
569  uint vosp=0;
570  uint vsp=0;
571  uint osp=0;
572  char c;
573  char pc=0;
574  // skip leading whitespace
575  while (i<l && isspace((uchar)src[i]))
576  {
577  i++;
578  }
579  for (;i<l;i++)
580  {
581  c=src[i];
582  char nc=i<l-1 ? src[i+1] : ' ';
583 
584  // search for "const"
585  if (csp<6 && c==constScope[csp] && // character matches substring "const"
586  (csp>0 || // inside search string
587  i==0 || // if it is the first character
588  !isId(pc) // the previous may not be a digit
589  )
590  )
591  csp++;
592  else // reset counter
593  csp=0;
594 
595  if (vosp<6 && c==volatileScope[vosp] && // character matches substring "volatile"
596  (vosp>0 || // inside search string
597  i==0 || // if it is the first character
598  !isId(pc) // the previous may not be a digit
599  )
600  )
601  vosp++;
602  else // reset counter
603  vosp=0;
604 
605  // search for "virtual"
606  if (vsp<8 && c==virtualScope[vsp] && // character matches substring "virtual"
607  (vsp>0 || // inside search string
608  i==0 || // if it is the first character
609  !isId(pc) // the previous may not be a digit
610  )
611  )
612  vsp++;
613  else // reset counter
614  vsp=0;
615 
616  // search for "operator"
617  if (osp<11 && (osp>=8 || c==operatorScope[osp]) && // character matches substring "operator" followed by 3 arbitrary characters
618  (osp>0 || // inside search string
619  i==0 || // if it is the first character
620  !isId(pc) // the previous may not be a digit
621  )
622  )
623  osp++;
624  else // reset counter
625  osp=0;
626 
627  switch(c)
628  {
629  case '"': // quoted string
630  {
631  *dst++=c;
632  pc = c;
633  i++;
634  for (;i<l;i++) // find end of string
635  {
636  c = src[i];
637  *dst++=c;
638  if (c=='\\' && i+1<l)
639  {
640  pc = c;
641  i++;
642  c = src[i];
643  *dst++=c;
644  }
645  else if (c=='"')
646  {
647  break;
648  }
649  pc = c;
650  }
651  }
652  break;
653  case '<': // current char is a <
654  *dst++=c;
655  if (i<l-1 &&
656  (isId(nc)) && // next char is an id char
657  (osp<8) // string in front is not "operator"
658  )
659  {
660  *dst++=' '; // add extra space
661  }
662  break;
663  case '>': // current char is a >
664  if (i>0 && !isspace((uchar)pc) &&
665  (isId(pc) || pc=='*' || pc=='&' || pc=='.' || pc=='>') && // prev char is an id char or space or *&.
666  (osp<8 || (osp==8 && pc!='-')) // string in front is not "operator>" or "operator->"
667  )
668  {
669  *dst++=' '; // add extra space in front
670  }
671  *dst++=c;
672  if (i<l-1 && (nc=='-' || nc=='&')) // '>-' -> '> -'
673  {
674  *dst++=' '; // add extra space after
675  }
676  break;
677  case ',': // current char is a ,
678  *dst++=c;
679  if (i>0 && !isspace((uchar)pc) &&
680  ((i<l-1 && (isId(nc) || nc=='[')) || // the [ is for attributes (see bug702170)
681  (i<l-2 && nc=='$' && isId(src[i+2])) || // for PHP: ',$name' -> ', $name'
682  (i<l-3 && nc=='&' && src[i+2]=='$' && isId(src[i+3])) // for PHP: ',&$name' -> ', &$name'
683  )
684  )
685  {
686  *dst++=' '; // add extra space after
687  }
688  break;
689  case '^': // CLI 'Type^name' -> 'Type^ name'
690  case '%': // CLI 'Type%name' -> 'Type% name'
691  *dst++=c;
692  if (cliSupport && i<l-1 && (isId(nc) || nc=='-'))
693  {
694  *dst++=' '; // add extra space after
695  }
696  break;
697  case ')': // current char is a ) -> ')name' -> ') name'
698  *dst++=c;
699  if (i<l-1 && (isId(nc) || nc=='-'))
700  {
701  *dst++=' '; // add extra space after
702  }
703  break;
704  case '*':
705  if (i>0 && pc!=' ' && pc!='\t' && pc!=':' &&
706  pc!='*' && pc!='&' && pc!='(' && pc!='/' &&
707  pc!='.' && osp<9
708  )
709  // avoid splitting &&, **, .*, operator*, operator->*
710  {
711  *dst++=' ';
712  }
713  *dst++=c;
714  break;
715  case '&':
716  if (i>0 && isId(pc) && osp<9)
717  {
718  if (nc != '=')
719  // avoid splitting operator&=
720  {
721  *dst++=' ';
722  }
723  }
724  *dst++=c;
725  break;
726  case '$': // '$name' -> ' $name'
727  // 'name$name' -> 'name$name'
728  if (isId(pc))
729  {
730  *dst++=c;
731  break;
732  }
733  // else fallthrough
734  case '@': // '@name' -> ' @name'
735  case '\'': // ''name' -> '' name'
736  if (i>0 && i<l-1 && pc!='=' && pc!=':' && !isspace((uchar)pc) &&
737  isId(nc) && osp<8) // ")id" -> ") id"
738  {
739  *dst++=' ';
740  }
741  *dst++=c;
742  break;
743  case ':': // current char is a :
744  if (csp==6) // replace const::A by const ::A
745  {
746  *dst++=' ';
747  csp=0;
748  }
749  else if (vosp==9) // replace volatile::A by volatile ::A
750  {
751  *dst++=' ';
752  vosp=0;
753  }
754  else if (vsp==8) // replace virtual::A by virtual ::A
755  {
756  *dst++=' ';
757  vsp=0;
758  }
759  *dst++=c;
760  break;
761  case ' ': // fallthrough
762  case '\n': // fallthrough
763  case '\t':
764  {
766  g_charAroundSpace.charMap[(uchar)nc].after &&
767  !(pc==',' && nc=='.') &&
768  (osp<8 || (osp>=8 && isId(pc) && isId(nc)))
769  // e.g. 'operator >>' -> 'operator>>',
770  // 'operator "" _x' -> 'operator""_x',
771  // but not 'operator int' -> 'operatorint'
772  )
773  { // keep space
774  *dst++=' ';
775  }
776  else if ((pc=='*' || pc=='&' || pc=='.') && nc=='>')
777  {
778  *dst++=' ';
779  }
780  }
781  break;
782  default:
783  *dst++=c;
784  if (c=='t' && csp==5 && i<l-1 && // found 't' in 'const'
785  !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
786  ) // prevent const ::A from being converted to const::A
787  {
788  *dst++=' ';
789  csp=0;
790  }
791  else if (c=='e' && vosp==8 && i<l-1 && // found 'e' in 'volatile'
792  !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
793  ) // prevent volatile ::A from being converted to volatile::A
794  {
795  *dst++=' ';
796  vosp=0;
797  }
798  else if (c=='l' && vsp==7 && i<l-1 && // found 'l' in 'virtual'
799  !(isId(nc) || nc==')' || nc==',' || isspace((uchar)nc))
800  ) // prevent virtual ::A from being converted to virtual::A
801  {
802  *dst++=' ';
803  vsp=0;
804  }
805  break;
806  }
807  pc=c;
808  }
809  *dst++='\0';
810  //printf("removeRedundantWhitespace(%s)->%s\n",qPrint(s),growBuf);
811  return growBuf;
812 }

引用了 CharAroundSpace::CharElem::before, CharAroundSpace::charMap, Config_getBool, constScope, QCString::data(), g_charAroundSpace, QCString::isEmpty(), isId(), reg::isspace(), QCString::length(), operatorScope, THREAD_LOCAL, virtualScope , 以及 volatileScope.

被这些函数引用 addVariableToClass(), argListToString(), extractCanonicalType(), findClassRelation(), DocParser::findDocsForMemberOrCompound(), findMember(), findUsedClassesForClass(), findUsingDeclImports(), getCanonicalTypeForIdentifier(), SymbolResolver::Private::getResolvedClassRec(), MemberDefImpl::IMPL::init(), ClassDefImpl::insertTemplateInstance(), normalizeNonTemplateArgumentsInString(), resolveRef(), tempArgListToString() , 以及 writeExceptionListImpl().

◆ replaceAnonymousScopes()

QCString replaceAnonymousScopes ( const QCString s,
const QCString replacement = QCString() 
)

在文件 util.cpp223 行定义.

224 {
225  if (s.isEmpty()) return s;
226  static const reg::Ex marker(R"(@\d+)");
227  std::string result = reg::replace(s.str(),marker,
228  replacement.isEmpty() ? replacement.data() : "__anonymous__");
229  //printf("replaceAnonymousScopes('%s')='%s'\n",qPrint(s),qPrint(result));
230  return QCString(result);
231 }

引用了 QCString::data(), QCString::isEmpty(), reg::replace() , 以及 QCString::str().

被这些函数引用 generateDEFForMember().

◆ replaceColorMarkers()

QCString replaceColorMarkers ( const QCString str)

Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC, where #AABBCC represents a valid color, based on the intensity represented by hex number AA and the current HTML_COLORSTYLE_* settings.

在文件 util.cpp6387 行定义.

6388 {
6389  if (str.isEmpty()) return QCString();
6390  std::string result;
6391  std::string s=str.str();
6392  static const reg::Ex re(R"(##[0-9A-Fa-f][0-9A-Fa-f])");
6393  reg::Iterator it(s,re);
6395  static int hue = Config_getInt(HTML_COLORSTYLE_HUE);
6396  static int sat = Config_getInt(HTML_COLORSTYLE_SAT);
6397  static int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA);
6398  size_t sl=s.length();
6399  size_t p=0;
6400  for (; it!=end ; ++it)
6401  {
6402  const auto &match = *it;
6403  size_t i = match.position();
6404  size_t l = match.length();
6405  if (i>p) result+=s.substr(p,i-p);
6406  std::string lumStr = match.str().substr(2);
6407 #define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
6408  ((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
6409  ((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
6410 
6411  double r,g,b;
6412  int red,green,blue;
6413  int level = HEXTONUM(lumStr[0])*16+HEXTONUM(lumStr[1]);
6414  ColoredImage::hsl2rgb(hue/360.0,sat/255.0,
6415  pow(level/255.0,gamma/100.0),&r,&g,&b);
6416  red = (int)(r*255.0);
6417  green = (int)(g*255.0);
6418  blue = (int)(b*255.0);
6419  char colStr[8];
6420  colStr[0]='#';
6421  colStr[1]=hex[red>>4];
6422  colStr[2]=hex[red&0xf];
6423  colStr[3]=hex[green>>4];
6424  colStr[4]=hex[green&0xf];
6425  colStr[5]=hex[blue>>4];
6426  colStr[6]=hex[blue&0xf];
6427  colStr[7]=0;
6428  //printf("replacing %s->%s (level=%d)\n",qPrint(lumStr),colStr,level);
6429  result+=colStr;
6430  p=i+l;
6431  }
6432  if (p<sl) result+=s.substr(p);
6433  return QCString(result);
6434 }

引用了 Config_getInt, end(), hex, HEXTONUM, ColoredImage::hsl2rgb(), QCString::isEmpty(), reg::match() , 以及 QCString::str().

被这些函数引用 ResourceMgr::copyResourceAs(), HtmlGenerator::writeSearchData(), HtmlGenerator::writeStyleInfo() , 以及 HtmlGenerator::writeStyleSheetFile().

◆ replaceNamespaceAliases()

void replaceNamespaceAliases ( QCString scope,
int  i 
)

在文件 util.cpp5300 行定义.

5301 {
5302  while (i>0)
5303  {
5304  QCString ns = scope.left(i);
5305  if (!ns.isEmpty())
5306  {
5307  auto it = Doxygen::namespaceAliasMap.find(ns.str());
5308  if (it!=Doxygen::namespaceAliasMap.end())
5309  {
5310  scope=QCString(it->second)+scope.right(scope.length()-i);
5311  i=static_cast<int>(it->second.length());
5312  }
5313  }
5314  if (i>0 && ns==scope.left(i)) break;
5315  }
5316 }

引用了 end(), QCString::isEmpty(), QCString::left(), QCString::length(), Doxygen::namespaceAliasMap, QCString::right() , 以及 QCString::str().

被这些函数引用 findClassRelation(), findUsedClassesForClass(), getMemberFromSymbol() , 以及 SymbolResolver::Private::getResolvedClassRec().

◆ resolveAliasCmd()

QCString resolveAliasCmd ( const QCString aliasCmd)

在文件 util.cpp6050 行定义.

6051 {
6052  QCString result;
6053  StringUnorderedSet aliasesProcessed;
6054  //printf("Expanding: '%s'\n",qPrint(aliasCmd));
6055  result = expandAliasRec(aliasesProcessed,aliasCmd);
6056  //printf("Expanding result: '%s'->'%s'\n",qPrint(aliasCmd),qPrint(result));
6057  return result;
6058 }

引用了 expandAliasRec().

◆ resolveLink()

bool resolveLink ( const QCString scName,
const QCString lr,
bool  inSeeBlock,
const Definition **  resContext,
QCString resAnchor 
)

在文件 util.cpp3037 行定义.

3043 {
3044  *resContext=0;
3045 
3046  QCString linkRef=lr;
3047  QCString linkRefWithoutTemplates = stripTemplateSpecifiersFromScope(linkRef,FALSE);
3048  //printf("ResolveLink linkRef=%s\n",qPrint(lr));
3049  const FileDef *fd;
3050  const GroupDef *gd;
3051  const PageDef *pd;
3052  const ClassDef *cd;
3053  const DirDef *dir;
3054  const ConceptDef *cnd;
3055  const NamespaceDef *nd;
3056  const SectionInfo *si=0;
3057  bool ambig;
3058  if (linkRef.isEmpty()) // no reference name!
3059  {
3060  return FALSE;
3061  }
3062  else if ((pd=Doxygen::pageLinkedMap->find(linkRef))) // link to a page
3063  {
3064  gd = pd->getGroupDef();
3065  if (gd)
3066  {
3067  if (!pd->name().isEmpty()) si=SectionManager::instance().find(pd->name());
3068  *resContext=gd;
3069  if (si) resAnchor = si->label();
3070  }
3071  else
3072  {
3073  *resContext=pd;
3074  }
3075  return TRUE;
3076  }
3077  else if ((si=SectionManager::instance().find(linkRef)))
3078  {
3079  *resContext=si->definition();
3080  resAnchor = si->label();
3081  return TRUE;
3082  }
3083  else if ((pd=Doxygen::exampleLinkedMap->find(linkRef))) // link to an example
3084  {
3085  *resContext=pd;
3086  return TRUE;
3087  }
3088  else if ((gd=Doxygen::groupLinkedMap->find(linkRef))) // link to a group
3089  {
3090  *resContext=gd;
3091  return TRUE;
3092  }
3093  else if ((fd=findFileDef(Doxygen::inputNameLinkedMap,linkRef,ambig)) // file link
3094  && fd->isLinkable())
3095  {
3096  *resContext=fd;
3097  return TRUE;
3098  }
3099  else if ((cd=getClass(linkRef))) // class link
3100  {
3101  *resContext=cd;
3102  resAnchor=cd->anchor();
3103  return TRUE;
3104  }
3105  else if ((cd=getClass(linkRefWithoutTemplates))) // C#/Java generic class link
3106  {
3107  *resContext=cd;
3108  resAnchor=cd->anchor();
3109  return TRUE;
3110  }
3111  else if ((cd=getClass(linkRef+"-p"))) // Obj-C protocol link
3112  {
3113  *resContext=cd;
3114  resAnchor=cd->anchor();
3115  return TRUE;
3116  }
3117  else if ((cnd=getConcept(linkRef))) // C++20 concept definition
3118  {
3119  *resContext=cnd;
3120  resAnchor=cnd->anchor();
3121  return TRUE;
3122  }
3123  else if ((nd=Doxygen::namespaceLinkedMap->find(linkRef)))
3124  {
3125  *resContext=nd;
3126  return TRUE;
3127  }
3128  else if ((dir=Doxygen::dirLinkedMap->find(FileInfo(linkRef.str()).absFilePath()+"/"))
3129  && dir->isLinkable()) // TODO: make this location independent like filedefs
3130  {
3131  *resContext=dir;
3132  return TRUE;
3133  }
3134  else // probably a member reference
3135  {
3136  const MemberDef *md = 0;
3137  bool res = resolveRef(scName,lr,TRUE,resContext,&md);
3138  if (md) resAnchor=md->anchor();
3139  return res;
3140  }
3141 }

引用了 FileInfo::absFilePath(), ConceptDef::anchor(), MemberDef::anchor(), ClassDef::anchor(), SectionInfo::definition(), Doxygen::dirLinkedMap, Doxygen::exampleLinkedMap, FALSE, LinkedMap< T, Hash, KeyEqual, Map >::find(), findFileDef(), getClass(), getConcept(), PageDef::getGroupDef(), Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, SectionManager::instance(), QCString::isEmpty(), FileDef::isLinkable(), DirDef::isLinkable(), SectionInfo::label(), Definition::name(), Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, resolveRef(), QCString::str(), stripTemplateSpecifiersFromScope() , 以及 TRUE.

被这些函数引用 DocLink::DocLink(), DocRef::DocRef(), generateLink() , 以及 LayoutNavEntry::url().

◆ resolveRef()

bool resolveRef ( const QCString scName,
const QCString name,
bool  inSeeBlock,
const Definition **  resContext,
const MemberDef **  resMember,
bool  lookForSpecialization,
const FileDef currentFile,
bool  checkScope 
)

Returns an object to reference to given its name and context

后置条件
return value TRUE implies *resContext!=0 or *resMember!=0

在文件 util.cpp2757 行定义.

2766 {
2767  //printf("resolveRef(scope=%s,name=%s,inSeeBlock=%d)\n",qPrint(scName),qPrint(name),inSeeBlock);
2768  QCString tsName = name;
2769  //bool memberScopeFirst = tsName.find('#')!=-1;
2770  QCString fullName = substitute(tsName,"#","::");
2771  if (fullName.find("anonymous_namespace{")==-1)
2772  {
2773  fullName = removeRedundantWhiteSpace(substitute(fullName,".","::",3));
2774  }
2775  else
2776  {
2777  fullName = removeRedundantWhiteSpace(fullName);
2778  }
2779 
2780  int bracePos=findParameterList(fullName);
2781  int endNamePos=bracePos!=-1 ? bracePos : fullName.length();
2782  int scopePos=fullName.findRev("::",endNamePos);
2783  bool explicitScope = fullName.left(2)=="::" && // ::scope or #scope
2784  (scopePos>2 || // ::N::A
2785  tsName.left(2)=="::" || // ::foo in local scope
2786  scName==0 // #foo in global scope
2787  );
2788 
2789  // default result values
2790  *resContext=0;
2791  *resMember=0;
2792 
2793  if (bracePos==-1) // simple name
2794  {
2795  ClassDef *cd=0;
2796  NamespaceDef *nd=0;
2797 
2798  // the following if() was commented out for releases in the range
2799  // 1.5.2 to 1.6.1, but has been restored as a result of bug report 594787.
2800  if (!inSeeBlock && scopePos==-1 && isLowerCase(tsName))
2801  { // link to lower case only name => do not try to autolink
2802  return FALSE;
2803  }
2804 
2805  //printf("scName=%s fullName=%s\n",scName,qPrint(fullName));
2806 
2807  // check if this is a class or namespace reference
2808  if (scName!=fullName && getScopeDefs(scName,fullName,cd,nd))
2809  {
2810  if (cd) // scope matches that of a class
2811  {
2812  *resContext = cd;
2813  }
2814  else // scope matches that of a namespace
2815  {
2816  ASSERT(nd!=0);
2817  *resContext = nd;
2818  }
2819  return TRUE;
2820  }
2821  else if (scName==fullName || (!inSeeBlock && scopePos==-1))
2822  // nothing to link => output plain text
2823  {
2824  //printf("found scName=%s fullName=%s scName==fullName=%d "
2825  // "inSeeBlock=%d scopePos=%d!\n",
2826  // scName,qPrint(fullName),scName==fullName,inSeeBlock,scopePos);
2827  return FALSE;
2828  }
2829  // continue search...
2830  }
2831 
2832  // extract userscope+name
2833  QCString nameStr=fullName.left(endNamePos);
2834  if (explicitScope) nameStr=nameStr.mid(2);
2835 
2836  // extract arguments
2837  QCString argsStr;
2838  if (bracePos!=-1) argsStr=fullName.right(fullName.length()-bracePos);
2839 
2840  // strip template specifier
2841  // TODO: match against the correct partial template instantiation
2842  int templPos=nameStr.find('<');
2843  bool tryUnspecializedVersion = FALSE;
2844  if (templPos!=-1 && nameStr.find("operator")==-1)
2845  {
2846  int endTemplPos=nameStr.findRev('>');
2847  if (endTemplPos!=-1)
2848  {
2849  if (!lookForSpecialization)
2850  {
2851  nameStr=nameStr.left(templPos)+nameStr.right(nameStr.length()-endTemplPos-1);
2852  }
2853  else
2854  {
2855  tryUnspecializedVersion = TRUE;
2856  }
2857  }
2858  }
2859 
2860  QCString scopeStr=scName;
2861 
2862  const MemberDef *md = 0;
2863  const ClassDef *cd = 0;
2864  const FileDef *fd = 0;
2865  const NamespaceDef *nd = 0;
2866  const GroupDef *gd = 0;
2867  const ConceptDef *cnd = 0;
2868 
2869  // check if nameStr is a member or global.
2870  //printf("getDefs(scope=%s,name=%s,args=%s checkScope=%d)\n",
2871  // qPrint(scopeStr), qPrint(nameStr), qPrint(argsStr),checkScope);
2872  if (getDefs(scopeStr,nameStr,argsStr,
2873  md,cd,fd,nd,gd,
2874  //scopePos==0 && !memberScopeFirst, // forceEmptyScope
2875  explicitScope, // replaces prev line due to bug 600829
2876  currentFile,
2877  TRUE // checkCV
2878  )
2879  )
2880  {
2881  //printf("after getDefs checkScope=%d nameStr=%s cd=%p nd=%p\n",checkScope,qPrint(nameStr),cd,nd);
2882  if (checkScope && md && md->getOuterScope()==Doxygen::globalScope &&
2883  !md->isStrongEnumValue() &&
2884  (!scopeStr.isEmpty() || nameStr.find("::")>0))
2885  {
2886  // we did find a member, but it is a global one while we were explicitly
2887  // looking for a scoped variable. See bug 616387 for an example why this check is needed.
2888  // note we do need to support autolinking to "::symbol" hence the >0
2889  //printf("not global member!\n");
2890  *resContext=0;
2891  *resMember=0;
2892  return FALSE;
2893  }
2894  //printf("after getDefs md=%p cd=%p fd=%p nd=%p gd=%p\n",md,cd,fd,nd,gd);
2895  if (md) { *resMember=md; *resContext=md; }
2896  else if (cd) *resContext=cd;
2897  else if (nd) *resContext=nd;
2898  else if (fd) *resContext=fd;
2899  else if (gd) *resContext=gd;
2900  else { *resContext=0; *resMember=0; return FALSE; }
2901  //printf("member=%s (md=%p) anchor=%s linkable()=%d context=%s\n",
2902  // qPrint(md->name()), md, qPrint(md->anchor()), md->isLinkable(), qPrint((*resContext)->name()));
2903  return TRUE;
2904  }
2905  else if (inSeeBlock && !nameStr.isEmpty() && (gd=Doxygen::groupLinkedMap->find(nameStr)))
2906  { // group link
2907  *resContext=gd;
2908  return TRUE;
2909  }
2910  else if ((cnd=Doxygen::conceptLinkedMap->find(nameStr)))
2911  {
2912  *resContext=cnd;
2913  return TRUE;
2914  }
2915  else if (tsName.find('.')!=-1) // maybe a link to a file
2916  {
2917  bool ambig;
2918  fd=findFileDef(Doxygen::inputNameLinkedMap,tsName,ambig);
2919  if (fd && !ambig)
2920  {
2921  *resContext=fd;
2922  return TRUE;
2923  }
2924  }
2925 
2926  if (tryUnspecializedVersion)
2927  {
2928  return resolveRef(scName,name,inSeeBlock,resContext,resMember,FALSE,0,checkScope);
2929  }
2930  if (bracePos!=-1) // Try without parameters as well, could be a constructor invocation
2931  {
2932  *resContext=getClass(fullName.left(bracePos));
2933  if (*resContext)
2934  {
2935  return TRUE;
2936  }
2937  }
2938  //printf("resolveRef: %s not found!\n",name);
2939 
2940  return FALSE;
2941 }

引用了 ASSERT, Doxygen::conceptLinkedMap, FALSE, LinkedMap< T, Hash, KeyEqual, Map >::find(), QCString::find(), findFileDef(), findParameterList(), QCString::findRev(), getClass(), getDefs(), Definition::getOuterScope(), getScopeDefs(), Doxygen::globalScope, Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, QCString::isEmpty(), isLowerCase(), MemberDef::isStrongEnumValue(), QCString::left(), QCString::length(), QCString::mid(), removeRedundantWhiteSpace(), resolveRef(), QCString::right(), substitute() , 以及 TRUE.

被这些函数引用 DocParser::handleLinkedWord(), resolveLink() , 以及 resolveRef().

◆ resolveTypeDef()

QCString resolveTypeDef ( const Definition d,
const QCString name,
const Definition **  typedefContext = 0 
)

在文件 util.cpp364 行定义.

366 {
367  //printf("<<resolveTypeDef(%s,%s)\n",
368  // context ? qPrint(context->name()) : "<none>",qPrint(qualifiedName));
369  QCString result;
370  if (qualifiedName.isEmpty())
371  {
372  //printf(" qualified name empty!\n");
373  return result;
374  }
375 
376  const Definition *mContext=context;
377  if (typedefContext) *typedefContext=context;
378 
379  // see if the qualified name has a scope part
380  int scopeIndex = qualifiedName.findRev("::");
381  QCString resName=qualifiedName;
382  if (scopeIndex!=-1) // strip scope part for the name
383  {
384  resName=qualifiedName.right(qualifiedName.length()-scopeIndex-2);
385  if (resName.isEmpty())
386  {
387  // qualifiedName was of form A:: !
388  //printf(" qualified name of form A::!\n");
389  return result;
390  }
391  }
392  const MemberDef *md=0;
393  while (mContext && md==0)
394  {
395  // step 1: get the right scope
396  const Definition *resScope=mContext;
397  if (scopeIndex!=-1)
398  {
399  // split-off scope part
400  QCString resScopeName = qualifiedName.left(scopeIndex);
401  //printf("resScopeName='%s'\n",qPrint(resScopeName));
402 
403  // look-up scope in context
404  int is,ps=0;
405  int l;
406  while ((is=getScopeFragment(resScopeName,ps,&l))!=-1)
407  {
408  QCString qualScopePart = resScopeName.mid(is,l);
409  QCString tmp = resolveTypeDef(mContext,qualScopePart);
410  if (!tmp.isEmpty()) qualScopePart=tmp;
411  resScope = resScope->findInnerCompound(qualScopePart);
412  //printf("qualScopePart='%s' resScope=%p\n",qPrint(qualScopePart),resScope);
413  if (resScope==0) break;
414  ps=is+l;
415  }
416  }
417  //printf("resScope=%s\n",resScope? qPrint(resScope->name()) : "<none>");
418 
419  // step 2: get the member
420  if (resScope) // no scope or scope found in the current context
421  {
422  //printf("scope found: %s, look for typedef %s\n",
423  // qPrint(resScope->qualifiedName()),qPrint(resName));
424  MemberNameLinkedMap *mnd=0;
425  if (resScope->definitionType()==Definition::TypeClass)
426  {
428  }
429  else
430  {
432  }
433  MemberName *mn=mnd->find(resName);
434  if (mn)
435  {
436  int minDist=-1;
437  for (const auto &tmd_p : *mn)
438  {
439  const MemberDef *tmd = tmd_p.get();
440  //printf("Found member %s resScope=%s outerScope=%s mContext=%p\n",
441  // qPrint(tmd->name()),qPrint( resScope->name()),
442  // qPrint(tmd->getOuterScope()->name()), mContext);
443  if (tmd->isTypedef() /*&& tmd->getOuterScope()==resScope*/)
444  {
445  SymbolResolver resolver;
446  int dist=resolver.isAccessibleFrom(resScope,tmd);
447  if (dist!=-1 && (md==0 || dist<minDist))
448  {
449  md = tmd;
450  minDist = dist;
451  }
452  }
453  }
454  }
455  }
456  mContext=mContext->getOuterScope();
457  }
458 
459  // step 3: get the member's type
460  if (md)
461  {
462  //printf(">>resolveTypeDef: Found typedef name '%s' in scope '%s' value='%s' args='%s'\n",
463  // qPrint(qualifiedName),qPrint(context->name()),md->typeString(),md->argsString()
464  // );
465  result=md->typeString();
466  QCString args = md->argsString();
467  if (args.find(")(")!=-1) // typedef of a function/member pointer
468  {
469  result+=args;
470  }
471  else if (args.find('[')!=-1) // typedef of an array
472  {
473  result+=args;
474  }
475  if (typedefContext) *typedefContext=md->getOuterScope();
476  }
477  else
478  {
479  //printf(">>resolveTypeDef: Typedef '%s' not found in scope '%s'!\n",
480  // qPrint(qualifiedName),context ? qPrint(context->name()) : "<global>");
481  }
482  return result;
483 
484 }

引用了 MemberDef::argsString(), Definition::definitionType(), LinkedMap< T, Hash, KeyEqual, Map >::find(), QCString::find(), Definition::findInnerCompound(), QCString::findRev(), Doxygen::functionNameLinkedMap, Definition::getOuterScope(), getScopeFragment(), SymbolResolver::isAccessibleFrom(), QCString::isEmpty(), MemberDef::isTypedef(), QCString::left(), QCString::length(), Doxygen::memberNameLinkedMap, QCString::mid(), resolveTypeDef(), QCString::right(), Definition::TypeClass , 以及 MemberDef::typeString().

被这些函数引用 findUsedClassesForClass(), getCanonicalTemplateSpec(), getCanonicalTypeForIdentifier(), isVarWithConstructor() , 以及 resolveTypeDef().

◆ rightScopeMatch()

bool rightScopeMatch ( const QCString scope,
const QCString name 
)

在文件 util.cpp863 行定义.

864 {
865  int sl=scope.length();
866  int nl=name.length();
867  return (name==scope || // equal
868  (scope.right(nl)==name && // substring
869  sl-nl>1 && scope.at(sl-nl-1)==':' && scope.at(sl-nl-2)==':' // scope
870  )
871  );
872 }

引用了 QCString::at(), QCString::length() , 以及 QCString::right().

被这些函数引用 addMemberFunction(), findScopeFromQualifiedName(), getDefs() , 以及 isRecursiveBaseClass().

◆ rtfFormatBmkStr()

QCString rtfFormatBmkStr ( const QCString name)

在文件 util.cpp5230 行定义.

5231 {
5232  std::lock_guard<std::mutex> lock(g_rtfFormatMutex);
5233 
5234  // To overcome the 40-character tag limitation, we
5235  // substitute a short arbitrary string for the name
5236  // supplied, and keep track of the correspondence
5237  // between names and strings.
5238  auto it = g_tagMap.find(name.str());
5239  if (it!=g_tagMap.end()) // already known
5240  {
5241  return QCString(it->second);
5242  }
5243 
5244  QCString tag = g_nextTag;
5245  auto result = g_tagMap.insert( std::make_pair(name.str(), g_nextTag.str()) );
5246 
5247  if (result.second) // new item was added
5248  {
5249  // increment the next tag.
5250 
5251  char* nxtTag = g_nextTag.rawData() + g_nextTag.length() - 1;
5252  for ( unsigned int i = 0; i < g_nextTag.length(); ++i, --nxtTag )
5253  {
5254  if ( ( ++(*nxtTag) ) > 'Z' )
5255  {
5256  *nxtTag = 'A';
5257  }
5258  else
5259  {
5260  // Since there was no carry, we can stop now
5261  break;
5262  }
5263  }
5264  }
5265 
5266  Debug::print(Debug::Rtf,0,"Name = %s RTF_tag = %s\n",qPrint(name),qPrint(tag));
5267  return tag;
5268 }

引用了 g_nextTag, g_rtfFormatMutex, g_tagMap, QCString::length(), Debug::print(), qPrint(), QCString::rawData(), Debug::Rtf , 以及 QCString::str().

被这些函数引用 RTFGenerator::endDoxyAnchor(), RTFDocVisitor::startLink(), RTFGenerator::startTextLink(), RTFDocVisitor::visit(), RTFDocVisitor::visitPre(), RTFGenerator::writeAnchor(), RTFGenerator::writeCodeLink(), RTFGenerator::writeLineNumber(), RTFGenerator::writeObjectLink(), RTFGenerator::writeRTFReference() , 以及 RTFGenerator::writeStartAnnoItem().

◆ selectBlock()

QCString selectBlock ( const QCString s,
const QCString name,
bool  enable,
OutputGenerator::OutputType  o 
)

在文件 util.cpp7209 行定义.

7210 {
7211  // TODO: this is an expensive function that is called a lot -> optimize it
7212  QCString begin;
7213  QCString end;
7214  QCString nobegin;
7215  QCString noend;
7216  switch (o)
7217  {
7218  case OutputGenerator::Html:
7219  begin = "<!--BEGIN " + name + "-->";
7220  end = "<!--END " + name + "-->";
7221  nobegin = "<!--BEGIN !" + name + "-->";
7222  noend = "<!--END !" + name + "-->";
7223  break;
7225  begin = "%%BEGIN " + name;
7226  end = "%%END " + name;
7227  nobegin = "%%BEGIN !" + name;
7228  noend = "%%END !" + name;
7229  break;
7230  default:
7231  break;
7232  }
7233 
7234  QCString result = s;
7235  if (enable)
7236  {
7237  result = substitute(result, begin, "");
7238  result = substitute(result, end, "");
7239  result = clearBlock(result, nobegin, noend);
7240  }
7241  else
7242  {
7243  result = substitute(result, nobegin, "");
7244  result = substitute(result, noend, "");
7245  result = clearBlock(result, begin, end);
7246  }
7247 
7248  return result;
7249 }

引用了 begin(), clearBlock(), end(), OutputGenerator::Html, OutputGenerator::Latex , 以及 substitute().

被这些函数引用 substituteHtmlKeywords() , 以及 substituteLatexKeywords().

◆ showFileDefMatches()

QCString showFileDefMatches ( const FileNameLinkedMap fnMap,
const QCString n 
)

在文件 util.cpp3308 行定义.

3309 {
3310  QCString result;
3311  QCString name=n;
3312  QCString path;
3313  int slashPos=std::max(name.findRev('/'),name.findRev('\\'));
3314  if (slashPos!=-1)
3315  {
3316  path=name.left(slashPos+1);
3317  name=name.right(name.length()-slashPos-1);
3318  }
3319  const FileName *fn;
3320  if ((fn=fnMap->find(name)))
3321  {
3322  for (const auto &fd : *fn)
3323  {
3324  if (path.isEmpty() || fd->getPath().right(path.length())==path)
3325  {
3326  result+=" "+fd->absFilePath()+"\n";
3327  }
3328  }
3329  }
3330  return result;
3331 }

引用了 LinkedMap< T, Hash, KeyEqual, Map >::find(), QCString::findRev(), QCString::isEmpty(), QCString::left(), QCString::length() , 以及 QCString::right().

被这些函数引用 addIncludeFile(), buildFileList(), DocParser::findAndCopyImage(), DocDotFile::parse(), DocMscFile::parse(), DocDiaFile::parse() , 以及 DocParser::readTextFileByName().

◆ split() [1/2]

StringVector split ( const std::string &  s,
const reg::Ex delimiter 
)

split input string s by regular expression delimiter delimiter. returns a vector of non-empty strings that are between the delimiters

在文件 util.cpp7300 行定义.

7301 {
7302  StringVector result;
7303  reg::Iterator iter(s, delimiter);
7305  size_t p=0;
7306  for ( ; iter != end; ++iter)
7307  {
7308  const auto &match = *iter;
7309  size_t i=match.position();
7310  size_t l=match.length();
7311  if (i>p) result.push_back(s.substr(p,i-p));
7312  p=i+l;
7313  }
7314  if (p<s.length()) result.push_back(s.substr(p));
7315  return result;
7316 }

引用了 end() , 以及 reg::match().

◆ split() [2/2]

StringVector split ( const std::string &  s,
const std::string &  delimiter 
)

split input string s by string delimiter delimiter. returns a vector of non-empty strings that are between the delimiters

在文件 util.cpp7283 行定义.

7284 {
7285  StringVector result;
7286  size_t prev = 0, pos = 0, len = s.length();
7287  do
7288  {
7289  pos = s.find(delimiter, prev);
7290  if (pos == std::string::npos) pos = len;
7291  if (pos>prev) result.push_back(s.substr(prev,pos-prev));
7292  prev = pos + delimiter.length();
7293  }
7294  while (pos<len && prev<len);
7295  return result;
7296 }

◆ stackTrace()

void stackTrace ( )

在文件 util.cpp6095 行定义.

6096 {
6097 #ifdef TRACINGSUPPORT
6098  void *backtraceFrames[128];
6099  int frameCount = backtrace(backtraceFrames, 128);
6100  static char cmd[40960];
6101  char *p = cmd;
6102  p += sprintf(p,"/usr/bin/atos -p %d ", (int)getpid());
6103  for (int x = 0; x < frameCount; x++)
6104  {
6105  p += sprintf(p,"%p ", backtraceFrames[x]);
6106  }
6107  fprintf(stderr,"========== STACKTRACE START ==============\n");
6108  if (FILE *fp = Portable::popen(cmd, "r"))
6109  {
6110  char resBuf[512];
6111  while (size_t len = fread(resBuf, 1, sizeof(resBuf), fp))
6112  {
6113  fwrite(resBuf, 1, len, stderr);
6114  }
6115  Portable::pclose(fp);
6116  }
6117  fprintf(stderr,"============ STACKTRACE END ==============\n");
6118  //fprintf(stderr,"%s\n", frameStrings[x]);
6119 #endif
6120 }

引用了 Portable::pclose() , 以及 Portable::popen().

◆ stripAnonymousNamespaceScope()

QCString stripAnonymousNamespaceScope ( const QCString s)

在文件 util.cpp235 行定义.

236 {
237  int i,p=0,l;
238  QCString newScope;
239  int sl = s.length();
240  while ((i=getScopeFragment(s,p,&l))!=-1)
241  {
242  //printf("Scope fragment %s\n",qPrint(s.mid(i,l)));
243  if (Doxygen::namespaceLinkedMap->find(s.left(i+l))!=0)
244  {
245  if (s.at(i)!='@')
246  {
247  if (!newScope.isEmpty()) newScope+="::";
248  newScope+=s.mid(i,l);
249  }
250  }
251  else if (i<sl)
252  {
253  if (!newScope.isEmpty()) newScope+="::";
254  newScope+=s.right(sl-i);
255  goto done;
256  }
257  p=i+l;
258  }
259 done:
260  //printf("stripAnonymousNamespaceScope('%s')='%s'\n",qPrint(s),qPrint(newScope));
261  return newScope;
262 }

引用了 QCString::at(), getScopeFragment(), QCString::isEmpty(), QCString::left(), QCString::length(), QCString::mid(), Doxygen::namespaceLinkedMap , 以及 QCString::right().

被这些函数引用 addMemberFunction(), addPageToContext(), buildNamespaceList(), computeTemplateClassRelations(), extractClassName(), findGroupScope(), findUsingDeclImports(), findUsingDirectives(), MemberDefImpl::getClassDefOfAnonymousType() , 以及 resolveClassNestingRelations().

◆ stripExtension()

QCString stripExtension ( const QCString fName)

◆ stripExtensionGeneral()

QCString stripExtensionGeneral ( const QCString fName,
const QCString ext 
)

在文件 util.cpp5285 行定义.

5286 {
5287  QCString result=fName;
5288  if (result.right(ext.length())==ext)
5289  {
5290  result=result.left(result.length()-ext.length());
5291  }
5292  return result;
5293 }

引用了 QCString::left(), QCString::length() , 以及 QCString::right().

被这些函数引用 TooltipManager::addTooltip(), TagFileParser::buildLists(), extraLatexStyleSheet(), MarkdownOutlineParser::parseInput(), stripExtension(), DocbookCodeGenerator::writeCodeLinkLine(), LatexCodeGenerator::writeLineNumber() , 以及 RTFGenerator::writeLineNumber().

◆ stripFromIncludePath()

QCString stripFromIncludePath ( const QCString path)

strip part of path if it matches one of the paths in the Config_getList(INCLUDE_PATH) list

在文件 util.cpp322 行定义.

323 {
324  return stripFromPath(path,Config_getList(STRIP_FROM_INC_PATH));
325 }

引用了 Config_getList , 以及 stripFromPath().

被这些函数引用 addIncludeFile() , 以及 findFileDef().

◆ stripFromPath()

QCString stripFromPath ( const QCString path)

strip part of path if it matches one of the paths in the Config_getList(STRIP_FROM_PATH) list

在文件 util.cpp314 行定义.

315 {
316  return stripFromPath(path,Config_getList(STRIP_FROM_PATH));
317 }

引用了 Config_getList , 以及 stripFromPath().

◆ stripIndentation() [1/2]

QCString stripIndentation ( const QCString s)

在文件 util.cpp6597 行定义.

6598 {
6599  if (s.isEmpty()) return s; // empty string -> we're done
6600 
6601  //printf("stripIndentation:\n%s\n------\n",qPrint(s));
6602  // compute minimum indentation over all lines
6603  const char *p=s.data();
6604  char c;
6605  int indent=0;
6606  int minIndent=1000000; // "infinite"
6607  bool searchIndent=TRUE;
6608  static int tabSize=Config_getInt(TAB_SIZE);
6609  while ((c=*p++))
6610  {
6611  if (c=='\t') indent+=tabSize - (indent%tabSize);
6612  else if (c=='\n') indent=0,searchIndent=TRUE;
6613  else if (c==' ') indent++;
6614  else if (searchIndent)
6615  {
6616  searchIndent=FALSE;
6617  if (indent<minIndent) minIndent=indent;
6618  }
6619  }
6620 
6621  // no indent to remove -> we're done
6622  if (minIndent==0) return s;
6623 
6624  // remove minimum indentation for each line
6625  TextStream result;
6626  p=s.data();
6627  indent=0;
6628  while ((c=*p++))
6629  {
6630  if (c=='\n') // start of new line
6631  {
6632  indent=0;
6633  result << c;
6634  }
6635  else if (indent<minIndent) // skip until we reach minIndent
6636  {
6637  if (c=='\t')
6638  {
6639  int newIndent = indent+tabSize-(indent%tabSize);
6640  int i=newIndent;
6641  while (i>minIndent) // if a tab crosses the minIndent boundary fill the rest with spaces
6642  {
6643  result << ' ';
6644  i--;
6645  }
6646  indent=newIndent;
6647  }
6648  else // space
6649  {
6650  indent++;
6651  }
6652  }
6653  else // copy anything until the end of the line
6654  {
6655  result << c;
6656  }
6657  }
6658 
6659  return result.str();
6660 }

引用了 Config_getInt, QCString::data(), FALSE, QCString::isEmpty(), TextStream::str() , 以及 TRUE.

被这些函数引用 DocPara::handleInclude() , 以及 DocPara::handleStartCode().

◆ stripIndentation() [2/2]

void stripIndentation ( QCString doc,
const int  indentationLevel 
)

在文件 util.cpp6663 行定义.

6664 {
6665  if (indentationLevel <= 0 || doc.isEmpty()) return; // nothing to strip
6666 
6667  // by stripping content the string will only become shorter so we write the results
6668  // back into the input string and then resize it at the end.
6669  char c;
6670  const char *src = doc.data();
6671  char *dst = doc.rawData();
6672  bool insideIndent = false; // skip the initial line from stripping
6673  int cnt = 0;
6674  while ((c=*src++)!=0)
6675  {
6676  // invariant: dst<=src
6677  switch(c)
6678  {
6679  case '\n':
6680  *dst++ = c;
6681  insideIndent = true;
6682  cnt = indentationLevel;
6683  break;
6684  case ' ':
6685  if (insideIndent)
6686  {
6687  if (cnt>0) // count down the spacing until the end of the indent
6688  {
6689  cnt--;
6690  }
6691  else // reached the end of the indent, start of the part of the line to keep
6692  {
6693  insideIndent = false;
6694  *dst++ = c;
6695  }
6696  }
6697  else // part after indent, copy to the output
6698  {
6699  *dst++ = c;
6700  }
6701  break;
6702  default:
6703  insideIndent = false;
6704  *dst++ = c;
6705  break;
6706  }
6707  }
6708  doc.resize(static_cast<uint>(dst-doc.data())+1);
6709 }

引用了 QCString::data(), QCString::isEmpty(), QCString::rawData() , 以及 QCString::resize().

◆ stripLeadingAndTrailingEmptyLines()

QCString stripLeadingAndTrailingEmptyLines ( const QCString s,
int &  docLine 
)

Special version of QCString::stripWhiteSpace() that only strips completely blank lines.

参数
sthe string to be stripped
docLinethe line number corresponding to the start of the string. This will be adjusted based on the number of lines stripped from the start.
返回
The stripped string.

在文件 util.cpp5394 行定义.

5395 {
5396  if (s.isEmpty()) return QCString();
5397  const char *p = s.data();
5398 
5399  // search for leading empty lines
5400  int i=0,li=-1,l=s.length();
5401  char c;
5402  while ((c=*p))
5403  {
5404  if (c==' ' || c=='\t' || c=='\r') i++,p++;
5405  else if (c=='\\' && qstrncmp(p,"\\ilinebr",8)==0) i+=8,li=i,p+=8;
5406  else if (c=='\n') i++,li=i,docLine++,p++;
5407  else break;
5408  }
5409 
5410  // search for trailing empty lines
5411  int b=l-1,bi=-1;
5412  p=s.data()+b;
5413  while (b>=0)
5414  {
5415  c=*p;
5416  if (c==' ' || c=='\t' || c=='\r') b--,p--;
5417  else if (c=='r' && b>=7 && qstrncmp(p-7,"\\ilinebr",8)==0) bi=b-7,b-=8,p-=8;
5418  else if (c=='\n') bi=b,b--,p--;
5419  else break;
5420  }
5421 
5422  // return whole string if no leading or trailing lines where found
5423  if (li==-1 && bi==-1) return s;
5424 
5425  // return substring
5426  if (bi==-1) bi=l;
5427  if (li==-1) li=0;
5428  if (bi<=li) return QCString(); // only empty lines
5429  //printf("docLine='%s' len=%d li=%d bi=%d\n",qPrint(s),s.length(),li,bi);
5430  return s.mid(li,bi-li);
5431 }

引用了 QCString::data(), QCString::isEmpty(), QCString::length(), QCString::mid() , 以及 qstrncmp().

被这些函数引用 DefinitionImpl::_setBriefDescription(), DefinitionImpl::_setDocumentation(), DocGroup::addDocs(), VHDLOutlineParser::checkInlineCode() , 以及 DocPara::handleCommand().

◆ stripPath()

QCString stripPath ( const QCString s)

在文件 util.cpp5318 行定义.

5319 {
5320  QCString result=s;
5321  int i=result.findRev('/');
5322  if (i!=-1)
5323  {
5324  result=result.mid(i+1);
5325  }
5326  i=result.findRev('\\');
5327  if (i!=-1)
5328  {
5329  result=result.mid(i+1);
5330  }
5331  return result;
5332 }

引用了 QCString::findRev() , 以及 QCString::mid().

被这些函数引用 TagFileParser::buildLists(), RTFGenerator::endDoxyAnchor(), LatexGenerator::endIndexItem(), LatexGenerator::endIndexValue(), LatexGenerator::endTitleHead(), InheritedMemberInfoContext::Private::id(), DotFilePatcher::run(), SearchIndexExternal::setCurrentDoc(), LatexGenerator::startDoxyAnchor(), DocbookGenerator::startDoxyAnchor(), RTFGenerator::startFile(), LatexGenerator::startFile(), DocbookGenerator::startFile(), DocbookDocVisitor::startLink(), RTFDocVisitor::startLink(), LatexDocVisitor::startLink(), DocbookGenerator::startSection(), LatexGenerator::startSection(), RTFGenerator::startTextLink(), LatexGenerator::startTextLink(), LatexGenerator::startTitleHead(), substituteHtmlKeywords(), substituteKeywords(), DocbookDocVisitor::visit(), LatexDocVisitor::visit(), RTFDocVisitor::visit(), LatexDocVisitor::visitPost(), DocbookDocVisitor::visitPre(), LatexDocVisitor::visitPre(), RTFDocVisitor::visitPre(), RTFGenerator::writeAnchor(), LatexGenerator::writeAnchor(), LatexCodeGenerator::writeCodeLink(), RTFGenerator::writeCodeLink(), DocbookCodeGenerator::writeCodeLinkLine(), MemberList::writeDeclarations(), writeDocbookLink(), LatexGenerator::writeEndAnnoItem(), LatexCodeGenerator::writeLineNumber(), RTFGenerator::writeLineNumber(), TextGeneratorLatex::writeLink(), RTFGenerator::writeObjectLink(), LatexGenerator::writeObjectLink(), DocbookGenerator::writeObjectLink(), DocbookGenerator::writePageLink(), RTFGenerator::writeRTFReference() , 以及 RTFGenerator::writeStartAnnoItem().

◆ stripScope()

QCString stripScope ( const QCString name)

Strips the scope from a name. Examples: A::B will return A and A<T>::B<N::C<D> > will return A<T>.

在文件 util.cpp3815 行定义.

3816 {
3817  QCString result = name;
3818  int l=result.length();
3819  int p;
3820  bool done = FALSE;
3821  bool skipBracket=FALSE; // if brackets do not match properly, ignore them altogether
3822  int count=0;
3823  int round=0;
3824 
3825  do
3826  {
3827  p=l-1; // start at the end of the string
3828  while (p>=0 && count>=0)
3829  {
3830  char c=result.at(p);
3831  switch (c)
3832  {
3833  case ':':
3834  // only exit in the case of ::
3835  //printf("stripScope(%s)=%s\n",name,qPrint(result.right(l-p-1)));
3836  if (p>0 && result.at(p-1)==':' && (count==0 || skipBracket))
3837  {
3838  return result.right(l-p-1);
3839  }
3840  p--;
3841  break;
3842  case '>':
3843  if (skipBracket) // we don't care about brackets
3844  {
3845  p--;
3846  }
3847  else // count open/close brackets
3848  {
3849  if (p>0 && result.at(p-1)=='>') // skip >> operator
3850  {
3851  p-=2;
3852  break;
3853  }
3854  count=1;
3855  //printf("pos < = %d\n",p);
3856  p--;
3857  bool foundMatch=false;
3858  while (p>=0 && !foundMatch)
3859  {
3860  c=result.at(p--);
3861  switch (c)
3862  {
3863  case ')':
3864  round++;
3865  break;
3866  case '(':
3867  round--;
3868  break;
3869  case '>': // ignore > inside (...) to support e.g. (sizeof(T)>0) inside template parameters
3870  if (round==0) count++;
3871  break;
3872  case '<':
3873  if (round==0)
3874  {
3875  if (p>0)
3876  {
3877  if (result.at(p-1) == '<') // skip << operator
3878  {
3879  p--;
3880  break;
3881  }
3882  }
3883  count--;
3884  foundMatch = count==0;
3885  }
3886  break;
3887  default:
3888  //printf("c=%c count=%d\n",c,count);
3889  break;
3890  }
3891  }
3892  }
3893  //printf("pos > = %d\n",p+1);
3894  break;
3895  default:
3896  p--;
3897  }
3898  }
3899  done = count==0 || skipBracket; // reparse if brackets do not match
3900  skipBracket=TRUE;
3901  }
3902  while (!done); // if < > unbalanced repeat ignoring them
3903  //printf("stripScope(%s)=%s\n",name,name);
3904  return name;
3905 }

引用了 QCString::at(), FALSE, QCString::length(), QCString::right() , 以及 TRUE.

被这些函数引用 DotClassGraph::addClass(), getCanonicalTypeForIdentifier(), DefinitionImpl::IMPL::init(), DiagramItem::label(), NamespaceDefImpl::writeBriefDescription() , 以及 ClassDefImpl::writeIncludeFilesForSlice().

◆ stripTemplateSpecifiersFromScope()

QCString stripTemplateSpecifiersFromScope ( const QCString fullName,
bool  parentOnly,
QCString pLastScopeStripped 
)

Strips template specifiers from scope fullName, except those that make up specialized classes. The switch parentOnly determines whether or not a template "at the end" of a scope should be considered, e.g. with parentOnly is TRUE, A<T>::B<S> will try to strip <T> and not <S>, while parentOnly is FALSE will strip both unless A<T> or B<S> are specialized template classes.

在文件 util.cpp4605 行定义.

4608 {
4609  int i=fullName.find('<');
4610  if (i==-1) return fullName;
4611  QCString result;
4612  int p=0;
4613  int l=fullName.length();
4614  while (i!=-1)
4615  {
4616  //printf("1:result+=%s\n",qPrint(fullName.mid(p,i-p)));
4617  int e=i+1;
4618  int count=1;
4619  int round=0;
4620  while (e<l && count>0)
4621  {
4622  char c=fullName.at(e++);
4623  switch (c)
4624  {
4625  case '(': round++; break;
4626  case ')': if (round>0) round--; break;
4627  case '<': if (round==0) count++; break;
4628  case '>': if (round==0) count--; break;
4629  default:
4630  break;
4631  }
4632  }
4633  int si= fullName.find("::",e);
4634 
4635  if (parentOnly && si==-1) break;
4636  // we only do the parent scope, so we stop here if needed
4637 
4638  result+=fullName.mid(p,i-p);
4639  //printf(" trying %s\n",qPrint(result+fullName.mid(i,e-i)));
4640  if (getClass(result+fullName.mid(i,e-i))!=0)
4641  {
4642  result+=fullName.mid(i,e-i);
4643  //printf(" 2:result+=%s\n",qPrint(fullName.mid(i,e-i-1)));
4644  }
4645  else if (pLastScopeStripped)
4646  {
4647  //printf(" last stripped scope '%s'\n",qPrint(fullName.mid(i,e-i)));
4648  *pLastScopeStripped=fullName.mid(i,e-i);
4649  }
4650  p=e;
4651  i=fullName.find('<',p);
4652  }
4653  result+=fullName.right(l-p);
4654  //printf("3:result+=%s\n",qPrint(fullName.right(l-p)));
4655  return result;
4656 }

引用了 QCString::at(), QCString::find(), getClass(), QCString::length(), QCString::mid() , 以及 QCString::right().

被这些函数引用 addClassToContext(), addMemberFunction(), computeTemplateClassRelations(), extractClassName(), findMember(), findScopeFromQualifiedName(), findUsingDeclImports(), getCanonicalTypeForIdentifier(), getDefs(), SymbolResolver::Private::getResolvedClassRec(), SymbolResolver::Private::newResolveTypedef() , 以及 resolveLink().

◆ substituteClassNames()

QCString substituteClassNames ( const QCString s)

◆ substituteKeywords()

QCString substituteKeywords ( const QCString s,
const QCString title,
const QCString projName,
const QCString projNum,
const QCString projBrief 
)

在文件 util.cpp3335 行定义.

3337 {
3338  QCString result = s;
3339  if (!title.isEmpty()) result = substitute(result,"$title",title);
3340  result = substitute(result,"$datetime",dateToString(TRUE));
3341  result = substitute(result,"$date",dateToString(FALSE));
3342  result = substitute(result,"$year",yearToString());
3343  result = substitute(result,"$doxygenversion",getDoxygenVersion());
3344  result = substitute(result,"$projectname",projName);
3345  result = substitute(result,"$projectnumber",projNum);
3346  result = substitute(result,"$projectbrief",projBrief);
3347  result = substitute(result,"$projectlogo",stripPath(Config_getString(PROJECT_LOGO)));
3348  return result;
3349 }

引用了 Config_getString, dateToString(), FALSE, QCString::isEmpty(), stripPath(), substitute(), TRUE , 以及 yearToString().

被这些函数引用 substituteHtmlKeywords() , 以及 substituteLatexKeywords().

◆ substituteTemplateArgumentsInString()

QCString substituteTemplateArgumentsInString ( const QCString nm,
const ArgumentList formalArgs,
const std::unique_ptr< ArgumentList > &  actualArgs 
)

Substitutes any occurrence of a formal argument from argument list formalArgs in name by the corresponding actual argument in argument list actualArgs. The result after substitution is returned as a string. The argument name is used to prevent recursive substitution.

在文件 util.cpp4477 行定义.

4481 {
4482  //printf("substituteTemplateArgumentsInString(name=%s formal=%s actualArg=%s)\n",
4483  // qPrint(name),qPrint(argListToString(formalArgs)),qPrint(argListToString(actualArgs)));
4484  if (formalArgs.empty()) return nm;
4485  QCString result;
4486 
4487  static const reg::Ex re(R"(\a[\w:]*)");
4488  std::string name = nm.str();
4489  reg::Iterator it(name,re);
4491  size_t p=0;
4492 
4493  for (; it!=end ; ++it)
4494  {
4495  const auto &match = *it;
4496  size_t i = match.position();
4497  size_t l = match.length();
4498  if (i>p) result += name.substr(p,i-p);
4499  QCString n(match.str());
4500  ArgumentList::iterator actIt;
4501  if (actualArgs)
4502  {
4503  actIt = actualArgs->begin();
4504  }
4505 
4506  // if n is a template argument, then we substitute it
4507  // for its template instance argument.
4508  bool found=FALSE;
4509  for (auto formIt = formalArgs.begin();
4510  formIt!=formalArgs.end() && !found;
4511  ++formIt
4512  )
4513  {
4514  Argument formArg = *formIt;
4515  Argument actArg;
4516  if (actualArgs && actIt!=actualArgs->end())
4517  {
4518  actArg = *actIt;
4519  }
4520  if (formArg.type.left(6)=="class " && formArg.name.isEmpty())
4521  {
4522  formArg.name = formArg.type.mid(6);
4523  formArg.type = "class";
4524  }
4525  if (formArg.type.left(9)=="typename " && formArg.name.isEmpty())
4526  {
4527  formArg.name = formArg.type.mid(9);
4528  formArg.type = "typename";
4529  }
4530  if (formArg.type=="class" || formArg.type=="typename" || formArg.type.left(8)=="template")
4531  {
4532  //printf("n=%s formArg->type='%s' formArg->name='%s' formArg->defval='%s'\n",
4533  // qPrint(n),qPrint(formArg->type),qPrint(formArg->name),qPrint(formArg->defval));
4534  //printf(">> n='%s' formArg->name='%s' actArg->type='%s' actArg->name='%s'\n",
4535  // qPrint(n),qPrint(formArg.name),actIt!=actualArgs.end() ? qPrint(actIt->type) : "",actIt!=actualArgs.end() ? qPrint(actIt->name) : ""
4536  // );
4537  if (formArg.name==n && actualArgs && actIt!=actualArgs->end() && !actArg.type.isEmpty()) // base class is a template argument
4538  {
4539  // replace formal argument with the actual argument of the instance
4540  if (!leftScopeMatch(actArg.type,n))
4541  // the scope guard is to prevent recursive lockup for
4542  // template<class A> class C : public<A::T>,
4543  // where A::T would become A::T::T here,
4544  // since n==A and actArg->type==A::T
4545  // see bug595833 for an example
4546  {
4547  if (actArg.name.isEmpty())
4548  {
4549  result += actArg.type+" ";
4550  found=TRUE;
4551  }
4552  else
4553  // for case where the actual arg is something like "unsigned int"
4554  // the "int" part is in actArg->name.
4555  {
4556  result += actArg.type+" "+actArg.name+" ";
4557  found=TRUE;
4558  }
4559  }
4560  }
4561  else if (formArg.name==n &&
4562  (actualArgs==nullptr || actIt==actualArgs->end()) &&
4563  !formArg.defval.isEmpty() &&
4564  formArg.defval!=nm /* to prevent recursion */
4565  )
4566  {
4567  result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
4568  found=TRUE;
4569  }
4570  }
4571  else if (formArg.name==n &&
4572  (actualArgs==nullptr || actIt==actualArgs->end()) &&
4573  !formArg.defval.isEmpty() &&
4574  formArg.defval!=nm /* to prevent recursion */
4575  )
4576  {
4577  result += substituteTemplateArgumentsInString(formArg.defval,formalArgs,actualArgs)+" ";
4578  found=TRUE;
4579  }
4580  if (actualArgs && actIt!=actualArgs->end())
4581  {
4582  actIt++;
4583  }
4584  }
4585  if (!found)
4586  {
4587  result += n;
4588  }
4589  p=i+l;
4590  }
4591  result+=name.substr(p);
4592  //printf(" Inheritance relation %s -> %s\n",
4593  // qPrint(name),qPrint(result));
4594  return result.stripWhiteSpace();
4595 }

引用了 ArgumentList::begin(), Argument::defval, ArgumentList::empty(), ArgumentList::end(), end(), FALSE, QCString::isEmpty(), QCString::left(), leftScopeMatch(), reg::match(), QCString::mid(), Argument::name, QCString::str(), QCString::stripWhiteSpace(), substituteTemplateArgumentsInString(), TRUE , 以及 Argument::type.

被这些函数引用 computeTemplateClassRelations(), MemberDefImpl::createTemplateInstanceMember(), findBaseClassesForClass(), findUsedClassesForClass(), SymbolResolver::Private::newResolveTypedef() , 以及 substituteTemplateArgumentsInString().

◆ tempArgListToString()

QCString tempArgListToString ( const ArgumentList al,
SrcLangExt  lang,
bool  includeDefaults = true 
)

在文件 util.cpp1194 行定义.

1195 {
1196  QCString result;
1197  if (al.empty()) return result;
1198  result="<";
1199  bool first=true;
1200  for (const auto &a : al)
1201  {
1202  if (a.defval.isEmpty() || includeDefault)
1203  {
1204  if (!first) result+=", ";
1205  if (!a.name.isEmpty()) // add template argument name
1206  {
1207  if (lang==SrcLangExt_Java || lang==SrcLangExt_CSharp)
1208  {
1209  result+=a.type+" ";
1210  }
1211  result+=a.name;
1212  }
1213  else // extract name from type
1214  {
1215  int i=a.type.length()-1;
1216  while (i>=0 && isId(a.type.at(i))) i--;
1217  if (i>0)
1218  {
1219  result+=a.type.right(a.type.length()-i-1);
1220  if (a.type.find("...")!=-1)
1221  {
1222  result+="...";
1223  }
1224  }
1225  else // nothing found -> take whole name
1226  {
1227  result+=a.type;
1228  }
1229  }
1230  if (!a.typeConstraint.isEmpty() && lang==SrcLangExt_Java)
1231  {
1232  result+=" extends "; // TODO: now Java specific, C# has where...
1233  result+=a.typeConstraint;
1234  }
1235  first=false;
1236  }
1237  }
1238  result+=">";
1239  return removeRedundantWhiteSpace(result);
1240 }

引用了 ArgumentList::empty(), isId(), QCString::length(), removeRedundantWhiteSpace(), QCString::right(), SrcLangExt_CSharp , 以及 SrcLangExt_Java.

被这些函数引用 addMemberFunction(), findTemplateInstanceRelation(), makeQualifiedNameWithTemplateParameters(), searchTemplateSpecs() , 以及 writeDefArgumentList().

◆ transcodeCharacterStringToUTF8()

QCString transcodeCharacterStringToUTF8 ( const QCString input)

在文件 util.cpp1350 行定义.

1351 {
1352  bool error=FALSE;
1353  static QCString inputEncoding = Config_getString(INPUT_ENCODING);
1354  const char *outputEncoding = "UTF-8";
1355  if (inputEncoding.isEmpty() || qstricmp(inputEncoding,outputEncoding)==0) return input;
1356  int inputSize=input.length();
1357  int outputSize=inputSize*4+1;
1358  QCString output(outputSize);
1359  void *cd = portable_iconv_open(outputEncoding,inputEncoding.data());
1360  if (cd==(void *)(-1))
1361  {
1362  err("unsupported character conversion: '%s'->'%s'\n",
1363  qPrint(inputEncoding),outputEncoding);
1364  error=TRUE;
1365  }
1366  if (!error)
1367  {
1368  size_t iLeft=inputSize;
1369  size_t oLeft=outputSize;
1370  const char *inputPtr = input.data();
1371  char *outputPtr = output.rawData();
1372  if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
1373  {
1374  outputSize-=(int)oLeft;
1375  output.resize(outputSize+1);
1376  output.at(outputSize)='\0';
1377  //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,qPrint(srcBuf));
1378  }
1379  else
1380  {
1381  err("failed to translate characters from %s to %s: check INPUT_ENCODING\ninput=[%s]\n",
1382  qPrint(inputEncoding),outputEncoding,qPrint(input));
1383  error=TRUE;
1384  }
1385  }
1387  return error ? input : output;
1388 }

引用了 QCString::at(), Config_getString, QCString::data(), err(), FALSE, QCString::isEmpty(), QCString::length(), portable_iconv(), portable_iconv_close(), portable_iconv_open(), qPrint(), qstricmp(), QCString::rawData(), QCString::resize() , 以及 TRUE.

被这些函数引用 readCodeFragment().

◆ unescapeCharsInString()

QCString unescapeCharsInString ( const QCString s)

在文件 util.cpp3524 行定义.

3525 {
3526  if (s.isEmpty()) return s;
3527  bool caseSenseNames = Config_getBool(CASE_SENSE_NAMES);
3528  QCString result;
3529  const char *p = s.data();
3530  if (p)
3531  {
3532  char c;
3533  while ((c=*p++))
3534  {
3535  if (c=='_') // 2 or 3 character escape
3536  {
3537  switch (*p)
3538  {
3539  case '_': result+=c; p++; break; // __ -> '_'
3540  case '1': result+=':'; p++; break; // _1 -> ':'
3541  case '2': result+='/'; p++; break; // _2 -> '/'
3542  case '3': result+='<'; p++; break; // _3 -> '<'
3543  case '4': result+='>'; p++; break; // _4 -> '>'
3544  case '5': result+='*'; p++; break; // _5 -> '*'
3545  case '6': result+='&'; p++; break; // _6 -> '&'
3546  case '7': result+='|'; p++; break; // _7 -> '|'
3547  case '8': result+='.'; p++; break; // _8 -> '.'
3548  case '9': result+='!'; p++; break; // _9 -> '!'
3549  case '0': // 3 character escape
3550  switch (*(p+1))
3551  {
3552  case '0': result+=','; p+=2; break; // _00 -> ','
3553  case '1': result+=' '; p+=2; break; // _01 -> ' '
3554  case '2': result+='{'; p+=2; break; // _02 -> '{'
3555  case '3': result+='}'; p+=2; break; // _03 -> '}'
3556  case '4': result+='?'; p+=2; break; // _04 -> '?'
3557  case '5': result+='^'; p+=2; break; // _05 -> '^'
3558  case '6': result+='%'; p+=2; break; // _06 -> '%'
3559  case '7': result+='('; p+=2; break; // _07 -> '('
3560  case '8': result+=')'; p+=2; break; // _08 -> ')'
3561  case '9': result+='+'; p+=2; break; // _09 -> '+'
3562  case 'a': result+='='; p+=2; break; // _0a -> '='
3563  case 'b': result+='$'; p+=2; break; // _0b -> '$'
3564  case 'c': result+='\\'; p+=2; break;// _0c -> '\'
3565  case 'd': result+='@'; p+=2; break; // _0d -> '@'
3566  case 'e': result+=']'; p+=2; break; // _0e -> ']'
3567  case 'f': result+='['; p+=2; break; // _0f -> '['
3568  case 'g': result+='#'; p+=2; break; // _0g -> '#'
3569  default: // unknown escape, just pass underscore character as-is
3570  result+=c;
3571  break;
3572  }
3573  break;
3574  default:
3575  if (!caseSenseNames && c>='a' && c<='z') // lower to upper case escape, _a -> 'A'
3576  {
3577  result+=(char)toupper(*p);
3578  p++;
3579  }
3580  else // unknown escape, pass underscore character as-is
3581  {
3582  result+=c;
3583  }
3584  break;
3585  }
3586  }
3587  else // normal character; pass as is
3588  {
3589  result+=c;
3590  }
3591  }
3592  }
3593  return result;
3594 }

引用了 Config_getBool, QCString::data() , 以及 QCString::isEmpty().

◆ updateLanguageMapping()

bool updateLanguageMapping ( const QCString extension,
const QCString parser 
)

在文件 util.cpp5469 行定义.

5470 {
5471  const Lang2ExtMap *p = g_lang2extMap;
5472  QCString langName = language.lower();
5473  while (p->langName)
5474  {
5475  if (langName==p->langName) break;
5476  p++;
5477  }
5478  if (!p->langName) return FALSE;
5479 
5480  // found the language
5481  SrcLangExt parserId = p->parserId;
5482  QCString extName = extension.lower();
5483  if (extName.isEmpty()) return FALSE;
5484  if (extName.at(0)!='.') extName.prepend(".");
5485  auto it = g_extLookup.find(extName.str());
5486  if (it!=g_extLookup.end())
5487  {
5488  g_extLookup.erase(it); // language was already register for this ext
5489  }
5490  //printf("registering extension %s\n",qPrint(extName));
5491  g_extLookup.insert(std::make_pair(extName.str(),parserId));
5492  if (!Doxygen::parserManager->registerExtension(extName,p->parserName))
5493  {
5494  err("Failed to assign extension %s to parser %s for language %s\n",
5495  extName.data(),p->parserName,qPrint(language));
5496  }
5497  else
5498  {
5499  //msg("Registered extension %s to language parser %s...\n",
5500  // extName.data(),qPrint(language));
5501  }
5502  return TRUE;
5503 }

引用了 QCString::at(), QCString::data(), err(), FALSE, g_extLookup, g_lang2extMap, QCString::isEmpty(), Lang2ExtMap::langName, QCString::lower(), Lang2ExtMap::parserId, Doxygen::parserManager, Lang2ExtMap::parserName, QCString::prepend(), qPrint(), QCString::str() , 以及 TRUE.

被这些函数引用 addCodeOnlyMappings(), adjustConfiguration() , 以及 initDefaultExtensionMapping().

◆ writeColoredImgData()

void writeColoredImgData ( const QCString dir,
ColoredImgDataItem  data[] 
)

Writes the intensity only bitmap represented by data as an image to directory dir using the colors defined by HTML_COLORSTYLE_*.

在文件 util.cpp6363 行定义.

6364 {
6365  static int hue = Config_getInt(HTML_COLORSTYLE_HUE);
6366  static int sat = Config_getInt(HTML_COLORSTYLE_SAT);
6367  static int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA);
6368  while (data->name)
6369  {
6370  QCString fileName = dir+"/"+data->name;
6371  ColoredImage img(data->width,data->height,data->content,data->alpha,
6372  sat,hue,gamma);
6373  if (!img.save(fileName))
6374  {
6375  fprintf(stderr,"Warning: Cannot open file %s for writing\n",data->name);
6376  }
6378  data++;
6379  }
6380 }

引用了 IndexList::addImageFile(), ColoredImgDataItem::alpha, Config_getInt, ColoredImgDataItem::content, ColoredImgDataItem::height, Doxygen::indexList, ColoredImgDataItem::name, ColoredImage::save() , 以及 ColoredImgDataItem::width.

被这些函数引用 ResourceMgr::copyResourceAs().

◆ writeExamples()

void writeExamples ( OutputList ol,
const ExampleList el 
)

在文件 util.cpp1120 行定义.

1121 {
1122  auto replaceFunc = [&list,&ol](size_t entryIndex)
1123  {
1124  const auto &e = list[entryIndex];
1125  ol.pushGeneratorState();
1129  // link for Html / man
1130  //printf("writeObjectLink(file=%s)\n",qPrint(e->file));
1131  ol.writeObjectLink(QCString(),e.file,e.anchor,e.name);
1132  ol.popGeneratorState();
1133 
1134  ol.pushGeneratorState();
1137  // link for Latex / pdf with anchor because the sources
1138  // are not hyperlinked (not possible with a verbatim environment).
1139  ol.writeObjectLink(QCString(),e.file,QCString(),e.name);
1140  ol.popGeneratorState();
1141  };
1142 
1143  writeMarkerList(ol, theTranslator->trWriteList((int)list.size()).str(), list.size(), replaceFunc);
1144 
1145  ol.writeString(".");
1146 }

引用了 OutputList::disable(), OutputGenerator::Docbook, OutputGenerator::Html, OutputGenerator::Latex, OutputGenerator::Man, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputGenerator::RTF, QCString::str(), theTranslator, Translator::trWriteList(), writeMarkerList(), OutputList::writeObjectLink() , 以及 OutputList::writeString().

被这些函数引用 MemberDefImpl::_writeExamples() , 以及 ClassDefImpl::writeDetailedDocumentationBody().

◆ writeExtraLatexPackages()

void writeExtraLatexPackages ( TextStream t)

在文件 util.cpp7066 行定义.

7067 {
7068  // User-specified packages
7069  const StringVector &extraPackages = Config_getList(EXTRA_PACKAGES);
7070  if (!extraPackages.empty())
7071  {
7072  t << "% Packages requested by user\n";
7073  for (const auto &pkgName : extraPackages)
7074  {
7075  if ((pkgName[0] == '[') || (pkgName[0] == '{'))
7076  t << "\\usepackage" << pkgName.c_str() << "\n";
7077  else
7078  t << "\\usepackage{" << pkgName.c_str() << "}\n";
7079  }
7080  t << "\n";
7081  }
7082 }

引用了 Config_getList.

被这些函数引用 FormulaManager::generateImages() , 以及 substituteLatexKeywords().

◆ writeLatexSpecialFormulaChars()

void writeLatexSpecialFormulaChars ( TextStream t)

在文件 util.cpp7084 行定义.

7085 {
7086  unsigned char minus[4]; // Superscript minus
7087  char *pminus = (char *)minus;
7088  unsigned char sup2[3]; // Superscript two
7089  char *psup2 = (char *)sup2;
7090  unsigned char sup3[3];
7091  char *psup3 = (char *)sup3; // Superscript three
7092  minus[0]= 0xE2;
7093  minus[1]= 0x81;
7094  minus[2]= 0xBB;
7095  minus[3]= 0;
7096  sup2[0]= 0xC2;
7097  sup2[1]= 0xB2;
7098  sup2[2]= 0;
7099  sup3[0]= 0xC2;
7100  sup3[1]= 0xB3;
7101  sup3[2]= 0;
7102 
7103  t << "\\usepackage{newunicodechar}\n"
7104  " \\newunicodechar{" << pminus << "}{${}^{-}$}% Superscript minus\n"
7105  " \\newunicodechar{" << psup2 << "}{${}^{2}$}% Superscript two\n"
7106  " \\newunicodechar{" << psup3 << "}{${}^{3}$}% Superscript three\n"
7107  "\n";
7108 }

被这些函数引用 FormulaManager::generateImages() , 以及 substituteLatexKeywords().

◆ writeMarkerList()

void writeMarkerList ( OutputList ol,
const std::string &  markerText,
size_t  numMarkers,
std::function< void(size_t)>  replaceFunc 
)

在文件 util.cpp1096 行定义.

1098 {
1099  static const reg::Ex marker(R"(@(\d+))");
1100  reg::Iterator it(markerText,marker);
1102  size_t index=0;
1103  // now replace all markers in inheritLine with links to the classes
1104  for ( ; it!=end ; ++it)
1105  {
1106  const auto &match = *it;
1107  size_t newIndex = match.position();
1108  size_t matchLen = match.length();
1109  ol.parseText(markerText.substr(index,newIndex-index));
1110  unsigned long entryIndex = std::stoul(match[1].str());
1111  if (entryIndex<(unsigned long)numMarkers)
1112  {
1113  replaceFunc(entryIndex);
1114  }
1115  index=newIndex+matchLen;
1116  }
1117  ol.parseText(markerText.substr(index));
1118 }

引用了 end(), reg::match() , 以及 OutputList::parseText().

被这些函数引用 MemberDefImpl::_writeReimplementedBy(), DefinitionImpl::_writeSourceRefList(), writeExamples() , 以及 ClassDefImpl::writeInheritanceGraph().

◆ writePageRef()

◆ writeTypeConstraints()

Debug::ExtCmd
@ ExtCmd
Definition: debug.h:36
ArgumentList::refQualifier
RefQualifierType refQualifier() const
Definition: arguments.h:109
StringVector
std::vector< std::string > StringVector
Definition: containers.h:32
ArgumentList::trailingReturnType
QCString trailingReturnType() const
Definition: arguments.h:107
HtmlEntityMapper::latex
const char * latex(DocSymbol::SymType symb) const
Access routine to the LaTeX code of the HTML entity
Definition: htmlentity.cpp:426
qsnprintf
#define qsnprintf
Definition: qcstring.h:57
SrcLangExt_Unknown
@ SrcLangExt_Unknown
Definition: types.h:43
g_tagMap
static std::unordered_map< std::string, std::string > g_tagMap
Definition: util.cpp:5227
HtmlEntityMapper::name2sym
DocSymbol::SymType name2sym(const QCString &symName) const
Give code of the requested HTML entity name
Definition: htmlentity.cpp:471
getMemberFromSymbol
static MemberDef * getMemberFromSymbol(const Definition *scope, const FileDef *fileScope, const QCString &n)
Definition: util.cpp:5631
DefinitionMutable::setDocumentation
virtual void setDocumentation(const QCString &d, const QCString &docFile, int docLine, bool stripWhiteSpace=TRUE)=0
portable_iconv
size_t portable_iconv(void *cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
ColoredImage::hsl2rgb
static void hsl2rgb(double h, double s, double l, double *pRed, double *pGreen, double *pBlue)
Definition: image.cpp:412
Argument::canType
QCString canType
Definition: arguments.h:51
writeMarkerList
void writeMarkerList(OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc)
Definition: util.cpp:1096
MemberDef::isTypedef
virtual bool isTypedef() const =0
ConceptDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
REL_PATH_TO_ROOT
#define REL_PATH_TO_ROOT
Definition: util.cpp:91
OutputList::endConstraintType
void endConstraintType()
Definition: outputlist.h:446
findFileDef
FileDef * findFileDef(const FileNameLinkedMap *fnMap, const QCString &n, bool &ambig)
Definition: util.cpp:3222
toGroupDef
GroupDef * toGroupDef(Definition *d)
Definition: groupdef.cpp:1766
Definition::docLine
virtual int docLine() const =0
DocSymbol::SymType
SymType
Definition: docparser.h:388
Portable::popen
FILE * popen(const QCString &name, const QCString &type)
Definition: portable.cpp:452
Portable::fileSystemIsCaseSensitive
bool fileSystemIsCaseSensitive()
Definition: portable.cpp:443
leftScopeMatch
bool leftScopeMatch(const QCString &scope, const QCString &name)
Definition: util.cpp:874
reg::replace
std::string replace(const std::string &str, const Ex &re, const std::string &replacement)
Searching in a given input string for parts that match regular expression re and replaces those parts...
Definition: regex.cpp:740
THREAD_LOCAL
#define THREAD_LOCAL
Definition: doxygen.h:27
MemberListType_priStaticMethods
@ MemberListType_priStaticMethods
Definition: types.h:114
getDefs
bool getDefs(const QCString &scName, const QCString &mbName, const QCString &args, const MemberDef *&md, const ClassDef *&cd, const FileDef *&fd, const NamespaceDef *&nd, const GroupDef *&gd, bool forceEmptyScope, const FileDef *currentFile, bool checkCV)
Definition: util.cpp:2208
ConceptDef
Definition: conceptdef.h:22
resolveLink
bool resolveLink(const QCString &scName, const QCString &lr, bool, const Definition **resContext, QCString &resAnchor)
Definition: util.cpp:3037
toMemberDefMutable
MemberDefMutable * toMemberDefMutable(Definition *d)
Definition: memberdef.cpp:6125
QCString::rawData
char * rawData()
Returns a writable pointer to the data.
Definition: qcstring.h:157
MemberListType_priStaticAttribs
@ MemberListType_priStaticAttribs
Definition: types.h:125
FindFileCacheElem::isAmbig
bool isAmbig
Definition: util.cpp:3215
Doxygen::mainPage
static std::unique_ptr< PageDef > mainPage
Definition: doxygen.h:83
FileName
Class representing all files with a certain base name
Definition: filename.h:28
stripExtensionGeneral
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
Definition: util.cpp:5285
MemberDef::argsString
virtual QCString argsString() const =0
FileDef::generateSourceFile
virtual bool generateSourceFile() const =0
stripFromIncludePath
QCString stripFromIncludePath(const QCString &path)
Definition: util.cpp:322
findEndOfCommand
static int findEndOfCommand(const char *s)
For a string s that starts with a command name, returns the character offset within that string repre...
Definition: util.cpp:5802
Doxygen::namespaceAliasMap
static StringUnorderedMap namespaceAliasMap
Definition: doxygen.h:95
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
Dir::remove
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:256
NamespaceDef
An abstract interface of a namespace symbol.
Definition: namespacedef.h:54
Dir
Class representing a directory in the file system
Definition: dir.h:68
Private
@ Private
Definition: types.h:26
PageDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
substituteTemplateArgumentsInString
QCString substituteTemplateArgumentsInString(const QCString &nm, const ArgumentList &formalArgs, const std::unique_ptr< ArgumentList > &actualArgs)
Definition: util.cpp:4477
SrcLangExt_XML
@ SrcLangExt_XML
Definition: types.h:55
BufStr
Buffer used to store strings
Definition: bufstr.h:29
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
Doxygen::tagDestinationMap
static StringMap tagDestinationMap
Definition: doxygen.h:98
GrowBuf::get
char * get()
Definition: growbuf.h:94
OutputDocInterface::pushGeneratorState
virtual void pushGeneratorState()=0
ArgumentList
This class represents an function or template argument list.
Definition: arguments.h:59
Doxygen::conceptLinkedMap
static ConceptLinkedMap * conceptLinkedMap
Definition: doxygen.h:80
SectionInfo::definition
Definition * definition() const
Definition: section.h:73
ConceptDef::isLinkableInProject
virtual bool isLinkableInProject() const =0
OutputList::startConstraintParam
void startConstraintParam()
Definition: outputlist.h:440
getCurrentDateTime
static std::tm getCurrentDateTime()
Definition: util.cpp:1437
DirDef
A model of a directory symbol.
Definition: dirdef.h:110
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
SrcLangExt_PHP
@ SrcLangExt_PHP
Definition: types.h:48
BufStr::at
char & at(uint i) const
Definition: bufstr.h:100
SrcLangExt_JS
@ SrcLangExt_JS
Definition: types.h:51
MemberListType_priAttribs
@ MemberListType_priAttribs
Definition: types.h:121
MATCH
#define MATCH
Definition: util.cpp:1573
OutputList::startConstraintType
void startConstraintType()
Definition: outputlist.h:444
g_findFileDefCache
static Cache< std::string, FindFileCacheElem > g_findFileDefCache(5000)
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
BufStr::data
char * data() const
Definition: bufstr.h:96
BaseOutputDocInterface::startPageRef
virtual void startPageRef()=0
reg::match
bool match(const std::string &str, Match &match, const Ex &re)
Matches a given string str for a match against regular expression re.
Definition: regex.cpp:729
TagInfo::tagName
QCString tagName
Definition: entry.h:50
DefinitionMutable::setReference
virtual void setReference(const QCString &r)=0
Definition::findInnerCompound
virtual const Definition * findInnerCompound(const QCString &name) const =0
PageDef::getGroupDef
virtual const GroupDef * getGroupDef() const =0
Doxygen::pageLinkedMap
static PageLinkedMap * pageLinkedMap
Definition: doxygen.h:82
BufStr::shrink
void shrink(uint newlen)
Definition: bufstr.h:73
Doxygen::indexList
static IndexList * indexList
Definition: doxygen.h:114
createPageDef
PageDef * createPageDef(const QCString &f, int l, const QCString &n, const QCString &d, const QCString &t)
Definition: pagedef.cpp:76
OutputList::writeString
void writeString(const QCString &text)
Definition: outputlist.h:111
TextGeneratorOLImpl
Implements TextGeneratorIntf for an OutputDocInterface stream.
Definition: util.h:72
SymbolResolver
Helper class to find a class definition or check if A symbol is accessible in a given scope.
Definition: symbolresolver.h:30
RefItem
This struct represents an item in the list of references.
Definition: reflist.h:30
OutputList::endConstraintParam
void endConstraintParam()
Definition: outputlist.h:442
MemberListType_pubTypes
@ MemberListType_pubTypes
Definition: types.h:126
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
MemberListType_priSlots
@ MemberListType_priSlots
Definition: types.h:117
LinkedMap::add
T * add(const char *k, Args &&... args)
Adds a new object to the ordered vector if it was not added already.
Definition: linkedmap.h:103
Doxygen::globalScope
static NamespaceDefMutable * globalScope
Definition: doxygen.h:102
OutputList::endConstraintList
void endConstraintList()
Definition: outputlist.h:452
stripTemplateSpecifiersFromScope
QCString stripTemplateSpecifiersFromScope(const QCString &fullName, bool parentOnly, QCString *pLastScopeStripped)
Definition: util.cpp:4605
BufStr::dropFromStart
void dropFromStart(uint bytes)
Definition: bufstr.h:116
ConceptDef::anchor
virtual QCString anchor() const =0
QCString::str
std::string str() const
Definition: qcstring.h:442
RefQualifierRValue
@ RefQualifierRValue
Definition: arguments.h:50
nextUTF8CharPosition
static int nextUTF8CharPosition(const QCString &utf8Str, uint len, uint startPos)
Definition: util.cpp:5694
ClassDef::isLinkableInProject
virtual bool isLinkableInProject() const =0
returns TRUE iff a link is possible to this item within this project.
Definition::TypeGroup
@ TypeGroup
Definition: definition.h:91
OutputList::startConstraintList
void startConstraintList(const QCString &header)
Definition: outputlist.h:438
Public
@ Public
Definition: types.h:26
SrcLangExt_Lex
@ SrcLangExt_Lex
Definition: types.h:60
Package
@ Package
Definition: types.h:26
OutputList::endConstraintDocs
void endConstraintDocs()
Definition: outputlist.h:450
reg::Ex::Mode::Wildcard
@ Wildcard
simple globbing pattern.
FileDef::isLinkableInProject
virtual bool isLinkableInProject() const =0
err
void err(const char *fmt,...)
Definition: message.cpp:203
SrcLangExt_Java
@ SrcLangExt_Java
Definition: types.h:45
FileDef::isLinkable
virtual bool isLinkable() const =0
yearToString
QCString yearToString()
Definition: util.cpp:1483
QCString::at
char & at(size_t i)
Returns a reference to the character at index i.
Definition: qcstring.h:477
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
Doxygen::dirLinkedMap
static DirLinkedMap * dirLinkedMap
Definition: doxygen.h:109
SectionInfo::lineNr
int lineNr() const
Definition: section.h:69
portable_iconv_open
void * portable_iconv_open(const char *tocode, const char *fromcode)
GrowBuf::addStr
void addStr(const QCString &s)
Definition: growbuf.h:57
QCString::find
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:38
MemberListType_proAttribs
@ MemberListType_proAttribs
Definition: types.h:119
MemberDefMutable
Definition: memberdef.h:296
MemberListType_pubMethods
@ MemberListType_pubMethods
Definition: types.h:107
isURL
bool isURL(const QCString &url)
Checks whether the given url starts with a supported protocol
Definition: util.cpp:6561
getResolvedNamespace
NamespaceDef * getResolvedNamespace(const QCString &name)
Definition: namespacedef.cpp:1606
getClass
ClassDef * getClass(const QCString &n)
Definition: classdef.cpp:4974
ArgumentList::volatileSpecifier
bool volatileSpecifier() const
Definition: arguments.h:105
qstrncmp
int qstrncmp(const char *str1, const char *str2, size_t len)
Definition: qcstring.h:91
ClassDef::getFileDef
virtual FileDef * getFileDef() const =0
Returns the namespace this compound is in, or 0 if it has a global scope.
ArgumentList::end
iterator end()
Definition: arguments.h:87
Lang2ExtMap
Definition: util.cpp:5437
HtmlEntityMapper::instance
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
Definition: htmlentity.cpp:341
Definition::docFile
virtual QCString docFile() const =0
MemberDef::getReference
virtual QCString getReference() const =0
g_charAroundSpace
static CharAroundSpace g_charAroundSpace
Definition: util.cpp:541
rightScopeMatch
bool rightScopeMatch(const QCString &scope, const QCString &name)
Definition: util.cpp:863
SectionInfo::label
QCString label() const
Definition: section.h:65
warn
void warn(const QCString &file, int line, const char *fmt,...)
Definition: message.cpp:151
SectionManager::replace
SectionInfo * replace(const QCString &label, const QCString &fileName, int lineNr, const QCString &title, SectionType type, int level, const QCString &ref=QCString())
Replace an existing section with a new one Return a non-owning pointer to the newly added section
Definition: section.h:151
SectionInfo::ref
QCString ref() const
Definition: section.h:68
begin
DirIterator begin(DirIterator it) noexcept
Definition: dir.cpp:123
Definition::getLanguage
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
ColoredImgDataItem::width
unsigned short width
Definition: util.h:379
OutputDocInterface::popGeneratorState
virtual void popGeneratorState()=0
ArgumentList::begin
iterator begin()
Definition: arguments.h:86
g_lang2extMap
static struct Lang2ExtMap g_lang2extMap[]
reg::Iterator
Iterator class to iterator through matches.
Definition: regex.h:242
ArgumentList::hasParameters
bool hasParameters() const
Definition: arguments.h:69
getScopeDefs
static bool getScopeDefs(const QCString &docScope, const QCString &scope, ClassDef *&cd, NamespaceDef *&nd)
Definition: util.cpp:2693
GrowBuf::addChar
void addChar(char c)
Definition: growbuf.h:54
GrowBuf
Class representing a string buffer optimised for growing.
Definition: growbuf.h:12
end
DirIterator end(const DirIterator &) noexcept
Definition: dir.cpp:128
MemberName
Definition: membername.h:24
MemberDef::isLinkable
virtual bool isLinkable() const =0
OutputGenerator::RTF
@ RTF
Definition: outputgen.h:333
StringUnorderedSet
std::unordered_set< std::string > StringUnorderedSet
Definition: containers.h:28
MemberDef::isStrongEnumValue
virtual bool isStrongEnumValue() const =0
PageDef
A model of a page symbol.
Definition: pagedef.h:25
GroupDef
A model of a group of symbols.
Definition: groupdef.h:49
Doxygen::inputNameLinkedMap
static FileNameLinkedMap * inputNameLinkedMap
Definition: doxygen.h:88
ColoredImgDataItem::alpha
unsigned char * alpha
Definition: util.h:382
Argument::type
QCString type
Definition: arguments.h:50
ColoredImgDataItem::name
const char * name
Definition: util.h:378
transcodeCharacterBuffer
static int transcodeCharacterBuffer(const QCString &fileName, BufStr &srcBuf, int size, const QCString &inputEncoding, const QCString &outputEncoding)
Definition: util.cpp:6122
FortranFormat_Free
@ FortranFormat_Free
Definition: types.h:297
uint
unsigned uint
Definition: qcstring.h:40
MemberDef::anchor
virtual QCString anchor() const =0
SrcLangExt_ObjC
@ SrcLangExt_ObjC
Definition: types.h:49
BaseOutputDocInterface::endPageRef
virtual void endPageRef(const QCString &, const QCString &)=0
constScope
static const char constScope[]
Definition: util.cpp:497
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
dateToString
QCString dateToString(bool includeTime)
Definition: util.cpp:1470
matchArgument2
static bool matchArgument2(const Definition *srcScope, const FileDef *srcFileScope, Argument &srcA, const Definition *dstScope, const FileDef *dstFileScope, Argument &dstA)
Definition: util.cpp:1859
OutputGenerator::Latex
@ Latex
Definition: outputgen.h:333
ArgumentList::pureSpecifier
bool pureSpecifier() const
Definition: arguments.h:106
MemberListType_pubSlots
@ MemberListType_pubSlots
Definition: types.h:115
clearBlock
QCString clearBlock(const QCString &s, const QCString &begin, const QCString &end)
Clear a text block s from begin to end markers
Definition: util.cpp:7169
Dir::rename
bool rename(const std::string &orgName, const std::string &newName, bool acceptsAbsPath=true) const
Definition: dir.cpp:263
Definition::TypeNamespace
@ TypeNamespace
Definition: definition.h:89
ClassDef
A abstract class representing of a compound symbol.
Definition: classdef.h:103
Argument::array
QCString array
Definition: arguments.h:53
QCString::stripWhiteSpace
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition: qcstring.h:243
Config_getInt
#define Config_getInt(name)
Definition: config.h:34
reg::isspace
static bool isspace(char c)
Definition: regex.cpp:33
RefQualifierLValue
@ RefQualifierLValue
Definition: arguments.h:49
Doxygen::functionNameLinkedMap
static MemberNameLinkedMap * functionNameLinkedMap
Definition: doxygen.h:94
OutputList::disable
void disable(OutputGenerator::OutputType o)
Definition: outputlist.cpp:100
uchar
unsigned char uchar
Definition: qcstring.h:38
isId
bool isId(int c)
Definition: util.h:172
Entry::SOURCE_SEC
@ SOURCE_SEC
Definition: entry.h:88
MemberListType_proStaticMethods
@ MemberListType_proStaticMethods
Definition: types.h:112
QCString::left
QCString left(size_t len) const
Definition: qcstring.h:212
OutputList::startConstraintDocs
void startConstraintDocs()
Definition: outputlist.h:448
Translator::trOverloadText
virtual QCString trOverloadText()=0
HEXTONUM
#define HEXTONUM(x)
FileDef::name
virtual QCString name() const =0
MemberDef::isVariable
virtual bool isVariable() const =0
MemberDef::enumFieldList
virtual const MemberVector & enumFieldList() const =0
ColoredImgDataItem::height
unsigned short height
Definition: util.h:380
IndexList::addImageFile
void addImageFile(const QCString &name)
Definition: index.h:105
Doxygen::parserManager
static ParserManager * parserManager
Definition: doxygen.h:111
BufStr::skip
void skip(uint s)
Definition: bufstr.h:68
QCString::insert
QCString & insert(size_t index, const QCString &s)
Definition: qcstring.h:274
ArgumentList::empty
bool empty() const
Definition: arguments.h:92
expandAliasRec
static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed, const QCString &s, bool allowRecursion=FALSE)
Definition: util.cpp:5933
ClassDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Returns the unique base name (without extension) of the class's file on disk
Definition::TypeFile
@ TypeFile
Definition: definition.h:88
Debug::print
static void print(DebugMask mask, int prio, const char *fmt,...)
Definition: debug.cpp:57
updateLanguageMapping
bool updateLanguageMapping(const QCString &extension, const QCString &language)
Definition: util.cpp:5469
QCString::simplifyWhiteSpace
QCString simplifyWhiteSpace() const
return a copy of this string with leading and trailing whitespace removed and multiple whitespace cha...
Definition: qcstring.cpp:180
removeRedundantWhiteSpace
QCString removeRedundantWhiteSpace(const QCString &s)
Definition: util.cpp:544
reg::isalnum
static bool isalnum(char c)
Definition: regex.cpp:48
qstricmp
int qstricmp(const char *str1, const char *str2)
Definition: qcstring.cpp:433
theTranslator
Translator * theTranslator
Definition: language.cpp:156
Definition::isReference
virtual bool isReference() const =0
MemberNameLinkedMap
Ordered dictionary of MemberName objects.
Definition: membername.h:61
SymbolResolver::isAccessibleFrom
int isAccessibleFrom(const Definition *scope, const Definition *item)
Checks if symbol item is accessible from within scope.
Definition: symbolresolver.cpp:1082
Definition::name
virtual QCString name() const =0
Doxygen::groupLinkedMap
static GroupLinkedMap * groupLinkedMap
Definition: doxygen.h:96
SrcLangExt_D
@ SrcLangExt_D
Definition: types.h:47
SrcLangExt_Cpp
@ SrcLangExt_Cpp
Definition: types.h:50
Config_getEnumAsString
#define Config_getEnumAsString(name)
Definition: config.h:36
DocSymbol::Sym_Unknown
@ Sym_Unknown
Definition: docparser.h:388
resolveTypeDef
QCString resolveTypeDef(const Definition *context, const QCString &qualifiedName, const Definition **typedefContext)
Definition: util.cpp:364
Argument
This class contains the information about the argument of a function or template
Definition: arguments.h:26
MemberDef::resolveAlias
virtual MemberDef * resolveAlias()=0
MemberDef::getClassDef
virtual const ClassDef * getClassDef() const =0
Portable::pclose
int pclose(FILE *stream)
Definition: portable.cpp:461
SrcLangExt_Python
@ SrcLangExt_Python
Definition: types.h:52
QCString::lower
QCString lower() const
Definition: qcstring.h:232
stripPath
QCString stripPath(const QCString &s)
Definition: util.cpp:5318
hex
static const char * hex
Definition: util.cpp:93
validatingParseDoc
DocRoot * validatingParseDoc(IDocParser &parserIntf, const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &input, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
Definition: docparser.cpp:7495
Debug::FilterOutput
@ FilterOutput
Definition: debug.h:38
g_usedNamesMutex
static std::mutex g_usedNamesMutex
Definition: util.cpp:3597
Doxygen::memberGroupInfoMap
static MemberGroupInfoMap memberGroupInfoMap
Definition: doxygen.h:100
Translator::trPageAbbreviation
virtual QCString trPageAbbreviation()=0
PageDef::setNestingLevel
virtual void setNestingLevel(int)=0
getLanguageSpecificSeparator
QCString getLanguageSpecificSeparator(SrcLangExt lang, bool classScope)
Returns the scope separator to use given the programming language lang
Definition: util.cpp:6545
minClassDistance
int minClassDistance(const ClassDef *cd, const ClassDef *bcd, int level)
Definition: classdef.cpp:5026
SectionInfo::fileName
QCString fileName() const
Definition: section.h:70
DefinitionMutable::setLanguage
virtual void setLanguage(SrcLangExt lang)=0
vhdl
Token literal values and constants.
Definition: CharStream.h:12
reg::Match
Object representing the matching results.
Definition: regex.h:163
linkifyText
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, const FileDef *fileScope, const Definition *self, const QCString &text, bool autoBreak, bool external, bool keepSpaces, int indentLevel)
Definition: util.cpp:886
getLanguageFromFileName
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition: util.cpp:5574
TRUE
#define TRUE
Definition: qcstring.h:36
Definition::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Definition::getStartBodyLine
virtual int getStartBodyLine() const =0
MemberDef::getNamespaceDef
virtual const NamespaceDef * getNamespaceDef() const =0
PageDef::setPageScope
virtual void setPageScope(Definition *)=0
Argument::attrib
QCString attrib
Definition: arguments.h:49
SrcLangExt_Fortran
@ SrcLangExt_Fortran
Definition: types.h:53
SymbolResolver::getTypedef
const MemberDef * getTypedef() const
In case a call to resolveClass() resolves to a type member (e.g.
Definition: symbolresolver.cpp:1103
ArgumentList::front
Argument & front()
Definition: arguments.h:98
PageDef::hasTitle
virtual bool hasTitle() const =0
FileDef::getPath
virtual QCString getPath() const =0
ArgumentList::constSpecifier
bool constSpecifier() const
Definition: arguments.h:104
CharAroundSpace::CharElem::before
bool before
Definition: util.cpp:534
OutputGenerator::Html
@ Html
Definition: outputgen.h:333
LinkedMap::find
const T * find(const std::string &key) const
Find an object given the key.
Definition: linkedmap.h:60
TextStream::str
std::string str() const
Return the contents of the buffer as a std::string object
Definition: textstream.h:208
Lang2ExtMap::defExt
const char * defExt
Definition: util.cpp:5442
Translator::trTypeConstraints
virtual QCString trTypeConstraints()=0
getConcept
ConceptDef * getConcept(const QCString &n)
Definition: conceptdef.cpp:739
volatileScope
static const char volatileScope[]
Definition: util.cpp:498
SectionType::Page
@ Page
Lang2ExtMap::parserName
const char * parserName
Definition: util.cpp:5440
isLowerCase
static bool isLowerCase(QCString &s)
Definition: util.cpp:2745
SrcLangExt_CSharp
@ SrcLangExt_CSharp
Definition: types.h:46
SrcLangExt_SQL
@ SrcLangExt_SQL
Definition: types.h:58
PageDef::setTitle
virtual void setTitle(const QCString &title)=0
MemberDef::isStrong
virtual bool isStrong() const =0
FileInfo::filePath
std::string filePath() const
Definition: fileinfo.cpp:91
Dir::isEmpty
bool isEmpty(const std::string subdir) const
Definition: dir.cpp:205
SectionManager::add
SectionInfo * add(const SectionInfo &si)
Add a new section given the data of an existing section.
Definition: section.h:135
MemberListType_priTypes
@ MemberListType_priTypes
Definition: types.h:129
Definition::TypeClass
@ TypeClass
Definition: definition.h:87
BufStr::addArray
void addArray(const char *a, uint len)
Definition: bufstr.h:62
Definition::definitionType
virtual DefType definitionType() const =0
ArgumentList::iterator
typename Vec::iterator iterator
Definition: arguments.h:63
MemberListType_pubStaticAttribs
@ MemberListType_pubStaticAttribs
Definition: types.h:122
linkToText
QCString linkToText(SrcLangExt lang, const QCString &link, bool isFileName)
Definition: util.cpp:2943
OutputList::popGeneratorState
void popGeneratorState()
Definition: outputlist.cpp:134
OutputGenerator::Docbook
@ Docbook
Definition: outputgen.h:333
DirDef::isLinkable
virtual bool isLinkable() const =0
MemberDef::isForeign
virtual bool isForeign() const =0
PageDef::setFileName
virtual void setFileName(const QCString &name)=0
ArgumentList::size
size_t size() const
Definition: arguments.h:93
ColoredImgDataItem::content
unsigned char * content
Definition: util.h:381
MemberListType_proMethods
@ MemberListType_proMethods
Definition: types.h:108
getUTF8CharNumBytes
uint8_t getUTF8CharNumBytes(char c)
Returns the number of bytes making up a single UTF8 character given the first byte in the sequence.
Definition: utf8.cpp:23
GroupDef::isLinkable
virtual bool isLinkable() const =0
MemberListType_proTypes
@ MemberListType_proTypes
Definition: types.h:127
Definition::getReference
virtual QCString getReference() const =0
virtualScope
static const char virtualScope[]
Definition: util.cpp:499
g_nextTag
static QCString g_nextTag("AAAAAAAAAA")
NOMATCH
#define NOMATCH
Definition: util.cpp:1574
Protected
@ Protected
Definition: types.h:26
QCString::mid
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition: qcstring.h:224
substitute
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition: qcstring.cpp:465
Argument::defval
QCString defval
Definition: arguments.h:54
MemberDef::isLinkableInProject
virtual bool isLinkableInProject() const =0
MemberListType_proStaticAttribs
@ MemberListType_proStaticAttribs
Definition: types.h:123
writePageRef
void writePageRef(OutputDocInterface &od, const QCString &cn, const QCString &mn)
Definition: util.cpp:264
readInputFile
bool readInputFile(const QCString &fileName, BufStr &inBuf, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition: util.cpp:6158
RefItemVector
std::vector< RefItem * > RefItemVector
Definition: reflist.h:132
MemberDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
SectionInfo::setTitle
void setTitle(const QCString &t)
Definition: section.h:80
g_findFileDefMutex
static std::mutex g_findFileDefMutex
Definition: util.cpp:3220
g_usedNames
static std::unordered_map< std::string, int > g_usedNames
Definition: util.cpp:3596
Doxygen::memberNameLinkedMap
static MemberNameLinkedMap * memberNameLinkedMap
Definition: doxygen.h:93
NamespaceDef::isLinkable
virtual bool isLinkable() const =0
FileDef::isDocumentationFile
virtual bool isDocumentationFile() const =0
QCString::remove
QCString & remove(size_t index, size_t len)
Definition: qcstring.h:354
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
QCString::append
QCString & append(char c)
Definition: qcstring.h:318
GroupDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
g_extLookup
static std::unordered_map< std::string, int > g_extLookup
Definition: util.cpp:5435
Doxygen::htmlFileExtension
static QCString htmlFileExtension
Definition: doxygen.h:103
getFilterFromList
static QCString getFilterFromList(const QCString &name, const StringVector &filterList, bool &found)
Definition: util.cpp:1274
findMembersWithSpecificName
static void findMembersWithSpecificName(const MemberName *mn, const QCString &args, bool checkStatics, const FileDef *currentFile, bool checkCV, std::vector< const MemberDef * > &members)
Definition: util.cpp:2144
MemberDef::getEnumScope
virtual const MemberDef * getEnumScope() const =0
SectionManager::instance
static SectionManager & instance()
returns a reference to the singleton
Definition: section.h:172
ConceptDef::isLinkable
virtual bool isLinkable() const =0
BaseOutputDocInterface::writeObjectLink
virtual void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)=0
reg::Ex
Class representing a regular expression.
Definition: regex.h:48
ColoredImage
Class representing a bitmap image colored based on hue/sat/gamma settings.
Definition: image.h:56
MemberDef::isEnumerate
virtual bool isEnumerate() const =0
ClassDef::getReference
virtual QCString getReference() const =0
If this class originated from a tagfile, this will return the tag file reference
BaseOutputDocInterface::docify
virtual void docify(const QCString &s)=0
escapeCharsInString
QCString escapeCharsInString(const QCString &name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:3442
MemberListType_priMethods
@ MemberListType_priMethods
Definition: types.h:110
insideTable
static bool insideTable(DocNode *n)
Definition: docparser.cpp:611
BufStr::curPos
uint curPos() const
Definition: bufstr.h:112
term
void term(const char *fmt,...)
Definition: message.cpp:220
Definition::getOuterScope
virtual Definition * getOuterScope() const =0
MemberListType_proSlots
@ MemberListType_proSlots
Definition: types.h:116
extractCanonicalType
static QCString extractCanonicalType(const Definition *d, const FileDef *fs, QCString type)
Definition: util.cpp:1761
OutputList::parseText
void parseText(const QCString &textStr)
Definition: outputlist.cpp:179
FileInfo
Minimal replacement for QFileInfo.
Definition: fileinfo.h:22
Argument::docs
QCString docs
Definition: arguments.h:55
FileInfo::absFilePath
std::string absFilePath() const
Definition: fileinfo.cpp:101
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
SrcLangExt_IDL
@ SrcLangExt_IDL
Definition: types.h:44
MemberDef::getFileDef
virtual const FileDef * getFileDef() const =0
Config_getString
#define Config_getString(name)
Definition: config.h:32
DefinitionMutable::setBodySegment
virtual void setBodySegment(int defLine, int bls, int ble)=0
SectionInfo
class that provide information about a section.
Definition: section.h:49
MemberGroup::insertMember
void insertMember(const MemberDef *md)
Definition: membergroup.cpp:48
DefinitionMutable::setRefItems
virtual void setRefItems(const RefItemVector &sli)=0
OutputList::generateDoc
void generateDoc(const QCString &fileName, int startLine, const Definition *ctx, const MemberDef *md, const QCString &docStr, bool indexWords, bool isExample, const QCString &exampleName, bool singleLine, bool linkFromIndex, bool markdownSupport)
Definition: outputlist.cpp:142
Argument::name
QCString name
Definition: arguments.h:52
MemberDef::argumentList
virtual const ArgumentList & argumentList() const =0
resolveRef
bool resolveRef(const QCString &scName, const QCString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, bool lookForSpecialization, const FileDef *currentFile, bool checkScope)
Definition: util.cpp:2757
convertNameToFile
QCString convertNameToFile(const QCString &name, bool allowDots, bool allowUnderscore)
Definition: util.cpp:3604
MemberListType_pubAttribs
@ MemberListType_pubAttribs
Definition: types.h:118
MemberDef::setMemberGroup
virtual void setMemberGroup(MemberGroup *grp)=0
convertCharEntitiesToUTF8
QCString convertCharEntitiesToUTF8(const QCString &str)
Definition: util.cpp:4170
operatorScope
static const char operatorScope[]
Definition: util.cpp:500
Doxygen::namespaceLinkedMap
static NamespaceLinkedMap * namespaceLinkedMap
Definition: doxygen.h:97
Lang2ExtMap::parserId
SrcLangExt parserId
Definition: util.cpp:5441
findParameterList
int findParameterList(const QCString &name)
Returns the position in the string where a function parameter list begins, or -1 if one is not found.
Definition: util.cpp:818
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
SrcLangExt_Markdown
@ SrcLangExt_Markdown
Definition: types.h:57
OutputList::pushGeneratorState
void pushGeneratorState()
Definition: outputlist.cpp:126
getFileNameExtension
QCString getFileNameExtension(const QCString &fn)
Definition: util.cpp:5621
QCString::data
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
Definition: qcstring.h:153
FindFileCacheElem
Cache element for the file name to FileDef mapping cache.
Definition: util.cpp:3211
g_usedNamesCount
static int g_usedNamesCount
Definition: util.cpp:3598
TagInfo::fileName
QCString fileName
Definition: entry.h:51
FileDef
A model of a file symbol.
Definition: filedef.h:73
MemberGroup
A class representing a group of members.
Definition: membergroup.h:41
PageDef::title
virtual QCString title() const =0
Dir::exists
bool exists() const
Definition: dir.cpp:199
Entry::HEADER_SEC
@ HEADER_SEC
Definition: entry.h:89
SrcLangExt_VHDL
@ SrcLangExt_VHDL
Definition: types.h:54
maxInheritanceDepth
const int maxInheritanceDepth
Definition: util.cpp:150
stripFromPath
static QCString stripFromPath(const QCString &path, const StringVector &l)
Definition: util.cpp:292
Debug::Rtf
@ Rtf
Definition: debug.h:44
OutputList::writeObjectLink
void writeObjectLink(const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name)
Definition: outputlist.h:141
Dir::rmdir
bool rmdir(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:251
FileInfo::fileName
std::string fileName() const
Definition: fileinfo.cpp:118
Lang2ExtMap::langName
const char * langName
Definition: util.cpp:5439
FortranFormat_Fixed
@ FortranFormat_Fixed
Definition: types.h:298
filterCRLF
static int filterCRLF(char *buf, int len)
Definition: util.cpp:1250
reg::search
bool search(const std::string &str, Match &match, const Ex &re, size_t pos)
Search in a given string str starting at position pos for a match against regular expression re.
Definition: regex.cpp:718
SymbolResolver::resolveClass
const ClassDef * resolveClass(const Definition *scope, const QCString &name, bool maybeUnlinkable=false, bool mayBeHidden=false)
Find the class definition matching name within the scope set.
Definition: symbolresolver.cpp:1033
portable_iconv_close
int portable_iconv_close(void *cd)
ParserManager::getParserName
QCString getParserName(const QCString &extension)
Gets the name of the parser associated with given extension.
Definition: parserintf.h:233
filterLatexString
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces)
Definition: util.cpp:4934
FortranFormat_Unknown
@ FortranFormat_Unknown
Definition: types.h:296
getScopeFragment
int getScopeFragment(const QCString &s, int p, int *l)
Definition: util.cpp:4702
FileDef::getOutputFileBase
virtual QCString getOutputFileBase() const =0
Dir::mkdir
bool mkdir(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:237
MemberDef::isRelated
virtual bool isRelated() const =0
getFileFilter
QCString getFileFilter(const QCString &name, bool isSourceCode)
Definition: util.cpp:1315
MemberDef::typeString
virtual QCString typeString() const =0
Definition::localName
virtual QCString localName() const =0
MemberListType_pubStaticMethods
@ MemberListType_pubStaticMethods
Definition: types.h:111
OutputDocInterface::disable
virtual void disable(OutputGenerator::OutputType o)=0
Dir::cleanDirPath
static std::string cleanDirPath(const std::string &path)
Definition: dir.cpp:297
ClassDef::isLinkable
virtual bool isLinkable() const =0
return TRUE iff a link to this class is possible (either within this project, or as a cross-reference...
Translator::trDateTime
virtual QCString trDateTime(int year, int month, int day, int dayOfWeek, int hour, int minutes, int seconds, bool includeTime)=0
stringToArgumentList
std::unique_ptr< ArgumentList > stringToArgumentList(SrcLangExt lang, const QCString &argsString, QCString *extraTypeChars=0)
g_rtfFormatMutex
static std::mutex g_rtfFormatMutex
Definition: util.cpp:5226
matchArguments2
bool matchArguments2(const Definition *srcScope, const FileDef *srcFileScope, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const ArgumentList *dstAl, bool checkCV)
Definition: util.cpp:1919
FindFileCacheElem::fileDef
FileDef * fileDef
Definition: util.cpp:3214
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
QCString::prepend
QCString & prepend(const char *s)
Definition: qcstring.h:339
QCString::resize
bool resize(size_t newlen)
Resizes the string to hold newlen characters (this value should also count the 0-terminator).
Definition: qcstring.h:164
GroupDef::addPage
virtual void addPage(const PageDef *def)=0
QCString::sprintf
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:24
CharAroundSpace::charMap
CharElem charMap[256]
Definition: util.cpp:538
PageDef::setShowLineNo
virtual void setShowLineNo(bool)=0
ClassDef::templateArguments
virtual const ArgumentList & templateArguments() const =0
Returns the template arguments of this class
MemberDef::getGroupDef
virtual const GroupDef * getGroupDef() const =0
createDocParser
std::unique_ptr< IDocParser > createDocParser()
Definition: docparser.cpp:179
Config_getList
#define Config_getList(name)
Definition: config.h:37
Translator::trWriteList
virtual QCString trWriteList(int numEntries)=0
FALSE
#define FALSE
Definition: qcstring.h:33
recursivelyAddGroupListToTitle
bool recursivelyAddGroupListToTitle(OutputList &ol, const Definition *d, bool root)
Definition: util.cpp:4899
Doxygen::exampleLinkedMap
static PageLinkedMap * exampleLinkedMap
Definition: doxygen.h:81
BufStr::addChar
void addChar(char c)
Definition: bufstr.h:57
ClassDef::anchor
virtual QCString anchor() const =0
SrcLangExt_Slice
@ SrcLangExt_Slice
Definition: types.h:59
OutputGenerator::Man
@ Man
Definition: outputgen.h:333
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108