util.h File Reference

A bunch of utility functions. More...

#include "qtbc.h"
#include <qlist.h>
#include <qtextstream.h>
#include <ctype.h>
#include "sortdict.h"

Go to the source code of this file.

Classes

class  TextGeneratorIntf
class  TextGeneratorOLImpl

Enumerations

enum  SrcLangExt {
  SrcLangExt_IDL = 0x0008, SrcLangExt_Java = 0x0010, SrcLangExt_CSharp = 0x0020, SrcLangExt_D = 0x0040,
  SrcLangExt_PHP = 0x0080, SrcLangExt_ObjC = 0x0100, SrcLangExt_Cpp = 0x0200, SrcLangExt_JS = 0x0400,
  SrcLangExt_Python = 0x0800, SrcLangExt_F90 = 0x1000, SrcLangExt_VHDL = 0x2000
}

Functions

void linkifyText (const TextGeneratorIntf &ol, Definition *scope, FileDef *fileScope, const char *name, const char *text, bool autoBreak=FALSE, bool external=TRUE, bool keepSpaces=FALSE)
void setAnchors (ClassDef *cd, char id, MemberList *ml, int groupId=-1)
QCString fileToString (const char *name, bool filter=FALSE)
QCString dateToString (bool)
bool getDefs (const QCString &scopeName, const QCString &memberName, const char *, MemberDef *&md, ClassDef *&cd, FileDef *&fd, NamespaceDef *&nd, GroupDef *&gd, bool forceEmptyScope=FALSE, FileDef *currentFile=0, bool checkCV=FALSE)
QCString getFileFilter (const char *name)
bool resolveRef (const char *scName, const char *name, bool inSeeBlock, Definition **resContext, MemberDef **resMember)
bool resolveLink (const char *scName, const char *lr, bool inSeeBlock, Definition **resContext, QCString &resAnchor)
bool generateRef (OutputDocInterface &od, const char *, const char *, bool inSeeBlock, const char *=0)
bool generateLink (OutputDocInterface &od, const char *, const char *, bool inSeeBlock, const char *)
void generateFileRef (OutputDocInterface &od, const char *, const char *linkTxt=0)
void writePageRef (OutputDocInterface &od, const char *cn, const char *mn)
QCString getCanonicalTemplateSpec (Definition *d, FileDef *fs, const QCString &spec)
bool matchArguments2 (Definition *srcScope, FileDef *srcFileScope, ArgumentList *srcAl, Definition *dstScope, FileDef *dstFileScope, ArgumentList *dstAl, bool checkCV)
void mergeArguments (ArgumentList *, ArgumentList *, bool forceNameOverwrite=FALSE)
QCString substituteClassNames (const QCString &s)
QCString substitute (const char *s, const char *src, const char *dst)
QCString resolveDefines (const char *n)
ClassDefgetClass (const char *key)
ClassDefgetResolvedClass (Definition *scope, FileDef *fileScope, const char *key, MemberDef **pTypeDef=0, QCString *pTemplSpec=0, bool mayBeUnlinkable=FALSE, bool mayBeHidden=FALSE, QCString *pResolvedType=0)
NamespaceDefgetResolvedNamespace (const char *key)
FileDeffindFileDef (const FileNameDict *fnDict, const char *n, bool &ambig)
QCString showFileDefMatches (const FileNameDict *fnDict, const char *n)
int guessSection (const char *name)
bool isId (int c)
QCString removeRedundantWhiteSpace (const QCString &s)
QCString argListToString (ArgumentList *al, bool useCanonicalType=FALSE)
QCString tempArgListToString (ArgumentList *al)
QCString generateMarker (int id)
void writeExample (OutputList &ol, ExampleSDict *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 char *title, const QCString &relPath="")
int getPrefixIndex (const QCString &name)
QCString removeAnonymousScopes (const QCString &s)
QCString replaceAnonymousScopes (const QCString &s, const char *replacement=0)
void initClassHierarchy (ClassSDict *cl)
bool hasVisibleRoot (BaseClassList *bcl)
int minClassDistance (const ClassDef *cd, const ClassDef *bcd, int level=0)
QCString convertNameToFile (const char *name, bool allowDots=FALSE)
void extractNamespaceName (const QCString &scopeName, QCString &className, QCString &namespaceName, bool allowEmptyClass=FALSE)
QCString insertTemplateSpecifierInScope (const QCString &scope, const QCString &templ)
QCString stripScope (const char *name)
QCString convertToHtml (const char *s, bool keepEntities=TRUE)
QCString convertToXML (const char *s)
QCString getOverloadDocs ()
void addMembersToMemberGroup (MemberList *ml, MemberGroupSDict **ppMemberGroupSDict, Definition *context)
int extractClassNameFromType (const QCString &type, int &pos, QCString &name, QCString &templSpec)
QCString substituteTemplateArgumentsInString (const QCString &name, ArgumentList *formalArgs, ArgumentList *actualArgs)
ArgumentListcopyArgumentList (const ArgumentList *src)
QList< ArgumentList > * copyArgumentLists (const QList< ArgumentList > *srcLists)
QCString stripTemplateSpecifiersFromScope (const QCString &fullName, bool parentOnly=TRUE, QCString *lastScopeStripped=0)
QCString resolveTypeDef (Definition *d, const QCString &name, Definition **typedefContext=0)
QCString mergeScopes (const QCString &leftScope, const QCString &rightScope)
int getScopeFragment (const QCString &s, int p, int *l)
int filterCRLF (char *buf, int len)
void addRefItem (const QList< ListItemInfo > *sli, const char *prefix, const char *name, const char *title, const char *args=0)
PageDefaddRelatedPage (const char *name, const QCString &ptitle, const QCString &doc, QList< SectionInfo > *anchors, const char *fileName, int startLine, const QList< ListItemInfo > *sli, GroupDef *gd=0, TagInfo *tagInfo=0)
QCString escapeCharsInString (const char *name, bool allowDots)
void addGroupListToTitle (OutputList &ol, Definition *d)
void filterLatexString (QTextStream &t, const char *str, bool insideTabbing=FALSE, bool insidePre=FALSE, bool insideItem=FALSE)
QCString rtfFormatBmkStr (const char *name)
QCString linkToText (const char *link, bool isFileName)
QCString stripExtension (const char *fName)
void replaceNamespaceAliases (QCString &scope, int i)
int isAccessibleFrom (Definition *scope, FileDef *fileScope, Definition *item)
int isAccessibleFromWithExpScope (Definition *scope, FileDef *fileScope, Definition *item, const QCString &explicitScopePart)
int computeQualifiedIndex (const QCString &name)
void addDirPrefix (QCString &fileName)
QCString relativePathToRoot (const char *name)
void createSubDirs (QDir &d)
QCString stripPath (const char *s)
bool containsWord (const QCString &s, const QCString &word)
bool findAndRemoveWord (QCString &s, const QCString &word)
QCString stripLeadingAndTrailingEmptyLines (const QCString &s)
void stringToSearchIndex (const QCString &docUrlBase, const QCString &title, const QCString &str, bool priority=FALSE, const QCString &anchor="")
SrcLangExt getLanguageFromFileName (const QCString fileName)
bool checkIfTypedef (Definition *scope, FileDef *fileScope, const char *n)
ClassDefnewResolveTypedef (FileDef *fileScope, MemberDef *md, MemberDef **pMemType=0, QCString *pTemplSpec=0, QCString *pResolvedType=0)
QCString parseCommentAsText (const QString &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, int pos)
int countAliasArguments (const QCString argList)
QCString replaceAliasArguments (const QCString &aliasValue, const QCString &argList)
QCString resolveAliasCmd (const QCString aliasCmd)
QCString expandAlias (const QCString &aliasName, const QCString &aliasValue)
void writeTypeConstraints (OutputList &ol, Definition *d, ArgumentList *al)
QCString convertCharEntitiesToUTF8 (const QCString &s)


