|
Doxygen
|
A bunch of utility functions. More...
#include <memory>#include <unordered_map>#include <algorithm>#include <functional>#include <fstream>#include <variant>#include <string_view>#include <ctype.h>#include "types.h"#include "docparser.h"#include "containers.h"#include "outputgen.h"#include "regex.h"#include "conceptdef.h"#include "construct.h"#include "htmlentity.h"Go to the source code of this file.
Classes | |
| struct | GetDefInput |
| struct | GetDefResult |
| struct | SelectionBlock |
| struct | SelectionMarkerInfo |
| struct | KeywordSubstitution |
Typedefs | |
| using | SelectionBlockList = std::vector<SelectionBlock> |
| using | KeywordSubstitutionList = std::vector<KeywordSubstitution> |
Functions | |
| DString | getLanguageSpecificSeparator (SrcLangExt lang, bool classScope=false) |
| DString | fileToString (const DString &name, bool filter=false, bool isSourceCode=false) |
| bool | readInputFile (const DString &fileName, std::string &contents, bool filter=true, bool isSourceCode=false) |
| read a file name fileName and optionally filter and transcode it | |
| DString | writeInlineGraph (const DString &baseName, const DString &extension, const DString &content, bool &exists) |
| void | cleanupInlineGraphs () |
| GetDefResult | getDefs (const GetDefInput &input) |
| DString | getFileFilter (const DString &name, bool isSourceCode) |
| bool | resolveRef (const DString &scName, const DString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, SrcLangExt lang, bool lookForSpecializations=true, const FileDef *currentFile=nullptr, bool checkScope=false) |
| bool | resolveLink (const DString &scName, const DString &lr, bool inSeeBlock, const Definition **resContext, DString &resAnchor, SrcLangExt lang, const DString &prefix=DString()) |
| bool | matchArguments2 (const Definition *srcScope, const FileDef *srcFileScope, const DString &srcReturnType, const ArgumentList *srcAl, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstReturnType, const ArgumentList *dstAl, bool checkCV, SrcLangExt lang) |
| void | mergeArguments (ArgumentList &srcAl, ArgumentList &dstAl, bool forceNameOverwrite=false) |
| bool | matchTemplateArguments (const ArgumentList &srcAl, const ArgumentList &dstAl) |
| DString | normalizeNonTemplateArgumentsInString (const DString &name, const Definition *context, const ArgumentList &formalArgs) |
| DString | substituteTemplateArgumentsInString (const DString &name, const ArgumentList &formalArgs, const ArgumentList *actualArgs) |
| DString | selectBlocks (const DString &s, const SelectionBlockList &blockList, const SelectionMarkerInfo &markerInfo) |
| remove disabled blocks and all block markers from s and return the result as a string | |
| void | checkBlocks (const DString &s, const DString fileName, const SelectionMarkerInfo &markerInfo) |
| DString | findExampleFilePath (const DString &file, bool &ambig) |
| void | writeExamples (OutputList &ol, const ExampleList &el) |
| DString | removeRedundantWhiteSpace (const DString &s) |
| DString | inlineArgListToDoc (const ArgumentList &al) |
| DString | inlineTemplateArgListToDoc (const ArgumentList &al) |
| DString | argListToString (const ArgumentList &al, bool useCanonicalType=false, bool showDefVals=true) |
| DString | tempArgListToString (const ArgumentList &al, SrcLangExt lang, bool includeDefaults=true) |
| DString | stripAnonymousNamespaceScope (const DString &s) |
| DString | stripFromPath (const DString &path) |
| DString | stripFromIncludePath (const DString &path) |
| bool | rightScopeMatch (const DString &scope, const DString &name) |
| bool | leftScopeMatch (const DString &scope, const DString &name) |
| DString | substituteKeywords (const DString &file, const DString &s, const KeywordSubstitutionList &keywords) |
| int | getPrefixIndex (const DString &name) |
| DString | removeAnonymousScopes (const DString &s) |
| DString | replaceAnonymousScopes (const DString &s, const DString &replacement=DString()) |
| DString | convertNameToFile (const DString &name, bool allowDots=false, bool allowUnderscore=false) |
| DString | insertTemplateSpecifierInScope (const DString &scope, const DString &templ) |
| DString | stripScope (const DString &name) |
| DString | convertToId (const DString &s) |
| DString | convertToHtml (const DString &s, bool keepEntities=true) |
| DString | convertToXML (const DString &s, bool keepEntities=false, bool citeEntry=false) |
| DString | convertToJSString (const DString &s, bool keepEntities=false, bool singleQuotes=false) |
| void | addMembersToMemberGroup (MemberList *ml, MemberGroupList *pMemberGroups, const Definition *context) |
| void | extractNamespaceName (const DString &scopeName, DString &className, DString &namespaceName, bool allowEmptyClass=false) |
| int | extractClassNameFromType (const DString &type, int &pos, DString &name, DString &templSpec, SrcLangExt=SrcLangExt::Unknown) |
| DString | stripTemplateSpecifiersFromScope (const DString &fullName, bool parentOnly=true, DString *lastScopeStripped=nullptr, DString scopeName=DString(), bool allowArtificial=true) |
| DString | resolveTypeDef (const Definition *d, const DString &name, const Definition **typedefContext=nullptr) |
| DString | mergeScopes (const DString &leftScope, const DString &rightScope) |
| int | getScopeFragment (const DString &s, int p, int *l) |
| void | addRefItem (const RefItemVector &sli, const DString &key, const DString &prefix, const DString &name, const DString &title, const DString &args, const Definition *scope) |
| PageDef * | addRelatedPage (const DString &name, const DString &ptitle, const DString &doc, const DString &fileName, int docLine, int startLine, const RefItemVector &sli=RefItemVector(), GroupDef *gd=nullptr, const TagInfo *tagInfo=nullptr, bool xref=false, SrcLangExt lang=SrcLangExt::Unknown) |
| bool | useCaseSenseNames () |
| Returns true if the names of the symbols can be case sensitive. | |
| DString | escapeCharsInString (const DString &name, bool allowDots, bool allowUnderscore=false) |
| DString | unescapeCharsInString (const DString &s) |
| void | addGroupListToTitle (OutputList &ol, const Definition *d) |
| DString | linkToText (SrcLangExt lang, const DString &link, bool ignoreDots) |
| bool | checkExtension (const DString &fName, const DString &ext) |
| void | addHtmlExtensionIfMissing (DString &fName) |
| DString | stripExtensionGeneral (const DString &fName, const DString &ext) |
| DString | stripExtension (const DString &fName) |
| DString | makeBaseName (const DString &name, const DString &ext) |
| int | computeQualifiedIndex (const DString &name) |
| Return the index of the last :: in the string name that is still before the first <. | |
| void | addDirPrefix (DString &fileName) |
| DString | relativePathToRoot (const DString &name) |
| DString | determineAbsoluteIncludeName (const DString &curFile, const DString &incFileName) |
| void | createSubDirs (const Dir &d) |
| void | clearSubDirs (const Dir &d) |
| DString | removeLongPathMarker (const DString &path) |
| DString | stripPath (const DString &s) |
| bool | findAndRemoveWord (DString &s, const char *word) |
| removes occurrences of whole word from sentence, while keeps internal spaces and reducing multiple sequences of spaces. | |
| DString | stripLeadingAndTrailingEmptyLines (const DString &s, int &docLine) |
| Special version of DString::stripWhiteSpace() that only strips completely blank lines. | |
| bool | updateLanguageMapping (const DString &extension, const DString &parser) |
| SrcLangExt | getLanguageFromFileName (const DString &fileName, SrcLangExt defLang=SrcLangExt::Cpp) |
| SrcLangExt | getLanguageFromCodeLang (DString &fileName) |
| Routine to handle the language attribute of the \code command. | |
| DString | getFileNameExtension (const DString &fn) |
| void | initDefaultExtensionMapping () |
| void | addCodeOnlyMappings () |
| bool | checkIfTypedef (const Definition *scope, const FileDef *fileScope, const DString &n) |
| DString | parseCommentAsText (const Definition *scope, const MemberDef *member, const DString &doc, const DString &fileName, int lineNr) |
| DString | parseCommentAsHtml (const Definition *scope, const MemberDef *member, const DString &doc, const DString &fileName, int lineNr) |
| bool | transcodeCharacterStringToUTF8 (std::string &input, const char *inputEncoding) |
| DString | recodeString (const DString &str, const char *fromEncoding, const char *toEncoding) |
| void | writeTypeConstraints (OutputList &ol, const Definition *d, const ArgumentList &al) |
| void | stackTrace () |
| DString | filterTitle (const DString &title) |
| bool | patternMatch (const FileInfo &fi, const StringVector &patList) |
| DString | externalLinkTarget (const bool parent=false) |
| DString | createHtmlUrl (const DString &relPath, const DString &ref, bool href, bool islocalFile, const DString &targetFileName, const DString &anchor) |
| DString | externalRef (const DString &relPath, const DString &ref, bool href) |
| void | writeMarkerList (OutputList &ol, const std::string &markerText, size_t numMarkers, std::function< void(size_t)> replaceFunc) |
| DString | writeMarkerList (const std::string &markerText, size_t numMarkers, std::function< DString(size_t)> replaceFunc) |
| DString | replaceColorMarkers (const DString &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 DString &src, const DString &dest) |
| Copies the contents of file with name src to the newly created file with name dest. | |
| int | lineBlock (const DString &text, const DString &marker) |
| Returns the line number of the line following the line with the marker. | |
| bool | isURL (const DString &url) |
| Checks whether the given url starts with a supported protocol. | |
| DString | correctURL (const DString &url, const DString &relPath) |
| Corrects URL url according to the relative path relPath. | |
| DString | processMarkup (const DString &s) |
| bool | protectionLevelVisible (Protection prot) |
| DString | stripIndentation (const DString &s, bool skipFirstLine=false) |
| void | stripIndentationVerbatim (DString &doc, size_t indentationLevel, bool skipFirstLine=true) |
| DString | getDotImageExtension () |
| bool | fileVisibleInIndex (const FileDef *fd, bool &genSourceFile) |
| void | convertProtectionLevel (MemberListType inListType, Protection inProt, MemberListType *outListType1, MemberListType *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 DString &outFile, std::ofstream &f) |
| bool | recognizeFixedForm (const DString &contents, FortranFormat format) |
| FortranFormat | convertFileNameFortranParserCode (DString fn) |
| DString | getEncoding (const FileInfo &fi) |
| DString | detab (const DString &s, size_t &refIndent) |
| DString | getProjectId () |
| DString | projectLogoFile () |
| DString | projectLogoSize () |
| DString | showDate (const DString &fmt) |
| void | mergeMemberOverrideOptions (MemberDefMutable *md1, MemberDefMutable *md2) |
| size_t | updateColumnCount (const char *s, size_t col) |
| DString | mangleCSharpGenericName (const DString &name) |
| DString | demangleCSharpGenericName (const DString &name, const DString &templArgs) |
| DString | extractBeginRawStringDelimiter (const char *rawStart) |
| DString | extractEndRawStringDelimiter (const char *rawEnd) |
A bunch of utility functions.
Definition in file util.h.
| using KeywordSubstitutionList = std::vector<KeywordSubstitution> |
| using SelectionBlockList = std::vector<SelectionBlock> |
| void addCodeOnlyMappings | ( | ) |
Definition at line 4530 of file util.cpp.
References addCodeOnlyMappings(), and updateLanguageMapping().
Referenced by addCodeOnlyMappings(), addDirPrefix(), and generateOutput().
| void addDirPrefix | ( | DString & | fileName | ) |
References addCodeOnlyMappings(), addDirPrefix(), checkIfTypedef(), clearSubDirs(), createSubDirs(), determineAbsoluteIncludeName(), findAndRemoveWord(), getFileNameExtension(), getLanguageFromCodeLang(), getLanguageFromFileName(), initDefaultExtensionMapping(), parseCommentAsHtml(), parseCommentAsText(), relativePathToRoot(), removeLongPathMarker(), stripLeadingAndTrailingEmptyLines(), stripPath(), transcodeCharacterStringToUTF8(), and updateLanguageMapping().
Referenced by addDirPrefix().
| void addGroupListToTitle | ( | OutputList & | ol, |
| const Definition * | d ) |
Definition at line 4250 of file util.cpp.
References addGroupListToTitle(), and recursivelyAddGroupListToTitle().
Referenced by addGroupListToTitle(), ClassDefImpl::writeDocumentation(), ConceptDefImpl::writeDocumentation(), FileDefImpl::writeDocumentation(), GroupDefImpl::writeDocumentation(), ModuleDefImpl::writeDocumentation(), and NamespaceDefImpl::writeDocumentation().
| void addHtmlExtensionIfMissing | ( | DString & | fName | ) |
Definition at line 4260 of file util.cpp.
References addHtmlExtensionIfMissing(), DString::empty(), DString::find(), Doxygen::htmlFileExtension, DString::npos, and DString::rfind().
Referenced by HtmlCodeGenerator::_writeCodeLink(), Crawlmap::addContentsItem(), DocSets::addContentsItem(), EclipseHelp::addContentsItem(), HtmlHelp::addContentsItem(), Qhp::addContentsItem(), addHtmlExtensionIfMissing(), Crawlmap::addIndexFile(), Sitemap::addIndexFile(), common_attributes(), convertMapFile(), dumpSymbol(), field2URL(), FTVHelp::Private::generateTree(), Crawlmap::initialize(), makeFileName(), makeFileName(), makeURL(), DefinitionImpl::navigationPathAsString(), node2URL(), HtmlDocVisitor::operator()(), replaceRef(), SearchIndexExternal::setCurrentDoc(), HtmlGenerator::startFile(), HtmlGenerator::startIndexItem(), HtmlDocVisitor::startLink(), HtmlGenerator::startTextLink(), LayoutNavEntry::url(), DefinitionImpl::writeDocAnchorsToTagFile(), HtmlGenerator::writeInheritedSectionTitle(), writeJavasScriptSearchDataPage(), writeMapArea(), HtmlGenerator::writeObjectLink(), ClassDefImpl::writeQuickMemberLinks(), FileDefImpl::writeQuickMemberLinks(), GroupDefImpl::writeQuickMemberLinks(), NamespaceDefImpl::writeQuickMemberLinks(), HtmlGenerator::writeSplitBarAsString(), HtmlGenerator::writeStartAnnoItem(), HtmlGenerator::writeSummaryLink(), ClassDefImpl::writeTagFile(), ConceptDefImpl::writeTagFile(), DirDefImpl::writeTagFile(), FileDefImpl::writeTagFile(), GroupDefImpl::writeTagFile(), MemberDefImpl::writeTagFile(), ModuleDefImpl::writeTagFile(), NamespaceDefImpl::writeTagFile(), PageDefImpl::writeTagFile(), RequirementManager::writeTagFile(), VhdlDocGen::writeTagFile(), DocSets::writeToken(), HtmlCodeGenerator::writeTooltip(), and DotNode::writeUrl().
| void addMembersToMemberGroup | ( | MemberList * | ml, |
| MemberGroupList * | pMemberGroups, | ||
| const Definition * | context ) |
Definition at line 3442 of file util.cpp.
References addMembersToMemberGroup(), ASSERT, MemberList::container(), Definition::docFile(), end(), MemberGroup::insertMember(), Doxygen::memberGroupInfoMap, MemberVector::remove(), MemberDef::setMemberGroup(), and toMemberDefMutable().
Referenced by addMembersToMemberGroup().
| void addRefItem | ( | const RefItemVector & | sli, |
| const DString & | key, | ||
| const DString & | prefix, | ||
| const DString & | name, | ||
| const DString & | title, | ||
| const DString & | args, | ||
| const Definition * | scope ) |
Definition at line 4163 of file util.cpp.
References addRefItem(), DString::empty(), and prefix.
Referenced by MemberDefImpl::addListReference(), ClassDefImpl::addListReferences(), ConceptDefImpl::addListReferences(), DirDefImpl::addListReferences(), FileDefImpl::addListReferences(), GroupDefImpl::addListReferences(), ModuleDefImpl::addListReferences(), NamespaceDefImpl::addListReferences(), PageDefImpl::addListReferences(), addRefItem(), and buildPageList().
| PageDef * addRelatedPage | ( | const DString & | name, |
| const DString & | ptitle, | ||
| const DString & | doc, | ||
| const DString & | fileName, | ||
| int | docLine, | ||
| int | startLine, | ||
| const RefItemVector & | sli = RefItemVector(), | ||
| GroupDef * | gd = nullptr, | ||
| const TagInfo * | tagInfo = nullptr, | ||
| bool | xref = false, | ||
| SrcLangExt | lang = SrcLangExt::Unknown ) |
Definition at line 4033 of file util.cpp.
References LinkedMap< T, Hash, KeyEqual, Map >::add(), SectionManager::add(), GroupDef::addPage(), addRelatedPage(), convertNameToFile(), createPageDef(), Definition::docFile(), DString::DString(), DString::empty(), DString::endsWith(), SectionInfo::fileName(), TagInfo::fileName, LinkedMap< T, Hash, KeyEqual, Map >::find(), Definition::getOutputFileBase(), Definition::getReference(), Definition::getStartBodyLine(), PageDef::hasTitle(), Doxygen::htmlFileExtension, SectionManager::instance(), Definition::isReference(), DString::left(), DString::length(), SectionInfo::lineNr(), Definition::name(), SectionType::Page, Doxygen::pageLinkedMap, SectionInfo::ref(), SectionManager::replace(), DString::right(), DefinitionMutable::setBodySegment(), DefinitionMutable::setDocumentation(), PageDef::setFileName(), DefinitionMutable::setLanguage(), PageDef::setNestingLevel(), PageDef::setPageScope(), DefinitionMutable::setReference(), DefinitionMutable::setRefItems(), PageDef::setShowLineNo(), PageDef::setTitle(), SectionInfo::setTitle(), DString::stripWhiteSpace(), TagInfo::tagName, PageDef::title(), and warn.
Referenced by addRelatedPage(), RequirementManager::addRequirement(), CitationManager::generatePage(), and RefList::generatePage().
| DString argListToString | ( | const ArgumentList & | al, |
| bool | useCanonicalType = false, | ||
| bool | showDefVals = true ) |
Definition at line 891 of file util.cpp.
References argListToString(), Argument::array, Argument::attrib, ArgumentList::begin(), Argument::canType, ArgumentList::constSpecifier(), Argument::defval, DString::empty(), ArgumentList::end(), DString::find(), ArgumentList::hasParameters(), DString::left(), LValue, DString::mid(), Argument::name, DString::npos, ArgumentList::pureSpecifier(), ArgumentList::refQualifier(), removeRedundantWhiteSpace(), RValue, ArgumentList::trailingReturnType(), Argument::type, and ArgumentList::volatileSpecifier().
Referenced by addMemberFunction(), argListToString(), DocParser::checkArgumentName(), DocParser::checkUnOrMultipleDocumentedParams(), findFriends(), findGlobalMember(), findMember(), SymbolResolver::Private::getResolvedSymbol(), matchArguments2(), matchTemplateArguments(), mergeArguments(), substituteTemplateArgumentsInString(), and ClassDefImpl::title().
| void checkBlocks | ( | const DString & | s, |
| const DString | fileName, | ||
| const SelectionMarkerInfo & | markerInfo ) |
Definition at line 5863 of file util.cpp.
References SelectionMarkerInfo::beginLen, SelectionMarkerInfo::beginStr, checkBlocks(), SelectionMarkerInfo::closeLen, SelectionMarkerInfo::closeStr, DString::data(), dstrncmp(), DString::empty(), SelectionMarkerInfo::endLen, SelectionMarkerInfo::endStr, SelectionMarkerInfo::markerChar, and warn.
Referenced by checkBlocks(), HtmlGenerator::init(), and LatexGenerator::init().
Definition at line 4255 of file util.cpp.
References checkExtension(), DString::length(), and DString::right().
Referenced by checkExtension(), copyLatexStyleSheet(), and extraLatexStyleSheet().
| bool checkIfTypedef | ( | const Definition * | scope, |
| const FileDef * | fileScope, | ||
| const DString & | n ) |
Returns true iff the given name string appears to be a typedef in scope.
Definition at line 4639 of file util.cpp.
References checkIfTypedef(), getMemberFromSymbol(), and MemberDef::isTypedef().
Referenced by addDirPrefix(), checkIfTypedef(), and isVarWithConstructor().
| void cleanupInlineGraphs | ( | ) |
Deletes all graph files written with writeInlineGraph()
Definition at line 6180 of file util.cpp.
References cleanupInlineGraphs(), Config_getBool, Dir::Dir(), qPrint(), and writeFileContents_set.
Referenced by cleanupInlineGraphs(), and generateOutput().
| void clearSubDirs | ( | const Dir & | d | ) |
Definition at line 3063 of file util.cpp.
References clearSubDirs(), Config_getBool, Config_getInt, Dir::empty(), Dir::exists(), Dir::rmdir(), DString::sprintf(), and DString::str().
Referenced by addDirPrefix(), DocbookGenerator::cleanup(), HtmlGenerator::cleanup(), LatexGenerator::cleanup(), ManGenerator::cleanup(), RTFGenerator::cleanup(), clearSubDirs(), and generateXML().
| int computeQualifiedIndex | ( | const DString & | name | ) |
Return the index of the last :: in the string name that is still before the first <.
Definition at line 6027 of file util.cpp.
References computeQualifiedIndex(), DString::data(), and DString::length().
Referenced by addToMap(), addVariable(), buildFunctionList(), buildTypedefList(), computeQualifiedIndex(), getMemberFromSymbol(), SymbolResolver::Private::getResolvedSymbolRec(), and SymbolResolver::Private::getResolvedTypeRec().
| FortranFormat convertFileNameFortranParserCode | ( | DString | fn | ) |
Definition at line 5737 of file util.cpp.
References convertFileNameFortranParserCode(), Fixed, Free, getFileNameExtension(), ParserManager::getParserName(), Doxygen::parserManager, and Unknown.
Referenced by convertCppComments(), convertFileNameFortranParserCode(), processMarkup(), and setFileName().
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 2930 of file util.cpp.
References Config_getBool, Config_getInt, convertNameToFile(), DString::DString(), DString::empty(), escapeCharsInString(), g_usedNames, g_usedNamesCount, g_usedNamesMutex, DString::left(), DString::length(), md5hash(), md5str(), DString::prepend(), DString::sprintf(), DString::str(), and DString::view().
Referenced by addRelatedPage(), buildExampleList(), ClassDefImpl::ClassDefImpl(), convertNameToFile(), ClassDefImpl::deepCopy(), DocAnchor::DocAnchor(), DocCite::DocCite(), ModuleDefImpl::getOutputFileBase(), DocParser::handleAHref(), PageDefImpl::PageDefImpl(), CCodeParser::parseCode(), FortranCodeParser::parseCode(), VHDLCodeParser::parseCode(), RefList::RefList(), FileDefImpl::setDiskNameLocal(), NamespaceDefImpl::setFileNameLocal(), and xmlRequirementId().
| void convertProtectionLevel | ( | MemberListType | inListType, |
| Protection | inProt, | ||
| MemberListType * | outListType1, | ||
| MemberListType * | 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.
Definition at line 5570 of file util.cpp.
References Config_getBool, convertProtectionLevel(), MemberListType::Invalid(), MemberListType::isPrivate(), MemberListType::isProtected(), MemberListType::isPublic(), MemberListType::toProtected(), and MemberListType::toPublic().
Referenced by convertProtectionLevel(), ClassDefImpl::countInheritedDecMembers(), processMarkup(), and ClassDefImpl::writeInheritedMemberDeclarations().
Converts a string to a HTML-encoded string
Definition at line 3358 of file util.cpp.
References convertToHtml(), DString::data(), DString::empty(), hex, isId(), DString::length(), and DString::reserve().
Referenced by HtmlCodeGenerator::_writeCodeLink(), HtmlHelp::addContentsItem(), addMembersToIndex(), convertToHtml(), convertToHtmlAndTruncate(), FTVHelp::Private::generateLink(), DefinitionImpl::navigationPathAsString(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlGenerator::startFile(), HtmlDocVisitor::startLink(), substituteHtmlKeywords(), writeClassTree(), writeClassTreeForList(), writeClassTreeToOutput(), HtmlHelpIndex::writeFields(), HtmlGenerator::writeInheritedSectionTitle(), HtmlGenerator::writeLogoAsString(), writeMapArea(), HtmlGenerator::writePageFooter(), ClassDefImpl::writeQuickMemberLinks(), FileDefImpl::writeQuickMemberLinks(), GroupDefImpl::writeQuickMemberLinks(), NamespaceDefImpl::writeQuickMemberLinks(), and HtmlGenerator::writeSearchPage().
Converts a string to a HTML id string
Definition at line 3269 of file util.cpp.
References convertToId(), DString::data(), DString::empty(), hex, DString::length(), and DString::reserve().
Referenced by convertToId(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endMemberTemplateParams(), renderQuickLinksAsJs(), HtmlGenerator::startGroupHeader(), HtmlGenerator::startMemberItem(), writeMemberList(), writeQuickMemberIndex(), ClassDefImpl::writeSummaryLinks(), and VhdlDocGen::writeVHDLDeclarations().
| DString convertToJSString | ( | const DString & | s, |
| bool | keepEntities = false, | ||
| bool | singleQuotes = false ) |
Definition at line 3418 of file util.cpp.
References HtmlEntityMapper::convertCharEntitiesToUTF8(), convertToJSString(), DString::data(), DString::empty(), HtmlEntityMapper::instance(), DString::length(), and DString::reserve().
Referenced by convertToJSString(), generateJSLink(), generateJSNavTree(), renderQuickLinksAsJs(), writeJavascriptSearchData(), and writeJavasScriptSearchDataPage().
Converts a string to an XML-encoded string
Definition at line 3299 of file util.cpp.
References convertToXML(), DString::data(), DString::empty(), HtmlEntityMapper::instance(), isId(), DString::length(), DString::reserve(), HtmlEntityMapper::writeHtmlEntity(), and HtmlEntityMapper::xml().
Referenced by DocSets::addContentsItem(), EclipseHelp::addContentsItem(), Qhp::addFile(), Sitemap::addIndexFile(), Qhp::addIndexItem(), convertToXML(), XmlDocVisitor::filter(), generateXMLForClass(), generateXMLForConcept(), generateXMLForDir(), generateXMLForFile(), generateXMLForGroup(), generateXMLForMember(), generateXMLForModule(), generateXMLForNamespace(), generateXMLForPage(), generateXMLForRequirement(), generateXMLForRequirements(), generateXMLSection(), DotDirDeps::getImgAltText(), EclipseHelp::initialize(), Qhp::initialize(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), HtmlAttribList::toString(), QhpSectionTree::traverse(), visitPreStart(), SearchIndexExternal::write(), FileDefImpl::writeClassesToTagFile(), NamespaceDefImpl::writeClassesToTagFile(), NamespaceDefImpl::writeConceptsToTagFile(), DefinitionImpl::writeDocAnchorsToTagFile(), DotNode::writeDocbook(), DotGraph::writeGraphHeader(), writeInnerClasses(), writeInnerConcepts(), writeInnerDirs(), writeInnerFiles(), writeInnerGroups(), writeInnerModules(), writeInnerNamespaces(), writeInnerPages(), writeJavascriptSearchData(), writeJavasScriptSearchDataPage(), DotNode::writeLabel(), writeListOfAllMembers(), writeMapArea(), writeMemberReference(), writeRequirementRefs(), ClassDefImpl::writeTagFile(), ConceptDefImpl::writeTagFile(), DirDefImpl::writeTagFile(), FileDefImpl::writeTagFile(), GroupDefImpl::writeTagFile(), MemberDefImpl::writeTagFile(), ModuleDefImpl::writeTagFile(), NamespaceDefImpl::writeTagFile(), PageDefImpl::writeTagFile(), RequirementManager::writeTagFile(), VhdlDocGen::writeTagFile(), writeTemplateArgumentList(), DocSets::writeToken(), DotNode::writeXML(), writeXMLLink(), and writeXMLString().
Copies the contents of file with name src to the newly created file with name dest.
Returns true if successful.
Definition at line 5179 of file util.cpp.
References copyFile(), Dir::Dir(), err, and DString::str().
Referenced by copyExtraFiles(), copyFile(), copyIcon(), copyLatexStyleSheet(), copyLogo(), copyStyleSheet(), DocParser::findAndCopyImage(), FormulaManager::generateImages(), CitationManager::generatePage(), RTFGenerator::init(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), recodeString(), and substituteLatexKeywords().
Corrects URL url according to the relative path relPath.
Returns the corrected URL. For absolute URLs no correction will be done.
Definition at line 5242 of file util.cpp.
References correctURL(), DString::empty(), isURL(), and DString::prepend().
Referenced by correctURL(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), XmlDocVisitor::operator()(), recodeString(), and startQuickIndexItem().
| DString createHtmlUrl | ( | const DString & | relPath, |
| const DString & | ref, | ||
| bool | href, | ||
| bool | islocalFile, | ||
| const DString & | targetFileName, | ||
| const DString & | anchor ) |
Definition at line 5060 of file util.cpp.
References createHtmlUrl(), DString::empty(), DString::endsWith(), and externalRef().
Referenced by HtmlCodeGenerator::_writeCodeLink(), createHtmlUrl(), RequirementManager::generatePage(), recodeString(), HtmlDocVisitor::startLink(), HtmlGenerator::startTextLink(), HtmlGenerator::writeObjectLink(), and HtmlCodeGenerator::writeTooltip().
| void createSubDirs | ( | const Dir & | d | ) |
Definition at line 3036 of file util.cpp.
References Config_getBool, Config_getInt, createSubDirs(), Dir::exists(), Dir::mkdir(), DString::sprintf(), DString::str(), and term.
Referenced by addDirPrefix(), createSubDirs(), generateXML(), DocbookGenerator::init(), HtmlGenerator::init(), LatexGenerator::init(), ManGenerator::init(), RTFGenerator::init(), ClassDefImpl::writeQuickMemberLinks(), FileDefImpl::writeQuickMemberLinks(), GroupDefImpl::writeQuickMemberLinks(), and NamespaceDefImpl::writeQuickMemberLinks().
Definition at line 6125 of file util.cpp.
References demangleCSharpGenericName(), DString::endsWith(), DString::find(), and DString::left().
Referenced by ClassDefImpl::className(), demangleCSharpGenericName(), and processMarkup().
Definition at line 5928 of file util.cpp.
References Config_getInt, DString::data(), detab(), getUTF8CharNumBytes(), isUTF8NonBreakableSpace(), DString::length(), literal_at(), and DString::reserve().
Referenced by detab(), FileDefImpl::parseSource(), Markdown::process(), processMarkup(), DocParser::readTextFileByName(), readTextFileByName(), MemberDefImpl::setInitializer(), DefinitionImpl::writeInlineCode(), and FileDefImpl::writeSourceBody().
Definition at line 2996 of file util.cpp.
References FileInfo::absFilePath(), Config_getBool, Config_getList, determineAbsoluteIncludeName(), FileInfo::dirPath(), FileInfo::exists(), FileInfo::isDir(), and DString::str().
Referenced by addDirPrefix(), determineAbsoluteIncludeName(), readIncludeFile(), and ModuleManager::resolveImports().
Definition at line 2755 of file util.cpp.
References Config_getBool, DString::data(), DString::DString(), DString::empty(), escapeCharsInString(), getUTF8CharNumBytes(), hex, DString::length(), DString::reserve(), and useCaseSenseNames().
Referenced by convertNameToFile(), escapeCharsInString(), DotClassGraph::getMapLabel(), DotDirDeps::getMapLabel(), DotGfxHierarchyTable::getMapLabel(), DotGroupCollaboration::getMapLabel(), DotInclDepGraph::getMapLabel(), markdownFileNameToId(), and PageDefImpl::writeDocumentation().
| DString externalLinkTarget | ( | const bool | parent = false | ) |
Definition at line 5049 of file util.cpp.
References Config_getBool, externalLinkTarget(), and parent().
Referenced by HtmlCodeGenerator::_writeCodeLink(), externalLinkTarget(), FTVHelp::Private::generateLink(), Markdown::Private::processLink(), recodeString(), replaceRef(), HtmlGenerator::startIndexItem(), HtmlDocVisitor::startLink(), HtmlGenerator::writeInheritedSectionTitle(), writeMapArea(), and HtmlGenerator::writeObjectLink().
Definition at line 5097 of file util.cpp.
References DString::append(), DString::at(), DString::empty(), end(), externalRef(), DString::length(), DString::prepend(), DString::str(), and Doxygen::tagDestinationMap.
Referenced by HtmlHelp::addContentsItem(), convertMapFile(), createHtmlUrl(), externalRef(), generateJSLink(), FTVHelp::Private::generateLink(), recodeString(), replaceRef(), HtmlGenerator::startIndexItem(), LayoutNavEntry::url(), HtmlGenerator::writeInheritedSectionTitle(), writeJavasScriptSearchDataPage(), and writeMapArea().
| DString extractBeginRawStringDelimiter | ( | const char * | rawStart | ) |
Definition at line 6136 of file util.cpp.
References extractBeginRawStringDelimiter(), DString::find(), DString::length(), DString::mid(), and DString::npos.
Referenced by extractBeginRawStringDelimiter(), and processMarkup().
| int extractClassNameFromType | ( | const DString & | type, |
| int & | pos, | ||
| DString & | name, | ||
| DString & | 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.
Definition at line 3560 of file util.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, DString::clear(), DString::DString(), DString::empty(), end(), extractClassNameFromType(), DString::length(), DString::lower(), DString::mid(), DString::startsWith(), and DString::str().
Referenced by extractCanonicalType(), extractClassNameFromType(), findUsedClassesForClass(), stripClassName(), and stripClassName().
| DString extractEndRawStringDelimiter | ( | const char * | rawEnd | ) |
Definition at line 6144 of file util.cpp.
References extractEndRawStringDelimiter(), DString::length(), and DString::mid().
Referenced by extractEndRawStringDelimiter(), and processMarkup().
| void extractNamespaceName | ( | const DString & | scopeName, |
| DString & | className, | ||
| DString & | 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 3093 of file util.cpp.
References DString::clear(), DString::empty(), DString::endsWith(), extractNamespaceName(), getClass(), getResolvedNamespace(), DString::left(), DString::length(), DString::mid(), Definition::name(), DString::npos, and DString::rfind().
Referenced by addClassToContext(), addConceptToContext(), extractNamespaceName(), findMember(), and writeAlphabeticalClassList().
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 1120 of file util.cpp.
References addTerminalCharIfMissing(), DString::DString(), DString::empty(), err, FileInfo::exists(), fileToString(), FileInfo::isFile(), readInputFile(), and DString::str().
Referenced by createDVIFile(), extractBoundingBox(), fileToString(), getConvertLatexMacro(), HtmlGenerator::init(), LatexGenerator::init(), LayoutDocManager::parse(), parseInput(), FileDefImpl::parseSource(), parseTagFile(), DocParser::readTextFileByName(), readTextFileByName(), runMermaid(), runPlantumlContent(), FileDefImpl::writeSourceBody(), HtmlGenerator::writeStyleInfo(), and writeXMLCodeBlock().
| bool fileVisibleInIndex | ( | const FileDef * | fd, |
| bool & | genSourceFile ) |
Definition at line 5406 of file util.cpp.
References Config_getBool, fileVisibleInIndex(), FileDef::generateSourceFile(), FileDef::isDocumentationFile(), Definition::isLinkable(), and Definition::isLinkableInProject().
Referenced by countFiles(), dirHasVisibleChildren(), fileVisibleInIndex(), generateJSTree(), processMarkup(), writeDirHierarchy(), writeDirTreeNode(), and DirDefImpl::writeFileList().
Definition at line 4954 of file util.cpp.
References end(), filterTitle(), and DString::str().
Referenced by addToIndices(), createJavaScriptSearchIndex(), filterTitle(), PerlModGenerator::generatePerlModForPage(), generateSqlite3ForPage(), generateXMLForPage(), generateXMLForRequirement(), generateXMLForRequirements(), parseCommentAsHtml(), recodeString(), SearchIndexExternal::setCurrentDoc(), HtmlGenerator::startFile(), and writeJavasScriptSearchDataPage().
| bool findAndRemoveWord | ( | DString & | 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
Definition at line 4312 of file util.cpp.
References DString::DString(), end(), findAndRemoveWord(), DString::simplifyWhiteSpace(), and DString::str().
Referenced by addDirPrefix(), findAndRemoveWord(), and isVarWithConstructor().
Definition at line 2518 of file util.cpp.
References FileDef::absFilePath(), FileInfo::absFilePath(), Config_getList, Doxygen::exampleNameLinkedMap, FileInfo::exists(), findExampleFilePath(), FileNameLinkedMap::findFileDef(), Portable::pathSeparator(), and DString::str().
Referenced by findExampleFilePath(), readIncludeFile(), and DocParser::readTextFileByName().
| GetDefResult getDefs | ( | const GetDefInput & | input | ) |
Definition at line 1933 of file util.cpp.
References GetDefInput::args, AUTO_TRACE, GetDefResult::cd, GetDefInput::checkCV, GetDefResult::cnd, GetDefInput::currentFile, Definition::definitionType(), DString::empty(), GetDefResult::fd, GetDefInput::forceEmptyScope, GetDefResult::found, GetDefResult::gd, MemberDef::getClassDef(), getDefs(), MemberDef::getFileDef(), MemberDef::getGroupDef(), MemberDef::getNamespaceDef(), Doxygen::globalScope, GetDefInput::insideCode, GetDefResult::md, GetDefInput::memberName, GetDefResult::modd, GetDefResult::nd, SymbolResolver::resolveSymbol(), GetDefInput::scopeName, SymbolResolver::setFileScope(), toClassDef(), toConceptDef(), toMemberDef(), toModuleDef(), toNamespaceDef(), Definition::TypeClass, Definition::TypeConcept, Definition::TypeMember, Definition::TypeModule, and Definition::TypeNamespace.
Referenced by DocParser::findDocsForMemberOrCompound(), getDefs(), getLinkInScope(), getLinkInScope(), linkifyText(), and resolveRef().
| DString getDotImageExtension | ( | ) |
Definition at line 5630 of file util.cpp.
References Config_getEnumAsString, DString::find(), getDotImageExtension(), DString::left(), and DString::npos.
Referenced by MermaidManager::convertToImageFormat(), RTFGenerator::endCallGraph(), RTFGenerator::endDirDepGraph(), RTFGenerator::endDotGraph(), RTFGenerator::endInclDepGraph(), DotGraph::generateCode(), getDotImageExtension(), DotGraph::imgName(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), processMarkup(), DocbookDocVisitor::startDotFile(), TranslatorAfrikaans::trLegendDocs(), TranslatorArabic::trLegendDocs(), TranslatorArmenian::trLegendDocs(), TranslatorBrazilian::trLegendDocs(), TranslatorBulgarian::trLegendDocs(), TranslatorCatalan::trLegendDocs(), TranslatorChinese::trLegendDocs(), TranslatorChinesetraditional::trLegendDocs(), TranslatorCroatian::trLegendDocs(), TranslatorCzech::trLegendDocs(), TranslatorDanish::trLegendDocs(), TranslatorDutch::trLegendDocs(), TranslatorEnglish::trLegendDocs(), TranslatorEsperanto::trLegendDocs(), TranslatorFinnish::trLegendDocs(), TranslatorFrench::trLegendDocs(), TranslatorGerman::trLegendDocs(), TranslatorGreek::trLegendDocs(), TranslatorHindi::trLegendDocs(), TranslatorHungarian::trLegendDocs(), TranslatorIndonesian::trLegendDocs(), TranslatorItalian::trLegendDocs(), TranslatorJapanese::trLegendDocs(), TranslatorKorean::trLegendDocs(), TranslatorLatvian::trLegendDocs(), TranslatorLithuanian::trLegendDocs(), TranslatorMacedonian::trLegendDocs(), TranslatorNorwegian::trLegendDocs(), TranslatorPersian::trLegendDocs(), TranslatorPolish::trLegendDocs(), TranslatorPortuguese::trLegendDocs(), TranslatorRomanian::trLegendDocs(), TranslatorRussian::trLegendDocs(), TranslatorSerbian::trLegendDocs(), TranslatorSerbianCyrillic::trLegendDocs(), TranslatorSlovak::trLegendDocs(), TranslatorSlovene::trLegendDocs(), TranslatorSpanish::trLegendDocs(), TranslatorSwedish::trLegendDocs(), TranslatorTurkish::trLegendDocs(), TranslatorUkrainian::trLegendDocs(), TranslatorVietnamese::trLegendDocs(), DocbookDocVisitor::writeDotFile(), RTFDocVisitor::writeDotFile(), writeDotGraphFromFile(), writeDotImageMapFromFile(), DotLegendGraph::writeGraph(), HtmlDocVisitor::writeMscFile(), and HtmlDocVisitor::writePlantUMLFile().
Definition at line 5035 of file util.cpp.
References Config_getString, InputFileEncoding::encoding, genericPatternMatch(), getEncoding(), and Doxygen::inputFileEncodingList.
Referenced by getEncoding(), processMarkup(), readCodeFragment(), and readInputFile().
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.
Definition at line 1052 of file util.cpp.
References Config_getList, Config_getString, DString::empty(), getFileFilter(), getFilterFromList(), DString::length(), and DString::mid().
Referenced by FilterCache::getFileContents(), getFileFilter(), CodeFragmentManager::parseCodeFragment(), readCodeFragment(), readInputFile(), and FileDefImpl::writeSourceBody().
Definition at line 4578 of file util.cpp.
References DString::empty(), getFileNameExtension(), DString::mid(), DString::npos, and DString::rfind().
Referenced by addDirPrefix(), TooltipManager::addTooltip(), anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), convertFileNameFortranParserCode(), generateExampleDocs(), getFileNameExtension(), FileDefImpl::isDocumentationFile(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), ManDocVisitor::operator()(), RTFDocVisitor::operator()(), XmlDocVisitor::operator()(), CodeFragmentManager::parseCodeFragment(), and MarkdownOutlineParser::parseInput().
| SrcLangExt getLanguageFromCodeLang | ( | DString & | fileName | ) |
Routine to handle the language attribute of the \code command.
Definition at line 4554 of file util.cpp.
References DString::at(), g_lang2extMap, getLanguageFromCodeLang(), getLanguageFromFileName(), DString::lower(), and DString::mid().
Referenced by addDirPrefix(), getLanguageFromCodeLang(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), ManDocVisitor::operator()(), RTFDocVisitor::operator()(), and XmlDocVisitor::operator()().
| SrcLangExt getLanguageFromFileName | ( | const DString & | fileName, |
| SrcLangExt | defLang = SrcLangExt::Cpp ) |
Definition at line 4536 of file util.cpp.
References DString::at(), DString::DString(), DString::empty(), FileInfo::extension(), g_extLookup, getLanguageFromFileName(), DString::lower(), DString::prepend(), and DString::str().
Referenced by MemberDefImpl::_writeMultiLineInitializer(), addDirPrefix(), ClassDefImpl::ClassDefImpl(), convertCppComments(), DocRef::DocRef(), FileDefImpl::FileDefImpl(), generateExampleDocs(), getLanguageFromCodeLang(), getLanguageFromFileName(), EntryType::guessSection(), FileDefImpl::isDocumentationFile(), COutlineParser::needsPreprocessing(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), ManDocVisitor::operator()(), ManDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), CodeFragmentManager::parseCodeFragment(), parseFilesMultiThreading(), parseFilesSingleThreading(), parseMain(), Markdown::Private::processLink(), readCodeFragment(), setContext(), setFileName(), validatingParseDoc(), and writeXMLCodeBlock().
| DString getLanguageSpecificSeparator | ( | SrcLangExt | lang, |
| bool | classScope = false ) |
Returns the scope separator to use given the programming language lang
Definition at line 5212 of file util.cpp.
References getLanguageSpecificSeparator().
Referenced by DefinitionImpl::_writeSourceRefList(), addGlobalFunction(), MemberDefImpl::addListReference(), addMethodToClass(), addVariableToFile(), MemberDefImpl::displayDefinition(), getLanguageSpecificSeparator(), DefinitionAliasImpl::init(), linkToText(), makeDisplayName(), makeDisplayName(), makeQualifiedNameWithTemplateParameters(), ClassDefImpl::mergeMembersFromBaseClasses(), MemberDefImpl::qualifiedName(), SearchIndex::setCurrentDoc(), validatingParseDoc(), MemberDefImpl::warnIfUndocumented(), writeAlphabeticalClassList(), MemberDefImpl::writeDeclaration(), writeDefArgumentList(), MemberDefImpl::writeDocumentation(), writeJavasScriptSearchDataPage(), MemberDefImpl::writeLink(), and writeMemberReference().
| int getPrefixIndex | ( | const DString & | 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 2718 of file util.cpp.
References DString::at(), Config_getList, DString::data(), DString::empty(), getPrefixIndex(), and DString::length().
Referenced by Index::addClassMemberNameToIndex(), Index::addFileMemberNameToIndex(), Index::addModuleMemberNameToIndex(), Index::addNamespaceMemberNameToIndex(), SearchIndex::addWordRec(), getPrefixIndex(), parseInput(), writeAlphabeticalClassList(), and writeMemberList().
| DString getProjectId | ( | ) |
Definition at line 6019 of file util.cpp.
References Config_getString, DString::DString(), DString::empty(), getProjectId(), md5str(), and DString::view().
Referenced by generateJSNavTree(), getProjectId(), HtmlGenerator::init(), processMarkup(), and writeJavaScriptSearchIndex().
| int getScopeFragment | ( | const DString & | s, |
| int | p, | ||
| int * | l ) |
Returns a fragment from scope s, starting at position p.
| s | the scope name as a string. |
| p | the start position (0 is the first). |
| l | the resulting length of the fragment. |
Definition at line 3978 of file util.cpp.
References DString::at(), getScopeFragment(), and DString::length().
Referenced by buildScopeFromQualifiedName(), findScopeFromQualifiedName(), SymbolResolver::Private::followPath(), getScopeFragment(), resolveTypeDef(), and stripAnonymousNamespaceScope().
| void initDefaultExtensionMapping | ( | ) |
Definition at line 4463 of file util.cpp.
References initDefaultExtensionMapping(), and updateLanguageMapping().
Referenced by addDirPrefix(), initDefaultExtensionMapping(), and initDoxygen().
| DString inlineArgListToDoc | ( | const ArgumentList & | al | ) |
Definition at line 5531 of file util.cpp.
References DString::empty(), extractDirection(), ArgumentList::hasDocumentation(), and inlineArgListToDoc().
Referenced by inlineArgListToDoc(), DocParser::processCopyDoc(), and MemberDefImpl::writeDocumentation().
| DString inlineTemplateArgListToDoc | ( | const ArgumentList & | al | ) |
Definition at line 864 of file util.cpp.
References ArgumentList::hasTemplateDocumentation(), inlineTemplateArgListToDoc(), DString::stripPrefix(), and DString::stripWhiteSpace().
Referenced by inlineTemplateArgListToDoc(), ClassDefImpl::writeDetailedDocumentationBody(), and MemberDefImpl::writeDocumentation().
Definition at line 3143 of file util.cpp.
References ArgumentList::empty(), DString::empty(), DString::find(), getClass(), insertTemplateSpecifierInScope(), DString::left(), DString::mid(), DString::npos, and ClassDef::templateArguments().
Referenced by DotClassGraph::addClass(), generateXMLForClass(), insertTemplateSpecifierInScope(), DiagramItem::label(), ClassDefImpl::writeInheritanceGraph(), and ClassDefImpl::writeTagFile().
| bool isURL | ( | const DString & | url | ) |
Checks whether the given url starts with a supported protocol.
Definition at line 5229 of file util.cpp.
References DString::find(), isURL(), DString::left(), DString::npos, DString::str(), and DString::stripWhiteSpace().
Referenced by correctURL(), isURL(), Markdown::Private::processLink(), and recodeString().
Definition at line 772 of file util.cpp.
References DString::at(), DString::left(), leftScopeMatch(), and DString::length().
Referenced by addClassToContext(), addConceptToContext(), buildFunctionList(), leftScopeMatch(), mergeScopes(), pushScope(), and resolveRef().
Returns the line number of the line following the line with the marker.
Definition at line 5192 of file util.cpp.
References DString::find(), lineBlock(), and DString::npos.
Referenced by lineBlock(), readIncludeFile(), and recodeString().
| DString linkToText | ( | SrcLangExt | lang, |
| const DString & | link, | ||
| bool | ignoreDots ) |
Definition at line 2332 of file util.cpp.
References DString::at(), DString::empty(), DString::find(), getLanguageSpecificSeparator(), linkToText(), DString::mid(), DString::npos, and substitute().
Referenced by DotCallGraph::buildGraph(), DocRef::DocRef(), DotCallGraph::DotCallGraph(), DocParser::handleLinkedWord(), and linkToText().
| bool mainPageHasTitle | ( | ) |
Definition at line 5625 of file util.cpp.
References Doxygen::mainPage, and mainPageHasTitle().
Referenced by generateJSNavTree(), generateSqlite3ForPage(), generateXMLForPage(), mainPageHasTitle(), and processMarkup().
Definition at line 4303 of file util.cpp.
References makeBaseName(), stripExtensionGeneral(), and stripPath().
Referenced by makeBaseName(), HtmlDocVisitor::operator()(), DocbookDocVisitor::startDiaFile(), LatexDocVisitor::startDiaFile(), DocbookDocVisitor::startDotFile(), LatexDocVisitor::startDotFile(), DocbookDocVisitor::startMscFile(), LatexDocVisitor::startMscFile(), DocbookDocVisitor::startPlantUmlFile(), LatexDocVisitor::startPlantUmlFile(), HtmlDocVisitor::writeDiaFile(), RTFDocVisitor::writeDiaFile(), DocbookDocVisitor::writeDotFile(), HtmlDocVisitor::writeDotFile(), RTFDocVisitor::writeDotFile(), HtmlDocVisitor::writeMermaidFile(), RTFDocVisitor::writeMermaidFile(), DocbookDocVisitor::writeMscFile(), HtmlDocVisitor::writeMscFile(), LatexDocVisitor::writeMscFile(), RTFDocVisitor::writeMscFile(), HtmlDocVisitor::writePlantUMLFile(), and RTFDocVisitor::writePlantUMLFile().
Definition at line 6116 of file util.cpp.
References DString::contains(), DString::DString(), DString::find(), DString::left(), mangleCSharpGenericName(), DString::npos, and DString::setNum().
Referenced by addClassToContext(), addEnumValuesToEnums(), addVariable(), buildFunctionList(), extractClassName(), findClassRelation(), findEnums(), mangleCSharpGenericName(), processMarkup(), SymbolResolver::resolveClass(), resolveLink(), and resolveRef().
| bool matchArguments2 | ( | const Definition * | srcScope, |
| const FileDef * | srcFileScope, | ||
| const DString & | srcReturnType, | ||
| const ArgumentList * | srcAl, | ||
| const Definition * | dstScope, | ||
| const FileDef * | dstFileScope, | ||
| const DString & | dstReturnType, | ||
| const ArgumentList * | dstAl, | ||
| bool | checkCV, | ||
| SrcLangExt | lang ) |
Compares two parameter lists srcAl and dstAl and returns true if they match.
Definition at line 1656 of file util.cpp.
References argListToString(), ASSERT, AUTO_TRACE, ArgumentList::begin(), ArgumentList::constSpecifier(), ArgumentList::empty(), ArgumentList::end(), ArgumentList::front(), MATCH, matchArgument2(), matchArguments2(), Definition::name(), NOMATCH, ArgumentList::refQualifier(), ArgumentList::size(), ArgumentList::trailingReturnType(), Argument::type, and ArgumentList::volatileSpecifier().
Referenced by addMemberDocs(), addMemberFunction(), buildFunctionList(), combineDeclarationAndDefinition(), computeMemberRelationsForBaseClass(), ClassDefImpl::containsOverload(), findFriends(), findGlobalMember(), findMember(), SymbolResolver::Private::getResolvedSymbol(), GroupDefImpl::insertMember(), matchArguments2(), matchCanonicalTypes(), ClassDefImpl::mergeMembersFromBaseClasses(), transferFunctionReferences(), and transferRelatedFunctionDocumentation().
| bool matchTemplateArguments | ( | const ArgumentList & | srcAl, |
| const ArgumentList & | dstAl ) |
Returns true if the template parameter lists srcAl and dstAl match. The lists are considered to match if they have the same number of parameters and each matching parameter in srcAl and dstAl has the same constraints (or at least one parameter has no constraints).
Definition at line 1900 of file util.cpp.
References argListToString(), AUTO_TRACE, AUTO_TRACE_EXIT, ArgumentList::begin(), ArgumentList::end(), matchTemplateArguments(), ArgumentList::size(), and Argument::type.
Referenced by buildFunctionList(), and matchTemplateArguments().
| void mergeArguments | ( | ArgumentList & | srcAl, |
| ArgumentList & | dstAl, | ||
| bool | forceNameOverwrite = false ) |
Merges the information of two parameter lists (typically a declaration and a definition). Missing information is added to either list. The name of parameter of srcAl is only overwritten if forceNameOverwrite is true.
Definition at line 1756 of file util.cpp.
References argListToString(), AUTO_TRACE, AUTO_TRACE_ADD, ArgumentList::begin(), DString::clear(), Argument::defval, Argument::docs, DString::empty(), ArgumentList::end(), DString::find(), DString::left(), DString::length(), mergeArguments(), Argument::name, DString::npos, qPrint(), DString::right(), ArgumentList::size(), DString::stripWhiteSpace(), and Argument::type.
Referenced by addMemberDocs(), buildFunctionList(), findFriends(), and mergeArguments().
| void mergeMemberOverrideOptions | ( | MemberDefMutable * | md1, |
| MemberDefMutable * | md2 ) |
Definition at line 6064 of file util.cpp.
References Config_getBool, MemberDef::hasCallerGraph(), MemberDef::hasCallGraph(), MemberDef::hasEnumValues(), MemberDef::hasInlineSource(), MemberDef::hasReferencedByRelation(), MemberDef::hasReferencesRelation(), mergeMemberOverrideOptions(), MemberDefMutable::overrideCallerGraph(), MemberDefMutable::overrideCallGraph(), MemberDefMutable::overrideEnumValues(), MemberDefMutable::overrideInlineSource(), MemberDefMutable::overrideReferencedByRelation(), and MemberDefMutable::overrideReferencesRelation().
Referenced by combineDeclarationAndDefinition(), findFriends(), mergeMemberOverrideOptions(), and processMarkup().
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
| leftScope | the left hand part of the scope. |
| rightScope | the right hand part of the scope. |
Definition at line 3933 of file util.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, DString::empty(), DString::left(), leftScopeMatch(), DString::length(), mergeScopes(), DString::mid(), DString::npos, and DString::rfind().
Referenced by addEnumValuesToEnums(), addVariable(), findEnums(), findMember(), mergeScopes(), and stripTemplateSpecifiersFromScope().
| DString normalizeNonTemplateArgumentsInString | ( | const DString & | name, |
| const Definition * | context, | ||
| const ArgumentList & | formalArgs ) |
Returns a representation of name where all known types have been normalized to their canonical form. The normalization is done in the context of context and using the formal arguments in formalArgs.
Definition at line 3645 of file util.cpp.
References end(), DString::find(), DString::left(), DString::mid(), Definition::name(), normalizeNonTemplateArgumentsInString(), DString::npos, removeRedundantWhiteSpace(), SymbolResolver::resolveClass(), DString::str(), and DString::substr().
Referenced by findUsedClassesForClass(), and normalizeNonTemplateArgumentsInString().
| bool openOutputFile | ( | const DString & | outFile, |
| std::ofstream & | f ) |
Definition at line 5637 of file util.cpp.
References FileInfo::exists(), FileInfo::filePath(), openOutputFile(), Portable::openOutputStream(), Dir::remove(), Dir::rename(), and DString::str().
Referenced by compareDoxyfile(), generateConfigFile(), openOutputFile(), processMarkup(), readConfiguration(), and writeDefaultLayoutFile().
| DString parseCommentAsHtml | ( | const Definition * | scope, |
| const MemberDef * | member, | ||
| const DString & | doc, | ||
| const DString & | fileName, | ||
| int | lineNr ) |
Definition at line 4749 of file util.cpp.
References OutputCodeList::add(), createDocParser(), filterTitle(), g_docCache, g_docCacheMutex, parseCommentAsHtml(), DString::str(), TextStream::str(), and validatingParseTitle().
Referenced by addDirPrefix(), PageDefImpl::addSectionsToIndex(), SearchTerm::makeTitle(), DefinitionImpl::navigationPathAsString(), parseCommentAsHtml(), and writeJavasScriptSearchDataPage().
| DString parseCommentAsText | ( | const Definition * | scope, |
| const MemberDef * | member, | ||
| const DString & | doc, | ||
| const DString & | fileName, | ||
| int | lineNr ) |
Definition at line 4693 of file util.cpp.
References DString::at(), HtmlEntityMapper::convertCharEntitiesToUTF8(), createDocParser(), DString::data(), DString::empty(), HtmlEntityMapper::instance(), DString::left(), DString::length(), nextUTF8CharPosition(), parseCommentAsText(), TextStream::str(), DString::stripWhiteSpace(), and validatingParseDoc().
Referenced by addDirPrefix(), RequirementManager::addRequirement(), PageDefImpl::addSectionsToIndex(), DefinitionImpl::computeTooltip(), parseCommentAsText(), GroupDefImpl::setGroupTitleLocal(), PageDefImpl::setTitle(), and RequirementManager::writeRef().
| bool patternMatch | ( | const FileInfo & | fi, |
| const StringVector & | patList ) |
Definition at line 5028 of file util.cpp.
References genericPatternMatch(), and patternMatch().
Referenced by checkAndOpenFile(), patternMatch(), readDir(), and recodeString().
References convertFileNameFortranParserCode(), convertProtectionLevel(), demangleCSharpGenericName(), detab(), extractBeginRawStringDelimiter(), extractEndRawStringDelimiter(), fileVisibleInIndex(), getDotImageExtension(), getEncoding(), getProjectId(), mainPageHasTitle(), mangleCSharpGenericName(), mergeMemberOverrideOptions(), openOutputFile(), processMarkup(), projectLogoFile(), projectLogoSize(), protectionLevelVisible(), recognizeFixedForm(), showDate(), stripIndentation(), stripIndentationVerbatim(), and updateColumnCount().
Referenced by processMarkup().
| DString projectLogoFile | ( | ) |
Definition at line 2647 of file util.cpp.
References Config_getString, DString::empty(), DString::find(), DString::left(), DString::npos, and projectLogoFile().
Referenced by copyLogo(), processMarkup(), projectLogoFile(), substituteHtmlKeywords(), and substituteLatexKeywords().
| DString projectLogoSize | ( | ) |
Definition at line 2666 of file util.cpp.
References DString::at(), Config_getString, DString::empty(), DString::find(), DString::length(), DString::mid(), DString::npos, DString::prepend(), projectLogoSize(), DString::quoted(), and DString::stripWhiteSpace().
Referenced by processMarkup(), projectLogoSize(), substituteHtmlKeywords(), and substituteLatexKeywords().
| bool protectionLevelVisible | ( | Protection | prot | ) |
Definition at line 5254 of file util.cpp.
References Config_getBool, and protectionLevelVisible().
Referenced by MemberDefImpl::_computeLinkableInProject(), addClassAndNestedClasses(), computeClassRelations(), MemberDefImpl::hasDetailedDescription(), ClassDefImpl::internalInsertMember(), MemberDefImpl::isBriefSectionVisible(), ClassDefImpl::isLinkableInProject(), ClassDefImpl::isVisibleInHierarchy(), processMarkup(), protectionLevelVisible(), MemberDefImpl::warnIfUndocumented(), MemberDefImpl::writeDeclaration(), ClassDefImpl::writeDocumentationForInnerClasses(), ClassDefImpl::writeMemberList(), and ClassDefImpl::writeTagFile().
| bool readInputFile | ( | const DString & | fileName, |
| std::string & | contents, | ||
| bool | filter = true, | ||
| bool | isSourceCode = false ) |
read a file name fileName and optionally filter and transcode it
Definition at line 4874 of file util.cpp.
References DString::empty(), err, FileInfo::exists(), Debug::ExtCmd, filterCRLF(), Debug::FilterOutput, getEncoding(), getFileFilter(), Portable::openInputStream(), Portable::pclose(), Portable::popen(), Debug::print(), readInputFile(), FileInfo::size(), DString::str(), and transcodeCharacterBuffer().
Referenced by checkAndOpenFile(), fileToString(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), parseFile(), parseInput(), readIncludeFile(), readInputFile(), DocbookDocVisitor::startMermaidFile(), LatexDocVisitor::startMermaidFile(), DocbookDocVisitor::startPlantUmlFile(), and LatexDocVisitor::startPlantUmlFile().
References copyFile(), correctURL(), createHtmlUrl(), externalLinkTarget(), externalRef(), filterTitle(), isURL(), lineBlock(), parent(), patternMatch(), recodeString(), replaceColorMarkers(), stackTrace(), writeMarkerList(), and writeTypeConstraints().
Referenced by recodeString().
| bool recognizeFixedForm | ( | const DString & | contents, |
| FortranFormat | format ) |
Definition at line 5684 of file util.cpp.
References DString::at(), Config_getInt, DString::data(), Fixed, Free, keyWordsFortranC(), DString::length(), and recognizeFixedForm().
Referenced by convertCppComments(), FortranCodeParser::parseCode(), parseMain(), processMarkup(), recognizeFixedForm(), and setFileName().
Definition at line 2979 of file util.cpp.
References Config_getBool, DString::empty(), DString::npos, REL_PATH_TO_ROOT, relativePathToRoot(), and DString::rfind().
Referenced by addDirPrefix(), generateBriefDoc(), relativePathToRoot(), DocbookGenerator::startFile(), HtmlGenerator::startFile(), LatexGenerator::startFile(), RTFGenerator::startFile(), and validatingParseDoc().
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"
Definition at line 114 of file util.cpp.
References DString::empty(), end(), removeAnonymousScopes(), and DString::str().
Referenced by MemberDefImpl::displayDefinition(), generateClassMemberLink(), ClassDefImpl::internalInsertMember(), makeDisplayName(), makeDisplayName(), removeAnonymousScopes(), simplifyTypeForTable(), MemberDefImpl::writeDeclaration(), and MemberDefImpl::writeDocumentation().
Definition at line 212 of file util.cpp.
References DString::mid(), removeLongPathMarker(), and DString::startsWith().
Referenced by addDirPrefix(), computeCommonDirPrefix(), FileDefImpl::FileDefImpl(), FileNameLinkedMap::findFileDef(), DirDefImpl::mergeDirectoryInTree(), removeLongPathMarker(), FileNameLinkedMap::showFileDefMatches(), and stripFromPath().
Definition at line 458 of file util.cpp.
References CharAroundSpace::CharElem::after, CharAroundSpace::CharElem::before, CharAroundSpace::charMap, Config_getBool, constScope, DString::data(), disspace(), DString::empty(), g_charAroundSpace, isId(), DString::length(), operatorScope, removeRedundantWhiteSpace(), THREAD_LOCAL, virtualScope, and volatileScope.
Referenced by addFrom(), addGlobalFunction(), addMethodToClass(), addVariable(), addVariableToClass(), argListToString(), buildFunctionList(), buildInterfaceAndServiceList(), buildTypedefList(), ClassDefImpl::ClassDefImpl(), extractCanonicalType(), findClassRelation(), DocParser::findDocsForMemberOrCompound(), findMember(), findUsedClassesForClass(), findUsingDeclImports(), ArgumentList::finishTrailingReturnType(), generateFunctionLink(), generateFunctionLink(), generateLink(), getCanonicalTypeForIdentifier(), getLink(), getLink(), getLink(), MemberDefImpl::init(), ClassDefImpl::insertTemplateInstance(), MemberDefImpl::MemberDefImpl(), normalizeNonTemplateArgumentsInString(), parseFuncDecl(), removeRedundantWhiteSpace(), resolveRef(), tempArgListToString(), and writeExceptionListImpl().
Definition at line 171 of file util.cpp.
References DString::data(), DString::empty(), reg::replace(), replaceAnonymousScopes(), and DString::str().
Referenced by addMemberFunction(), findGlobalMember(), generateDEFForMember(), and replaceAnonymousScopes().
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.
Definition at line 5128 of file util.cpp.
References Config_getInt, DString::DString(), DString::empty(), end(), hex, HEXTONUM, ColoredImage::hsl2rgb(), replaceColorMarkers(), and DString::str().
Referenced by ResourceMgr::copyResourceAs(), fillColorStyleMaps(), HtmlGenerator::init(), recodeString(), replaceColorMarkers(), and writeDefaultStyleSheet().
| bool resolveLink | ( | const DString & | scName, |
| const DString & | lr, | ||
| bool | inSeeBlock, | ||
| const Definition ** | resContext, | ||
| DString & | resAnchor, | ||
| SrcLangExt | lang, | ||
| const DString & | prefix = DString() ) |
Returns an symbol definition given its name and context for an explicitly linked symbol.
Definition at line 2375 of file util.cpp.
References Definition::anchor(), AUTO_TRACE, AUTO_TRACE_EXIT, SectionInfo::definition(), DString::empty(), Doxygen::exampleLinkedMap, LinkedMap< T, Hash, KeyEqual, Map >::find(), getClass(), getConcept(), PageDef::getGroupDef(), Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, ModuleManager::instance(), SectionManager::instance(), Definition::isLinkable(), SectionInfo::label(), mangleCSharpGenericName(), Definition::name(), Doxygen::namespaceLinkedMap, Doxygen::pageLinkedMap, prefix, resolveDirLink(), resolveLink(), resolveRef(), and stripTemplateSpecifiersFromScope().
Referenced by DocLink::DocLink(), DocRef::DocRef(), and resolveLink().
| bool resolveRef | ( | const DString & | scName, |
| const DString & | name, | ||
| bool | inSeeBlock, | ||
| const Definition ** | resContext, | ||
| const MemberDef ** | resMember, | ||
| SrcLangExt | lang, | ||
| bool | lookForSpecializations = true, | ||
| const FileDef * | currentFile = nullptr, | ||
| bool | checkScope = false ) |
Returns a symbol definition (compound and/or member) given its name and context.
Definition at line 2075 of file util.cpp.
References ASSERT, AUTO_TRACE, AUTO_TRACE_ADD, GetDefResult::cd, GetDefInput::checkCV, GetDefResult::cnd, Doxygen::conceptLinkedMap, GetDefInput::currentFile, DString::empty(), GetDefResult::fd, DString::find(), LinkedMap< T, Hash, KeyEqual, Map >::find(), FileNameLinkedMap::findFileDef(), findParameterList(), GetDefInput::forceEmptyScope, GetDefResult::found, GetDefResult::gd, getClass(), getDefs(), Definition::getOuterScope(), getScopeDefs(), Doxygen::globalScope, Doxygen::groupLinkedMap, Doxygen::inputNameLinkedMap, ModuleManager::instance(), MemberDef::isEnumerate(), isLowerCase(), MemberDef::isStrongEnumValue(), MemberDef::isTypedef(), DString::left(), leftScopeMatch(), DString::length(), mangleCSharpGenericName(), GetDefResult::md, DString::mid(), GetDefResult::modd, Definition::name(), GetDefResult::nd, DString::npos, removeRedundantWhiteSpace(), resolveRef(), DString::rfind(), DString::startsWith(), and substitute().
Referenced by DocParser::handleLinkedWord(), resolveLink(), and resolveRef().
| DString resolveTypeDef | ( | const Definition * | d, |
| const DString & | name, | ||
| const Definition ** | typedefContext = nullptr ) |
Definition at line 264 of file util.cpp.
References MemberDef::argsString(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, Definition::definitionType(), DString::empty(), DString::find(), LinkedMap< T, Hash, KeyEqual, Map >::find(), Definition::findInnerCompound(), Doxygen::functionNameLinkedMap, Definition::getOuterScope(), getScopeFragment(), Doxygen::globalScope, SymbolResolver::isAccessibleFrom(), MemberDef::isRelated(), MemberDef::isTypedef(), DString::left(), Doxygen::memberNameLinkedMap, DString::mid(), Definition::name(), DString::npos, resolveTypeDef(), DString::rfind(), Definition::TypeClass, and MemberDef::typeString().
Referenced by findUsedClassesForClass(), getCanonicalTemplateSpec(), getCanonicalTypeForIdentifier(), isVarWithConstructor(), and resolveTypeDef().
Definition at line 761 of file util.cpp.
References DString::at(), DString::length(), DString::right(), and rightScopeMatch().
Referenced by addMemberFunction(), findScopeFromQualifiedName(), isRecursiveBaseClass(), and rightScopeMatch().
| DString selectBlocks | ( | const DString & | s, |
| const SelectionBlockList & | blockList, | ||
| const SelectionMarkerInfo & | markerInfo ) |
remove disabled blocks and all block markers from s and return the result as a string
Definition at line 5750 of file util.cpp.
References SelectionMarkerInfo::beginLen, SelectionMarkerInfo::beginStr, SelectionMarkerInfo::closeLen, SelectionMarkerInfo::closeStr, DString::data(), dstrlen(), dstrncmp(), DString::empty(), SelectionMarkerInfo::endLen, SelectionMarkerInfo::endStr, DString::length(), SelectionMarkerInfo::markerChar, DString::reserve(), and selectBlocks().
Referenced by selectBlocks(), substituteHtmlKeywords(), and substituteLatexKeywords().
Definition at line 2634 of file util.cpp.
References dateTimeFromString(), err, formatDateTime(), and showDate().
Referenced by processMarkup(), showDate(), substituteHtmlKeywords(), and substituteLatexKeywords().
| void stackTrace | ( | ) |
Definition at line 4810 of file util.cpp.
References Portable::pclose(), Portable::popen(), and stackTrace().
Referenced by recodeString(), and stackTrace().
Definition at line 183 of file util.cpp.
References DString::at(), DString::empty(), getScopeFragment(), DString::left(), DString::length(), DString::mid(), Doxygen::namespaceLinkedMap, DString::right(), and stripAnonymousNamespaceScope().
Referenced by addMemberFunction(), addPageToContext(), addVariable(), buildNamespaceList(), computeTemplateClassRelations(), extractClassName(), findGroupScope(), findUsingDeclImports(), findUsingDirectives(), resolveClassNestingRelations(), and stripAnonymousNamespaceScope().
Definition at line 4284 of file util.cpp.
References Doxygen::htmlFileExtension, stripExtension(), and stripExtensionGeneral().
Referenced by anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), ClassDefImpl::ClassDefImpl(), MemberDefImpl::setTagInfo(), and stripExtension().
Definition at line 4274 of file util.cpp.
References DString::left(), DString::length(), DString::right(), and stripExtensionGeneral().
Referenced by TooltipManager::addTooltip(), anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), extraLatexStyleSheet(), makeBaseName(), MarkdownOutlineParser::parseInput(), stripExtension(), stripExtensionGeneral(), DocbookCodeGenerator::writeCodeLinkLine(), LatexCodeGenerator::writeLineNumber(), and RTFCodeGenerator::writeLineNumber().
strip part of path if it matches one of the paths in the Config_getList(INCLUDE_PATH) list
Definition at line 259 of file util.cpp.
References Config_getList, stripFromIncludePath(), and stripFromPath().
Referenced by MemberDefImpl::_writeGroupInclude(), addIncludeFile(), FileNameLinkedMap::findFileDef(), FileNameLinkedMap::showFileDefMatches(), and stripFromIncludePath().
strip part of path if it matches one of the paths in the Config_getList(STRIP_FROM_PATH) list
Definition at line 251 of file util.cpp.
References Config_getList, and stripFromPath().
Referenced by Config::checkAndCorrect(), DirDefImpl::DirDefImpl(), FileDefImpl::FileDefImpl(), generateAnonymousAnchor(), generateXMLForClass(), generateXMLForConcept(), generateXMLForDir(), generateXMLForFile(), generateXMLForMember(), generateXMLForModule(), generateXMLForNamespace(), generateXMLForPage(), generateXMLForRequirement(), generateXMLForRequirements(), handleFileInfoResult(), insertPath(), markdownFileNameToId(), MarkdownOutlineParser::parseInput(), ModuleManager::resolveImports(), ClassDefImpl::showUsedFiles(), stripFromIncludePath(), stripFromPath(), stripFromPath(), ModuleDefImpl::writeFiles(), writeSingleFileIndex(), DirDefImpl::writeTagFile(), FileDefImpl::writeTagFile(), and GroupDefImpl::writeTagFile().
Definition at line 5266 of file util.cpp.
References Config_getInt, DString::data(), DString::empty(), literal_at(), TextStream::str(), stripIndentation(), and substitute().
Referenced by handleCommentBlock(), handleCommentBlock(), handleCommentBlock(), handleParametersCommentBlocks(), DocPara::handleStartCode(), MarkdownOutlineParser::parseInput(), processMarkup(), and stripIndentation().
| void stripIndentationVerbatim | ( | DString & | doc, |
| size_t | indentationLevel, | ||
| bool | skipFirstLine = true ) |
Definition at line 5355 of file util.cpp.
References DString::data(), DString::empty(), DString::rawData(), DString::resize(), and stripIndentationVerbatim().
Referenced by processMarkup(), MemberDefImpl::setInitializer(), and stripIndentationVerbatim().
Special version of DString::stripWhiteSpace() that only strips completely blank lines.
| s | the string to be stripped |
| docLine | the line number corresponding to the start of the string. This will be adjusted based on the number of lines stripped from the start. |
Definition at line 4355 of file util.cpp.
References DString::data(), DString::DString(), DString::empty(), DString::length(), literal_at(), DString::mid(), and stripLeadingAndTrailingEmptyLines().
Referenced by DefinitionImpl::_setBriefDescription(), DefinitionImpl::_setDocumentation(), addDirPrefix(), DocGroup::addDocs(), VHDLOutlineParser::checkInlineCode(), DocPara::handleCommand(), CommentScanner::parseCommentBlock(), and stripLeadingAndTrailingEmptyLines().
Definition at line 4289 of file util.cpp.
References DString::mid(), DString::npos, DString::rfind(), and stripPath().
Referenced by addDirPrefix(), LatexGenerator::addLabel(), anonymous_namespace{tagreader.cpp}::TagFileParser::buildLists(), RTFGenerator::endDoxyAnchor(), LatexGenerator::endIndexItem(), LatexGenerator::endIndexValue(), LatexGenerator::endTitleHead(), makeBaseName(), objectLinkToString(), objectLinkToString(), objectLinkToString(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), XmlDocVisitor::operator()(), DotFilePatcher::run(), SearchIndexExternal::setCurrentDoc(), DocbookGenerator::startDoxyAnchor(), LatexGenerator::startDoxyAnchor(), DocbookGenerator::startFile(), LatexGenerator::startFile(), RTFGenerator::startFile(), DocbookDocVisitor::startLink(), LatexDocVisitor::startLink(), RTFDocVisitor::startLink(), DocbookDocVisitor::startMermaidFile(), LatexDocVisitor::startMermaidFile(), LatexDocVisitor::startPlantUmlFile(), DocbookGenerator::startSection(), LatexGenerator::startSection(), LatexGenerator::startTextLink(), RTFGenerator::startTextLink(), stripPath(), substituteHtmlKeywords(), substituteLatexKeywords(), LatexGenerator::writeAnchor(), RTFGenerator::writeAnchor(), LatexCodeGenerator::writeCodeLink(), RTFCodeGenerator::writeCodeLink(), DocbookCodeGenerator::writeCodeLinkLine(), MemberList::writeDeclarations(), DocbookDocVisitor::writeDiaFile(), writeDocbookLink(), LatexCodeGenerator::writeLineNumber(), RTFCodeGenerator::writeLineNumber(), DocbookDocVisitor::writeMermaidFile(), LatexDocVisitor::writeMermaidFile(), DocbookDocVisitor::writePlantUMLFile(), LatexDocVisitor::writePlantUMLFile(), RTFGenerator::writeRTFReference(), and RTFGenerator::writeStartAnnoItem().
Strips the scope from a name. Examples: A::B will return A and A<T>::B<N::C<D> > will return A<T>.
Definition at line 3176 of file util.cpp.
References DString::at(), DString::length(), DString::right(), and stripScope().
Referenced by DotClassGraph::addClass(), DocRef::DocRef(), getCanonicalTypeForIdentifier(), DefinitionImpl::Private::init(), DiagramItem::label(), stripScope(), NamespaceDefImpl::writeBriefDescription(), and ClassDefImpl::writeIncludeFilesForSlice().
| DString stripTemplateSpecifiersFromScope | ( | const DString & | fullName, |
| bool | parentOnly, | ||
| DString * | pLastScopeStripped, | ||
| DString | scopeName, | ||
| bool | allowArtificial ) |
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 3866 of file util.cpp.
References DString::at(), DString::find(), getClass(), Definition::isArtificial(), DString::length(), mergeScopes(), DString::mid(), DString::npos, DString::right(), and stripTemplateSpecifiersFromScope().
Referenced by addClassToContext(), addMemberFunction(), addVariable(), buildFunctionList(), computeTemplateClassRelations(), extractClassName(), findMember(), findScopeFromQualifiedName(), findUsingDeclImports(), getCanonicalTypeForIdentifier(), SymbolResolver::Private::getResolvedSymbolRec(), SymbolResolver::Private::getResolvedTypeRec(), SymbolResolver::Private::newResolveTypedef(), resolveLink(), and stripTemplateSpecifiersFromScope().
| DString substituteKeywords | ( | const DString & | file, |
| const DString & | s, | ||
| const KeywordSubstitutionList & | keywords ) |
Definition at line 2561 of file util.cpp.
References DString::data(), DString::DString(), dstrlen(), dstrncmp(), DString::left(), DString::length(), substituteKeywords(), and warn.
Referenced by substituteHtmlKeywords(), substituteKeywords(), and substituteLatexKeywords().
| DString substituteTemplateArgumentsInString | ( | const DString & | name, |
| const ArgumentList & | formalArgs, | ||
| const 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 3704 of file util.cpp.
References argListToString(), AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, ArgumentList::begin(), Argument::defval, DString::DString(), ArgumentList::empty(), DString::empty(), ArgumentList::end(), end(), isId(), DString::left(), DString::mid(), Argument::name, DString::npos, prefix, DString::simplifyWhiteSpace(), DString::startsWith(), DString::str(), DString::stripWhiteSpace(), substituteTemplateArgumentsInString(), DString::substr(), and Argument::type.
Referenced by computeTemplateClassRelations(), MemberDefImpl::createTemplateInstanceMember(), findBaseClassesForClass(), findUsedClassesForClass(), SymbolResolver::Private::getResolvedSymbol(), SymbolResolver::Private::newResolveTypedef(), and substituteTemplateArgumentsInString().
| DString tempArgListToString | ( | const ArgumentList & | al, |
| SrcLangExt | lang, | ||
| bool | includeDefaults = true ) |
Definition at line 935 of file util.cpp.
References ArgumentList::empty(), isId(), DString::npos, removeRedundantWhiteSpace(), DString::right(), and tempArgListToString().
Referenced by addMemberFunction(), ClassDefImpl::className(), findTemplateInstanceRelation(), makeQualifiedNameWithTemplateParameters(), searchTemplateSpecs(), tempArgListToString(), and writeDefArgumentList().
| bool transcodeCharacterStringToUTF8 | ( | std::string & | input, |
| const char * | inputEncoding ) |
Definition at line 1086 of file util.cpp.
References DString::at(), dstricmp(), DString::ExplicitSize, portable_iconv(), portable_iconv_close(), portable_iconv_open(), DString::rawData(), DString::resize(), DString::str(), and transcodeCharacterStringToUTF8().
Referenced by addDirPrefix(), LayoutDocManager::parse(), readCodeFragment(), and transcodeCharacterStringToUTF8().
Definition at line 2842 of file util.cpp.
References DString::data(), DString::empty(), DString::length(), DString::reserve(), unescapeCharsInString(), and useCaseSenseNames().
Referenced by unescapeCharsInString().
| size_t updateColumnCount | ( | const char * | s, |
| size_t | col ) |
Definition at line 6083 of file util.cpp.
References Config_getInt, getUTF8CharNumBytes(), and updateColumnCount().
Referenced by HtmlCodeGenerator::codify(), LatexCodeGenerator::codify(), ManCodeGenerator::codify(), RTFCodeGenerator::codify(), processMarkup(), updateColumnCount(), writeDocbookCodeString(), and writeXMLCodeString().
Definition at line 4431 of file util.cpp.
References DString::at(), DString::data(), DString::empty(), err, g_extLookup, g_lang2extMap, DString::lower(), Doxygen::parserManager, DString::prepend(), DString::str(), and updateLanguageMapping().
Referenced by addCodeOnlyMappings(), addDirPrefix(), adjustConfiguration(), initDefaultExtensionMapping(), and updateLanguageMapping().
| bool useCaseSenseNames | ( | ) |
Returns true if the names of the symbols can be case sensitive.
Definition at line 2746 of file util.cpp.
References Config_getEnum, Portable::fileSystemIsCaseSensitive(), and useCaseSenseNames().
Referenced by escapeCharsInString(), genericPatternMatch(), FileNameFn::searchKey(), unescapeCharsInString(), and useCaseSenseNames().
| void writeExamples | ( | OutputList & | ol, |
| const ExampleList & | el ) |
Definition at line 836 of file util.cpp.
References OutputList::disable(), Docbook, DString::DString(), Html, Latex, Man, OutputList::popGeneratorState(), OutputList::pushGeneratorState(), RTF, DString::str(), theTranslator, Translator::trWriteList(), writeExamples(), writeMarkerList(), OutputList::writeObjectLink(), and OutputList::writeString().
Referenced by MemberDefImpl::_writeExamples(), ClassDefImpl::writeDetailedDocumentationBody(), and writeExamples().
| DString writeInlineGraph | ( | const DString & | baseName, |
| const DString & | extension, | ||
| const DString & | content, | ||
| bool & | exists ) |
Thread-safe function to write a string representing an inline graph to a file. The contents will be used to create a hash that will be used to make the name unique.
| [in] | baseName | the base name of the file to write including path. |
| [in] | extension | the file extension to use. |
| [in] | content | the data to write to the file |
| [out] | exists | is set to true if the file was already written before. |
Definition at line 6155 of file util.cpp.
References DString::data(), DString::DString(), err, DString::length(), md5str(), Portable::openOutputStream(), DString::str(), DString::view(), writeFileContents_lock, writeFileContents_set, and writeInlineGraph().
Referenced by DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), DocbookDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), LatexDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), RTFDocVisitor::operator()(), and writeInlineGraph().
| DString writeMarkerList | ( | const std::string & | markerText, |
| size_t | numMarkers, | ||
| std::function< DString(size_t)> | replaceFunc ) |
Definition at line 808 of file util.cpp.
References end(), DString::substr(), and writeMarkerList().
| void writeMarkerList | ( | OutputList & | ol, |
| const std::string & | markerText, | ||
| size_t | numMarkers, | ||
| std::function< void(size_t)> | replaceFunc ) |
Definition at line 785 of file util.cpp.
References end(), OutputList::parseText(), and writeMarkerList().
Referenced by MemberDefImpl::_writeReimplementedBy(), DefinitionImpl::_writeSourceRefList(), RequirementManager::generatePage(), recodeString(), writeExamples(), ClassDefImpl::writeInheritanceGraph(), writeMarkerList(), writeMarkerList(), and DefinitionImpl::writeRequirementRefs().
| void writeTypeConstraints | ( | OutputList & | ol, |
| const Definition * | d, | ||
| const ArgumentList & | al ) |
Definition at line 4783 of file util.cpp.
References Definition::docFile(), Definition::docLine(), ArgumentList::empty(), OutputList::endConstraintDocs(), OutputList::endConstraintList(), OutputList::endConstraintParam(), OutputList::endConstraintType(), OutputList::generateDoc(), linkifyText(), OutputList::parseText(), OutputList::startConstraintDocs(), OutputList::startConstraintList(), OutputList::startConstraintParam(), OutputList::startConstraintType(), TextGeneratorOLImpl::TextGeneratorOLImpl(), theTranslator, Translator::trTypeConstraints(), and writeTypeConstraints().
Referenced by MemberDefImpl::_writeTypeConstraints(), recodeString(), ClassDefImpl::writeDetailedDocumentationBody(), and writeTypeConstraints().