Detailed Description

A bunch of utility functions.

Definition in file util.h.


Enumeration Type Documentation

enum SrcLangExt

Enumerator:
SrcLangExt_IDL 
SrcLangExt_Java 
SrcLangExt_CSharp 
SrcLangExt_D 
SrcLangExt_PHP 
SrcLangExt_ObjC 
SrcLangExt_Cpp 
SrcLangExt_JS 
SrcLangExt_Python 
SrcLangExt_F90 
SrcLangExt_VHDL 

Definition at line 86 of file util.h.


Function Documentation

void addDirPrefix ( QCString &  fileName  ) 

void addGroupListToTitle ( OutputList ol,
Definition d 
)

Definition at line 5699 of file util.cpp.

References OutputList::disableAllBut(), OutputList::docify(), OutputList::endSmall(), GroupDef::getOutputFileBase(), Definition::getReference(), GroupDef::groupTitle(), OutputGenerator::Html, OutputList::lineBreak(), Definition::partOfGroups(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), OutputList::startSmall(), OutputList::writeNonBreakableSpace(), and OutputList::writeObjectLink().

Referenced by ClassDef::writeDocumentation(), FileDef::writeDocumentation(), GroupDef::writeDocumentation(), and NamespaceDef::writeDocumentation().

void addMembersToMemberGroup ( MemberList ml,
MemberGroupSDict **  ppMemberGroupSDict,
Definition context 
)

Definition at line 5159 of file util.cpp.

References addMembersToMemberGroup(), MemberGroupInfo::doc, MemberGroupInfo::docFile, MemberDef::enumFieldList(), MemberDef::getMemberGroupId(), MemberGroupInfo::header, MemberGroup::insertMember(), MemberDef::isEnumerate(), Doxygen::memGrpInfoDict, SIntDict< T >::setAutoDelete(), and MemberDef::setMemberGroup().

Referenced by addMembersToMemberGroup().

void addRefItem ( const QList< ListItemInfo > *  sli,
const char *  prefix,
const char *  name,
const char *  title,
const char *  args = 0 
)

Definition at line 5651 of file util.cpp.

References addRelatedPage(), Config_getBool, ListItemInfo::itemId, RefItem::listAnchor, QCString, RefItem::text, ListItemInfo::type, RefItem::written, and Doxygen::xrefLists.

Referenced by MemberDef::addListReference(), ClassDef::addListReferences(), FileDef::addListReferences(), GroupDef::addListReferences(), and NamespaceDef::addListReferences().

PageDef* addRelatedPage ( const char *  name,
const QCString &  ptitle,
const QCString &  doc,
QList< SectionInfo > *  anchors,
const char *  fileName,
int  startLine,
const QList< ListItemInfo > *  sli,
GroupDef gd = 0,
TagInfo tagInfo = 0 
)

Definition at line 5571 of file util.cpp.

References GroupDef::addPage(), addRelatedPage(), SDict< T >::append(), Config_getBool, Doxygen::htmlFileExtension, Definition::name(), SectionInfo::Page, Doxygen::pageSDict, QCString, Doxygen::sectionDict, Definition::setDocumentation(), PageDef::setFileName(), Definition::setReference(), Definition::setRefItems(), and TagInfo::tagName.

Referenced by addRefItem(), and addRelatedPage().

QCString argListToString ( ArgumentList al,
bool  useCanonicalType = FALSE 
)

Definition at line 1850 of file util.cpp.

References Argument::array, Argument::attrib, Argument::canType, ArgumentList::constSpecifier, Argument::defval, Argument::name, QCString, removeRedundantWhiteSpace(), Argument::type, and ArgumentList::volatileSpecifier.

bool checkIfTypedef ( Definition scope,
FileDef fileScope,
const char *  n 
)

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

Definition at line 6315 of file util.cpp.

References computeQualifiedIndex(), DefinitionIntf::definitionType(), Doxygen::globalScope, isAccessibleFromWithExpScope(), MemberDef::isTypedef(), QCString, replaceNamespaceAliases(), Doxygen::symbolMap, DefinitionIntf::TypeClass, DefinitionIntf::TypeMember, DefinitionIntf::TypeNamespace, and DefinitionIntf::TypeSymbolList.

int computeQualifiedIndex ( const QCString &  name  ) 

Definition at line 1076 of file util.cpp.

Referenced by checkIfTypedef(), and getResolvedClassRec().

bool containsWord ( const QCString &  s,
const QCString &  word 
)

returns TRUE iff string s contains word w

Definition at line 6179 of file util.cpp.

QCString convertCharEntitiesToUTF8 ( const QCString &  s  ) 

Definition at line 5051 of file util.cpp.

References QCString.

Referenced by HtmlDocVisitor::visitPre(), and LatexDocVisitor::visitPre().

QCString convertNameToFile ( const char *  name,
bool  allowDots 
)

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.

Definition at line 4662 of file util.cpp.

References Config_getBool, escapeCharsInString(), Doxygen::htmlDirMap, and QCString.

Referenced by Definition::convertNameToFile(), DotInclDepGraph::diskName(), parseFortranCode(), parseVhdlCode(), DotGfxHierarchyTable::writeGraph(), DotClassGraph::writeGraph(), DotInclDepGraph::writeGraph(), and DotGroupCollaboration::writeGraph().

QCString convertToHtml ( const char *  s,
bool  keepEntities 
)

Converts a string to a HTML-encoded string

Definition at line 5007 of file util.cpp.

References isId(), and QCString.

Referenced by HtmlGenerator::startFile(), writeDirTreeNode(), writeGroupIndexItem(), and writeGroupTreeNode().

QCString convertToXML ( const char *  s  ) 

Converts a string to an XML-encoded string

Definition at line 4985 of file util.cpp.

References convertToXML(), and QCString.

Referenced by DocSets::addContentsItem(), convertToXML(), XmlDocVisitor::visitPre(), ClassDef::writeClassDiagrams(), HtmlGenerator::writeCodeLink(), ClassSDict::writeDeclaration(), MemberDef::writeDeclaration(), NamespaceSDict::writeDeclaration(), ClassDef::writeDocumentation(), DirDef::writeDocumentation(), FileDef::writeDocumentation(), GroupDef::writeDocumentation(), NamespaceDef::writeDocumentation(), PageDef::writeDocumentation(), MemberDef::writeEnumDeclaration(), writeIndex(), VhdlDocGen::writeVHDLDeclaration(), DotNode::writeXML(), writeXMLLink(), and writeXMLString().

ArgumentList* copyArgumentList ( const ArgumentList src  ) 

Makes a deep copy of argument list src. Will allocate memory, that is owned by the caller.

Definition at line 5388 of file util.cpp.

References ArgumentList::constSpecifier, ArgumentList::pureSpecifier, and ArgumentList::volatileSpecifier.

Referenced by copyArgumentLists().

QList<ArgumentList>* copyArgumentLists ( const QList< ArgumentList > *  srcLists  ) 

Makes a deep copy of the list of argument lists srcLists. Will allocate memory, that is owned by the caller.

Definition at line 5408 of file util.cpp.

References copyArgumentList().

Referenced by Entry::Entry(), and MemberDef::setDefinitionTemplateParameterLists().

int countAliasArguments ( const QCString  argList  ) 

Definition at line 6520 of file util.cpp.

Referenced by expandAliasRec().

void createSubDirs ( QDir &  d  ) 

Definition at line 4766 of file util.cpp.

References Config_getBool.

Referenced by generateXML(), HtmlGenerator::init(), LatexGenerator::init(), ManGenerator::init(), RTFGenerator::init(), ClassDef::writeQuickMemberLinks(), FileDef::writeQuickMemberLinks(), GroupDef::writeQuickMemberLinks(), and NamespaceDef::writeQuickMemberLinks().

QCString dateToString ( bool   ) 

Definition at line 2194 of file util.cpp.

References convertToQCString(), and QCString.

Referenced by ManGenerator::endTitleHead(), generateOutput(), substituteKeywords(), and LatexGenerator::writeStyleSheetFile().

QCString escapeCharsInString ( const char *  name,
bool  allowDots 
)

Definition at line 4610 of file util.cpp.

References Config_getBool, and QCString.

Referenced by convertNameToFile(), and setAnchors().

QCString expandAlias ( const QCString &  aliasName,
const QCString &  aliasValue 
)

Definition at line 6562 of file util.cpp.

References expandAliasRec(), and QCString.

QCString extractAliasArgs ( const QCString &  args,
int  pos 
)

Definition at line 6532 of file util.cpp.

Referenced by expandAliasRec().

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

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.

Definition at line 5252 of file util.cpp.

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.

Definition at line 4786 of file util.cpp.

References getClass(), getResolvedNamespace(), Definition::name(), and QCString.

Referenced by ClassDefImpl::init(), and writeAlphabeticalClassList().

QCString fileToString ( const char *  name,
bool  filter 
)

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.

Definition at line 2101 of file util.cpp.

References err(), Debug::ExtCmd, filterCRLF(), getFileFilter(), portable_pclose(), portable_popen(), Debug::print(), QCString, and transcodeCharacterStringToUTF8().

Referenced by FormulaList::generateBitmaps(), HtmlGenerator::init(), FileDef::parseSource(), LatexGenerator::startIndexSection(), FileDef::writeSource(), HtmlGenerator::writeStyleInfo(), and writeXMLCodeBlock().

int filterCRLF ( char *  buf,
int  len 
)

takes the buf of the given lenght len and converts CR LF (DOS) or CR (MAC) line ending to LF (Unix). Returns the length of the converted content (i.e. the same as len (Unix, MAC) or smaller (DOS).

Definition at line 1952 of file util.cpp.

Referenced by copyAndFilterFile(), and fileToString().

void filterLatexString ( QTextStream &  t,
const char *  str,
bool  insideTabbing = FALSE,
bool  insidePre = FALSE,
bool  insideItem = FALSE 
)

Definition at line 5915 of file util.cpp.

References Config_getBool, Translator::idLanguage(), Translator::idLanguageCharset(), and theTranslator.

Referenced by LatexGenerator::docify().

bool findAndRemoveWord ( QCString &  s,
const QCString &  word 
)

Definition at line 6191 of file util.cpp.

FileDef* findFileDef ( const FileNameDict fnDict,
const char *  n,
bool &  ambig 
)

Definition at line 4416 of file util.cpp.

References convertToQCString(), FindFileCacheElem::fileDef, FileDef::getPath(), FindFileCacheElem::isAmbig, QCString, and stripFromIncludePath().

Referenced by generateFileRef(), getDefs(), DocDotFile::parse(), resolveLink(), resolveRef(), and ClassDef::showUsedFiles().

void generateFileRef ( OutputDocInterface od,
const char *  ,
const char *  linkTxt = 0 
)

Definition at line 4343 of file util.cpp.

References BaseOutputDocInterface::docify(), findFileDef(), FileDef::getOutputFileBase(), Definition::getReference(), Doxygen::inputNameDict, FileDef::isLinkable(), QCString, and BaseOutputDocInterface::writeObjectLink().

bool generateLink ( OutputDocInterface od,
const char *  ,
const char *  ,
bool  inSeeBlock,
const char *   
)

Definition at line 4301 of file util.cpp.

References BaseOutputDocInterface::docify(), err(), generateLink(), linkToText(), QCString, resolveLink(), DefinitionIntf::TypeFile, DefinitionIntf::TypeGroup, BaseOutputDocInterface::writeObjectLink(), and writePageRef().

Referenced by generateLink().

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.

Definition at line 241 of file util.cpp.

References QCString.

Referenced by TranslatorArabic::trWriteList(), TranslatorBrazilian::trWriteList(), TranslatorCatalan::trWriteList(), TranslatorChinese::trWriteList(), TranslatorCzech::trWriteList(), TranslatorGerman::trWriteList(), TranslatorDanish::trWriteList(), TranslatorEnglish::trWriteList(), TranslatorSpanish::trWriteList(), TranslatorPersian::trWriteList(), TranslatorFinnish::trWriteList(), TranslatorFrench::trWriteList(), TranslatorGreek::trWriteList(), TranslatorCroatian::trWriteList(), TranslatorHungarian::trWriteList(), TranslatorIndonesian::trWriteList(), TranslatorItalian::trWriteList(), TranslatorJapanese::trWriteList(), TranslatorKorean::trWriteList(), TranslatorLithuanian::trWriteList(), TranslatorMacedonian::trWriteList(), TranslatorDutch::trWriteList(), TranslatorNorwegian::trWriteList(), TranslatorPolish::trWriteList(), TranslatorPortuguese::trWriteList(), TranslatorRomanian::trWriteList(), TranslatorRussian::trWriteList(), TranslatorSwedish::trWriteList(), TranslatorSlovene::trWriteList(), TranslatorSlovak::trWriteList(), TranslatorSerbian::trWriteList(), TranslatorChinesetraditional::trWriteList(), TranslatorUkrainian::trWriteList(), and TranslatorAfrikaans::trWriteList().

bool generateRef ( OutputDocInterface od,
const char *  scName,
const char *  name,
bool  inSeeBlock,
const char *  rt 
)

generate a reference to a class, namespace or member. `scName' is the name of the scope that contains the documentation string that is returned. `name' is the name that we want to link to. `name' may have five formats: 1) "ScopeName" 2) "memberName()" one of the (overloaded) function or define with name memberName. 3) "memberName(...)" a specific (overloaded) function or define with name memberName 4) "name a global variable or define 4) "#memberName member variable, global variable or define 5) ("ScopeName::")+"memberName()" 6) ("ScopeName::")+"memberName(...)" 7) ("ScopeName::")+"memberName" instead of :: the # symbol may also be used.

Definition at line 4160 of file util.cpp.

References MemberDef::anchor, DefinitionIntf::definitionType(), BaseOutputDocInterface::docify(), Definition::getOutputFileBase(), MemberDef::getOutputFileBase(), Definition::getReference(), MemberDef::getReference(), Definition::isLinkable(), MemberDef::isLinkable(), Definition::isReference(), linkToText(), QCString, resolveRef(), DefinitionIntf::TypeFile, DefinitionIntf::TypeGroup, BaseOutputDocInterface::writeObjectLink(), and writePageRef().

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

Definition at line 3006 of file util.cpp.

References QCString, and resolveTypeDef().

ClassDef* getClass ( const char *  name  ) 

Get a class definition given its name. Returns 0 if the class is not found.

Definition at line 437 of file util.cpp.

References Doxygen::classSDict, and SDict< T >::find().

Referenced by extractNamespaceName(), MemberDef::getClassDefOfAnonymousType(), getTemplateArgumentsFromName(), insertTemplateSpecifierInScope(), MemberDef::isDocumentedFriendClass(), linkifyText(), resolveLink(), stripTemplateSpecifiersFromScope(), and MemberDef::writeDeclaration().

bool getDefs ( const QCString &  scName,
const QCString &  memberName,
const char *  args,
MemberDef *&  md,
ClassDef *&  cd,
FileDef *&  fd,
NamespaceDef *&  nd,
GroupDef *&  gd,
bool  forceEmptyScope,
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:

Definition at line 3513 of file util.cpp.

References MemberDef::argumentList(), Config_getBool, SDict< T >::find(), findFileDef(), found, Doxygen::functionNameSDict, Definition::getBodyDef(), MemberDef::getClassDef(), ClassDef::getFileDef(), MemberDef::getFileDef(), MemberDef::getGroupDef(), MemberDef::getNamespaceDef(), Definition::getOuterScope(), getResolvedClass(), Doxygen::globalScope, Doxygen::inputNameDict, MemberDef::isDefine(), FileDef::isLinkable(), GroupDef::isLinkable(), NamespaceDef::isLinkable(), MemberDef::isLinkable(), ClassDef::isLinkable(), MemberDef::isRelated(), MemberDef::isStatic(), matchArguments2(), maxInheritanceDepth, Doxygen::memberNameSDict, minClassDistance(), ClassDef::name, Doxygen::namespaceSDict, LockingPtr< T >::pointer(), QCString, and stringToArgumentList().

Referenced by linkifyText(), and resolveRef().

QCString getFileFilter ( const char *  name  ) 

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.

Definition at line 1980 of file util.cpp.

References Config_getList, Config_getString, portable_fileSystemIsCaseSensitive(), and QCString.

Referenced by copyAndFilterFile(), fileToString(), and preprocessFile().

SrcLangExt getLanguageFromFileName ( const QCString  fileName  ) 

Definition at line 6267 of file util.cpp.

References QCString, SrcLangExt_Cpp, SrcLangExt_CSharp, SrcLangExt_D, SrcLangExt_F90, SrcLangExt_IDL, SrcLangExt_Java, SrcLangExt_JS, SrcLangExt_ObjC, SrcLangExt_PHP, SrcLangExt_Python, and SrcLangExt_VHDL.

Referenced by DocSets::addIndexItem(), MemberDef::isConstructor(), and MemberDef::isDestructor().

QCString getOverloadDocs (  ) 

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

Definition at line 5151 of file util.cpp.

References theTranslator, and Translator::trOverloadText().

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

Definition at line 4541 of file util.cpp.

References Config_getList.

Referenced by addClassMemberNameToIndex(), addFileMemberNameToIndex(), addNamespaceMemberNameToIndex(), PrefixIgnoreClassList::compareItems(), MemberNameSDict::compareItems(), writeAlphabeticalClassList(), and writeAnnotatedClassList().

ClassDef* getResolvedClass ( Definition scope,
FileDef fileScope,
const char *  key,
MemberDef **  pTypeDef = 0,
QCString *  pTemplSpec = 0,
bool  mayBeUnlinkable = FALSE,
bool  mayBeHidden = FALSE,
QCString *  pResolvedType = 0 
)

Definition at line 1410 of file util.cpp.

References DefinitionIntf::definitionType(), getResolvedClassRec(), Doxygen::globalScope, Definition::isHidden(), FileDef::isJava(), ClassDef::isLinkable(), QCString, DefinitionIntf::TypeClass, and DefinitionIntf::TypeNamespace.

Referenced by VariableContext::addVariable(), PyVariableContext::addVariable(), getDefs(), and linkifyText().

NamespaceDef* getResolvedNamespace ( const char *  key  ) 

Definition at line 443 of file util.cpp.

References SDict< T >::find(), Doxygen::namespaceAliasDict, Doxygen::namespaceSDict, QCString, and warn_cont().

Referenced by extractNamespaceName(), and writeAlphabeticalClassList().

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

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

Parameters:
s the scope name as a string.
p the start position (0 is the first).
l the resulting length of the fragment.
Returns:
the location of the fragment, or -1 if non is found.

Definition at line 5524 of file util.cpp.

References found.

Referenced by resolveTypeDef(), and stripAnonymousNamespaceScope().

int guessSection ( const char *  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 :-)

Definition at line 289 of file util.cpp.

References Entry::HEADER_SEC, QCString, and Entry::SOURCE_SEC.

Referenced by TagFileParser::buildLists(), FileDef::generateSourceFile(), and ClassDefImpl::init().

bool hasVisibleRoot ( BaseClassList bcl  ) 

Definition at line 4593 of file util.cpp.

References ClassDef::baseClasses(), hasVisibleRoot(), and ClassDef::isVisibleInHierarchy().

Referenced by hasVisibleRoot(), and writeClassTree().

void initClassHierarchy ( ClassSDict cl  ) 

Definition at line 4580 of file util.cpp.

References ClassDef::baseClasses(), SDict< ClassDef >::Iterator, and ClassDef::visited.

Referenced by countClassHierarchy(), DotGfxHierarchyTable::DotGfxHierarchyTable(), and writeClassHierarchy().

QCString insertTemplateSpecifierInScope ( const QCString &  scope,
const QCString &  templ 
)

Definition at line 4831 of file util.cpp.

References getClass(), QCString, and ClassDef::templateArguments().

Referenced by DiagramItem::label().

int isAccessibleFrom ( Definition scope,
FileDef fileScope,
Definition item 
)

Definition at line 820 of file util.cpp.

References accessibleViaUsingClass(), accessibleViaUsingNamespace(), MemberDef::definitionType(), DefinitionIntf::definitionType(), Definition::getOuterScope(), Doxygen::globalScope, isAccessibleFrom(), QCString, DefinitionIntf::TypeClass, DefinitionIntf::TypeMember, and DefinitionIntf::TypeNamespace.

Referenced by isAccessibleFrom(), and isAccessibleFromWithExpScope().

int isAccessibleFromWithExpScope ( Definition scope,
FileDef fileScope,
Definition item,
const QCString &  explicitScopePart 
)

bool isId ( int  c  ) 

Definition at line 119 of file util.cpp.

Referenced by convertToHtml(), MemberDef::getClassDefOfAnonymousType(), removeIdsAndMarkers(), removeRedundantWhiteSpace(), tempArgListToString(), and MemberDef::writeDocumentation().

bool leftScopeMatch ( const QCString &  scope,
const QCString &  name 
)

Definition at line 1640 of file util.cpp.

Referenced by mergeScopes().

void linkifyText ( const TextGeneratorIntf ol,
Definition scope,
FileDef fileScope,
const char *  name,
const char *  text,
bool  autoBreak = FALSE,
bool  external = TRUE,
bool  keepSpaces = FALSE 
)

Definition at line 1650 of file util.cpp.

References MemberDef::anchor, DefinitionIntf::definitionType(), found, getClass(), getDefs(), MemberDef::getOutputFileBase(), ClassDef::getOutputFileBase(), MemberDef::getReference(), ClassDef::getReference(), getResolvedClass(), MemberDef::isEnumerate(), MemberDef::isLinkable(), ClassDef::isLinkable(), MemberDef::isLinkableInProject(), ClassDef::isLinkableInProject(), Definition::isReference(), MemberDef::isTypedef(), MemberDef::isVariable(), Definition::name(), QCString, substitute(), DefinitionIntf::TypeClass, DefinitionIntf::TypeNamespace, TextGeneratorIntf::writeBreak(), TextGeneratorIntf::writeLink(), and TextGeneratorIntf::writeString().

Referenced by MemberDef::writeDeclaration(), MemberDef::writeDocumentation(), and writeTypeConstraints().

QCString linkToText ( const char *  link,
bool  isFileName 
)

Definition at line 4118 of file util.cpp.

References Config_getBool, QCString, and substitute().

Referenced by DotCallGraph::buildGraph(), DocRef::DocRef(), DotCallGraph::DotCallGraph(), generateLink(), and generateRef().

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

Definition at line 3279 of file util.cpp.

References ArgumentList::constSpecifier, MATCH, NOMATCH, and ArgumentList::volatileSpecifier.

Referenced by getDefs(), GroupDef::insertMember(), and ClassDef::mergeMembers().

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

Definition at line 3363 of file util.cpp.

References Argument::defval, Argument::docs, Argument::name, and Argument::type.

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

Parameters:
leftScope the left hand part of the scope.
rightScope the right hand part of the scope.
Returns:
the merged scope.

Definition at line 5489 of file util.cpp.

References found, leftScopeMatch(), and QCString.

int minClassDistance ( const ClassDef cd,
const ClassDef bcd,
int  level = 0 
)

Definition at line 2230 of file util.cpp.

References ClassDef::baseClasses(), ClassDef::categoryOf(), err(), maxInheritanceDepth, minClassDistance(), and ClassDef::name.

Referenced by getDefs(), ClassDef::getMemberByName(), and minClassDistance().

ClassDef* newResolveTypedef ( FileDef fileScope,
MemberDef md,
MemberDef **  pMemType,
QCString *  pTemplSpec,
QCString *  pResolvedType 
)

Returns the class representing the value of the typedef represented by md within file fileScope.

Example: typedef A T; will return the class representing A if it is a class.

Example: typedef int T; will return 0, since "int" is not a class.

Definition at line 489 of file util.cpp.

References MemberDef::cacheTypedefVal(), MemberDef::getCachedResolvedTypedef(), MemberDef::getCachedTypedefTemplSpec(), MemberDef::getCachedTypedefVal(), Definition::getDefFileName(), Definition::getOuterScope(), getResolvedClassRec(), MemberDef::isTypedefValCached(), newResolveTypedef(), QCString, MemberDef::qualifiedName(), stripTemplateSpecifiersFromScope(), and MemberDef::typeString().

Referenced by newResolveTypedef().

QCString parseCommentAsText ( const QString &  doc,
const QCString &  fileName,
int  lineNr 
)

Definition at line 6384 of file util.cpp.

References DocNode::accept(), Doxygen::globalScope, and validatingParseDoc().

Referenced by Definition::briefDescriptionAsTooltip().

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

Definition at line 2023 of file util.cpp.

References err(), portable_iconv(), portable_iconv_close(), portable_iconv_open(), and QCString.

QCString relativePathToRoot ( const char *  name  ) 

Definition at line 4744 of file util.cpp.

References Config_getBool, QCString, and REL_PATH_TO_ROOT.

Referenced by HtmlGenerator::startFile(), LatexGenerator::startFile(), validatingParseDoc(), and HtmlGenerator::writeHeaderFile().

QCString removeAnonymousScopes ( const QCString &  s  ) 

Removes all anoymous 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"

Definition at line 140 of file util.cpp.

References QCString.

Referenced by MemberDef::writeDeclaration().

QCString removeRedundantWhiteSpace ( const QCString &  s  ) 

Definition at line 1485 of file util.cpp.

References Config_getBool, isId(), and QCString.

Referenced by argListToString(), MemberDefImpl::init(), parseFuncDecl(), resolveRef(), and tempArgListToString().

QCString replaceAliasArguments ( const QCString &  aliasValue,
const QCString &  argList 
)

Definition at line 6499 of file util.cpp.

References QCString.

Referenced by expandAliasRec().

QCString replaceAnonymousScopes ( const QCString &  s,
const char *  replacement = 0 
)

Definition at line 167 of file util.cpp.

References QCString.

Referenced by generateDEFForMember().

void replaceNamespaceAliases ( QCString &  scope,
int  i 
)

Definition at line 6151 of file util.cpp.

References Doxygen::namespaceAliasDict, and QCString.

Referenced by checkIfTypedef(), and getResolvedClassRec().

QCString resolveAliasCmd ( const QCString  aliasCmd  ) 

Definition at line 6552 of file util.cpp.

References expandAliasRec(), and QCString.

QCString resolveDefines ( const char *  n  ) 

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

Definition at line 4209 of file util.cpp.

References MemberDef::anchor, Doxygen::directories, Doxygen::exampleSDict, findFileDef(), getClass(), PageDef::getGroupDef(), Doxygen::groupSDict, Doxygen::inputNameDict, DirDef::isLinkable(), FileDef::isLinkable(), SectionInfo::label, Definition::name(), Doxygen::namespaceSDict, Doxygen::pageSDict, QCString, resolveRef(), and Doxygen::sectionDict.

Referenced by DocLink::DocLink(), DocRef::DocRef(), and generateLink().

bool resolveRef ( const char *  scName,
const char *  name,
bool  inSeeBlock,
Definition **  resContext,
MemberDef **  resMember 
)

Returns an object to reference to given its name and context

Postcondition:
return value TRUE implies *resContext!=0 or *resMember!=0

Definition at line 3997 of file util.cpp.

References SDict< T >::find(), findFileDef(), getDefs(), Doxygen::groupSDict, Doxygen::inputNameDict, QCString, removeRedundantWhiteSpace(), and substitute().

Referenced by generateRef(), and resolveLink().

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

Definition at line 316 of file util.cpp.

References MemberDef::argsString(), DefinitionIntf::definitionType(), SDict< T >::find(), Definition::findInnerCompound(), Doxygen::functionNameSDict, Definition::getOuterScope(), getScopeFragment(), MemberDef::isTypedef(), Doxygen::memberNameSDict, QCString, resolveTypeDef(), DefinitionIntf::TypeClass, and MemberDef::typeString().

Referenced by getCanonicalTemplateSpec(), and resolveTypeDef().

bool rightScopeMatch ( const QCString &  scope,
const QCString &  name 
)

Definition at line 1631 of file util.cpp.

QCString rtfFormatBmkStr ( const char *  name  ) 

Definition at line 6100 of file util.cpp.

References QCString.

Referenced by RTFGenerator::endDoxyAnchor(), RTFGenerator::startTextLink(), RTFDocVisitor::visit(), RTFGenerator::writeAnchor(), RTFGenerator::writeCodeLink(), RTFGenerator::writeObjectLink(), and RTFGenerator::writeStartAnnoItem().

void setAnchors ( ClassDef cd,
char  id,
MemberList ml,
int  groupId = -1 
)

Definition at line 1922 of file util.cpp.

References escapeCharsInString(), Definition::isReference(), ClassDef::name, QCString, and MemberDef::setAnchor().

Referenced by ClassDef::computeAnchors(), FileDef::computeAnchors(), GroupDef::computeAnchors(), and NamespaceDef::computeAnchors().

QCString showFileDefMatches ( const FileNameDict fnDict,
const char *  n 
)

Definition at line 4492 of file util.cpp.

References FileDef::absFilePath(), FileDef::getPath(), and QCString.

Referenced by DocDotFile::parse().

void stringToSearchIndex ( const QCString &  docUrlBase,
const QCString &  title,
const QCString &  str,
bool  priority = FALSE,
const QCString &  anchor = "" 
)

Definition at line 6250 of file util.cpp.

References SearchIndex::addWord(), Config_getBool, Doxygen::searchIndex, and SearchIndex::setCurrentDoc().

Referenced by PageDef::writeDocumentation().

QCString stripAnonymousNamespaceScope ( const QCString &  s  ) 

Definition at line 194 of file util.cpp.

References getScopeFragment(), Doxygen::namespaceSDict, and QCString.

Referenced by VhdlDocGen::computeVhdlComponentRelations(), and MemberDef::getClassDefOfAnonymousType().

QCString stripExtension ( const char *  fName  ) 

Definition at line 6140 of file util.cpp.

References Doxygen::htmlFileExtension, and QCString.

Referenced by GroupDef::GroupDef(), ClassDefImpl::init(), NamespaceDef::NamespaceDef(), and MemberDef::setTagInfo().

QCString stripFromIncludePath ( const QCString &  path  ) 

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

Definition at line 280 of file util.cpp.

References Config_getList.

Referenced by findFileDef().

QCString stripFromPath ( const QCString &  path  ) 

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

Definition at line 272 of file util.cpp.

References Config_getList.

Referenced by Config::check(), DirDef::DirDef(), FileDef::FileDef(), ClassDef::showUsedFiles(), and writeFileIndex().

QCString stripLeadingAndTrailingEmptyLines ( const QCString &  s  ) 

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

Definition at line 6214 of file util.cpp.

QCString stripPath ( const char *  s  ) 

Definition at line 6167 of file util.cpp.

References QCString, and stripPath().

Referenced by LatexGenerator::startDoxyAnchor(), LatexGenerator::startSection(), LatexGenerator::startTextLink(), LatexGenerator::startTitleHead(), stripPath(), LatexDocVisitor::visitPre(), LatexGenerator::writeAnchor(), and LatexGenerator::writeObjectLink().

QCString stripScope ( const char *  name  ) 

Definition at line 4909 of file util.cpp.

References QCString.

Referenced by DefinitionImpl::init(), DiagramItem::label(), and Definition::setName().

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.

Definition at line 5429 of file util.cpp.

References getClass(), and QCString.

Referenced by newResolveTypedef(), and parseFuncDecl().

QCString substitute ( const char *  s,
const char *  src,
const char *  dst 
)

Definition at line 4389 of file util.cpp.

References QCString.

Referenced by ClassDef::displayName(), NamespaceDef::displayName(), VhdlDocGen::getClassName(), linkifyText(), linkToText(), resolveRef(), substituteKeywords(), validatingParseDoc(), writeAlphabeticalClassList(), and writeIndex().

QCString substituteClassNames ( const QCString &  s  ) 

QCString substituteKeywords ( const QCString &  s,
const char *  title,
const QCString &  relPath = "" 
)

Definition at line 4521 of file util.cpp.

References Config_getString, dateToString(), QCString, substitute(), versionString, and yearToString().

Referenced by HtmlGenerator::startFile(), LatexGenerator::startIndexSection(), and HtmlGenerator::writeSearchPage().

QCString substituteTemplateArgumentsInString ( const QCString &  name,
ArgumentList formalArgs,
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.

Definition at line 5312 of file util.cpp.

References Argument::defval, found, Argument::name, QCString, substituteTemplateArgumentsInString(), and Argument::type.

Referenced by MemberDef::createTemplateInstanceMember(), and substituteTemplateArgumentsInString().

QCString tempArgListToString ( ArgumentList al  ) 

Definition at line 1892 of file util.cpp.

References isId(), Argument::name, QCString, removeRedundantWhiteSpace(), and Argument::type.

Referenced by ClassDef::qualifiedNameWithTemplateParameters().

QCString transcodeCharacterStringToUTF8 ( const QCString &  input  ) 

Definition at line 2061 of file util.cpp.

References Config_getString, err(), portable_iconv(), portable_iconv_close(), portable_iconv_open(), and QCString.

Referenced by fileToString().

void writeExample ( OutputList ol,
ExampleSDict el 
)

Definition at line 1806 of file util.cpp.

References Example::anchor, SDict< T >::at(), SDict< T >::count(), OutputList::disable(), Example::file, OutputGenerator::Html, OutputGenerator::Latex, OutputGenerator::Man, Example::name, OutputList::parseText(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), QCString, OutputGenerator::RTF, theTranslator, Translator::trWriteList(), OutputList::writeObjectLink(), and OutputList::writeString().

Referenced by ClassDef::writeDetailedDescription(), and MemberDef::writeDocumentation().

void writePageRef ( OutputDocInterface od,
const char *  cn,
const char *  mn 
)

Definition at line 222 of file util.cpp.

References Config_getBool, OutputDocInterface::disable(), BaseOutputDocInterface::docify(), BaseOutputDocInterface::endPageRef(), OutputGenerator::Html, OutputGenerator::Latex, OutputGenerator::Man, OutputDocInterface::popGeneratorState(), OutputDocInterface::pushGeneratorState(), OutputGenerator::RTF, BaseOutputDocInterface::startPageRef(), theTranslator, and Translator::trPageAbbreviation().

Referenced by generateLink(), generateRef(), and MemberDef::writeDocumentation().

void writeTypeConstraints ( OutputList ol,
Definition d,
ArgumentList al 
)

Definition at line 6575 of file util.cpp.

References Definition::docFile(), Definition::docLine(), Argument::docs, OutputList::endConstraintDocs(), OutputList::endConstraintList(), OutputList::endConstraintParam(), OutputList::endConstraintType(), linkifyText(), Argument::name, OutputList::parseDoc(), OutputList::parseText(), OutputList::startConstraintDocs(), OutputList::startConstraintList(), OutputList::startConstraintParam(), OutputList::startConstraintType(), theTranslator, Translator::trTypeConstraints(), and Argument::type.

Referenced by ClassDef::writeDetailedDescription(), and MemberDef::writeDocumentation().



Generated on Mon Mar 31 10:58:54 2008 by  doxygen 1.5.1