|
Doxygen
|
#include "util.h"#include <algorithm>#include <cassert>#include <cctype>#include <cinttypes>#include <cstdlib>#include <cstring>#include <ctime>#include <mutex>#include <unordered_set>#include "arguments.h"#include "classdef.h"#include "classlist.h"#include "conceptdef.h"#include "config.h"#include "datetime.h"#include "debug.h"#include "defargs.h"#include "dir.h"#include "dirdef.h"#include "doxygen.h"#include "example.h"#include "filedef.h"#include "fileinfo.h"#include "filename.h"#include "groupdef.h"#include "htmlentity.h"#include "image.h"#include "language.h"#include "md5hash.h"#include "membername.h"#include "message.h"#include "moduledef.h"#include "namespacedef.h"#include "outputlist.h"#include "pagedef.h"#include "parserintf.h"#include "portable.h"#include "regex.h"#include "stringutil.h"#include "symbolresolver.h"#include "textstream.h"#include "trace.h"#include "utf8.h"Go to the source code of this file.
Classes | |
| struct | CharAroundSpace |
| struct | CharAroundSpace::CharElem |
| struct | Lang2ExtMap |
Macros | |
| #define | ENABLE_TRACINGSUPPORT 0 |
| #define | REL_PATH_TO_ROOT "../../" |
| #define | MATCH AUTO_TRACE_EXIT("match at line {}",__LINE__); |
| #define | NOMATCH AUTO_TRACE_EXIT("no match at line {}",__LINE__); |
| #define | HEXTONUM(x) |
Functions | |
| DString | removeAnonymousScopes (const DString &str) |
| DString | replaceAnonymousScopes (const DString &s, const DString &replacement) |
| DString | stripAnonymousNamespaceScope (const DString &s) |
| static DString | stripFromPath (const DString &p, StringVector l) |
| DString | stripFromPath (const DString &path) |
| DString | stripFromIncludePath (const DString &path) |
| DString | resolveTypeDef (const Definition *context, const DString &qualifiedName, const Definition **typedefContext) |
| DString | removeRedundantWhiteSpace (const DString &s) |
| static size_t | findParameterList (const DString &name) |
| Returns the position in the string where a function parameter list begins, or DString::npos if one is not found. | |
| bool | rightScopeMatch (const DString &scope, const DString &name) |
| bool | leftScopeMatch (const DString &scope, const DString &name) |
| 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) |
| void | writeExamples (OutputList &ol, const ExampleList &list) |
| DString | inlineTemplateArgListToDoc (const ArgumentList &al) |
| DString | argListToString (const ArgumentList &al, bool useCanonicalType, bool showDefVals) |
| DString | tempArgListToString (const ArgumentList &al, SrcLangExt lang, bool includeDefault) |
| static void | filterCRLF (std::string &contents) |
| static DString | getFilterFromList (const DString &name, const StringVector &filterList, bool &found) |
| DString | getFileFilter (const DString &name, bool isSourceCode) |
| DString | fileToString (const DString &name, bool filter, bool isSourceCode) |
| void | trimBaseClassScope (const BaseClassList &bcl, DString &s, int level=0) |
| static void | stripIrrelevantString (DString &target, const DString &str, bool insideTemplate) |
| void | stripIrrelevantConstVolatile (DString &s, bool insideTemplate) |
| static DString | stripDeclKeywords (const DString &s) |
| static DString | extractCanonicalType (const Definition *d, const FileDef *fs, DString type, SrcLangExt lang, bool insideTemplate) |
| static DString | getCanonicalTemplateSpec (const Definition *d, const FileDef *fs, const DString &spec, SrcLangExt lang) |
| static DString | getCanonicalTypeForIdentifier (const Definition *d, const FileDef *fs, const DString &word, SrcLangExt lang, DString *tSpec, int count=0) |
| static DString | extractCanonicalArgType (const Definition *d, const FileDef *fs, const Argument &arg, SrcLangExt lang) |
| static bool | matchCanonicalTypes (const Definition *srcScope, const FileDef *srcFileScope, const DString &srcType, const Definition *dstScope, const FileDef *dstFileScope, const DString &dstType, SrcLangExt lang) |
| static bool | matchArgument2 (const Definition *srcScope, const FileDef *srcFileScope, Argument &srcA, const Definition *dstScope, const FileDef *dstFileScope, Argument &dstA, SrcLangExt lang) |
| 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) |
| bool | matchTemplateArguments (const ArgumentList &srcAl, const ArgumentList &dstAl) |
| GetDefResult | getDefs (const GetDefInput &input) |
| static bool | getScopeDefs (const DString &docScope, const DString &scope, ClassDef *&cd, ConceptDef *&cnd, NamespaceDef *&nd, ModuleDef *&modd) |
| static bool | isLowerCase (DString &s) |
| bool | resolveRef (const DString &scName, const DString &name, bool inSeeBlock, const Definition **resContext, const MemberDef **resMember, SrcLangExt lang, bool lookForSpecialization, const FileDef *currentFile, bool checkScope) |
| DString | linkToText (SrcLangExt lang, const DString &link, bool ignoreDots) |
| static const DirDef * | resolveDirLink (const DString &linkRef) |
| bool | resolveLink (const DString &scName, const DString &lr, bool, const Definition **resContext, DString &resAnchor, SrcLangExt lang, const DString &prefix) |
| DString | findExampleFilePath (const DString &file, bool &ambig) |
| DString | substituteKeywords (const DString &file, const DString &s, const KeywordSubstitutionList &keywords) |
| DString | showDate (const DString &fmt) |
| DString | projectLogoFile () |
| DString | projectLogoSize () |
| int | getPrefixIndex (const DString &name) |
| bool | useCaseSenseNames () |
| Returns true if the names of the symbols can be case sensitive. | |
| DString | escapeCharsInString (const DString &name, bool allowDots, bool allowUnderscore) |
| DString | unescapeCharsInString (const DString &s) |
| DString | convertNameToFile (const DString &name, bool allowDots, bool allowUnderscore) |
| DString | relativePathToRoot (const DString &name) |
| DString | determineAbsoluteIncludeName (const DString &curFile, const DString &incFileName) |
| void | createSubDirs (const Dir &d) |
| void | clearSubDirs (const Dir &d) |
| void | extractNamespaceName (const DString &scopeName, DString &className, DString &namespaceName, bool allowEmptyClass) |
| DString | insertTemplateSpecifierInScope (const DString &scope, const DString &templ) |
| DString | stripScope (const DString &name) |
| DString | convertToId (const DString &s) |
| DString | convertToXML (const DString &s, bool keepEntities, const bool citeEntry) |
| DString | convertToHtml (const DString &s, bool keepEntities) |
| DString | convertToJSString (const DString &s, bool keepEntities, bool singleQuotes) |
| int | extractClassNameFromType (const DString &type, int &pos, DString &name, DString &templSpec, SrcLangExt lang) |
| DString | normalizeNonTemplateArgumentsInString (const DString &name, const Definition *context, const ArgumentList &formalArgs) |
| DString | substituteTemplateArgumentsInString (const DString &nm, const ArgumentList &formalArgs, const ArgumentList *actualArgs) |
| DString | stripTemplateSpecifiersFromScope (const DString &fullName, bool parentOnly, DString *pLastScopeStripped, DString scopeName, bool allowArtificial) |
| DString | mergeScopes (const DString &leftScope, const DString &rightScope) |
| int | getScopeFragment (const DString &s, int p, int *l) |
| static ModuleDef * | findModuleDef (const Definition *d) |
| static bool | recursivelyAddGroupListToTitle (OutputList &ol, const Definition *d, bool root) |
| void | addGroupListToTitle (OutputList &ol, const Definition *d) |
| 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 | stripPath (const DString &s) |
| DString | makeBaseName (const DString &name, const DString &ext) |
| 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 &language) |
| void | initDefaultExtensionMapping () |
| void | addCodeOnlyMappings () |
| SrcLangExt | getLanguageFromFileName (const DString &fileName, SrcLangExt defLang) |
| SrcLangExt | getLanguageFromCodeLang (DString &fileName) |
| Routine to handle the language attribute of the \code command. | |
| DString | getFileNameExtension (const DString &fn) |
| static MemberDef * | getMemberFromSymbol (const Definition *scope, const FileDef *fileScope, const DString &n) |
| bool | checkIfTypedef (const Definition *scope, const FileDef *fileScope, const DString &n) |
| void | writeTypeConstraints (OutputList &ol, const Definition *d, const ArgumentList &al) |
| void | stackTrace () |
| static void | transcodeCharacterBuffer (const DString &fileName, std::string &contents, const DString &inputEncoding, const DString &outputEncoding) |
| bool | readInputFile (const DString &fileName, std::string &contents, bool filter, bool isSourceCode) |
| read a file name fileName and optionally filter and transcode it | |
| DString | filterTitle (const DString &title) |
| DString | getEncoding (const FileInfo &fi) |
| DString | externalLinkTarget (const bool parent) |
| DString | createHtmlUrl (const DString &relPath, const DString &ref, bool isLocalFile, const DString &targetFileName, const DString &anchor) |
| DString | externalRef (const DString &relPath, const DString &ref) |
| 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. | |
| DString | getLanguageSpecificSeparator (SrcLangExt lang, bool classScope) |
| 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. | |
| bool | protectionLevelVisible (Protection prot) |
| DString | stripIndentation (const DString &s, bool skipFirstLine) |
| void | stripIndentationVerbatim (DString &doc, size_t indentationLevel, bool skipFirstLine) |
| static DString | extractDirection (DString &docs) |
| Strip the direction part from docs and return it as a string in canonical form. | |
| DString | inlineArgListToDoc (const ArgumentList &al) |
| 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 () |
| DString | getDotImageExtension () |
| bool | openOutputFile (const DString &outFile, std::ofstream &f) |
| 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 | detab (const DString &s, size_t &refIndent) |
| DString | getProjectId () |
| int | computeQualifiedIndex (const DString &name) |
| Return the index of the last :: in the string name that is still before the first <. | |
| DString | mangleCSharpGenericName (const DString &name) |
| DString | demangleCSharpGenericName (const DString &name, const DString &templArgs) |
| DString | extractBeginRawStringDelimiter (const char *rawStart) |
| DString | extractEndRawStringDelimiter (const char *rawEnd) |
| DString | writeInlineGraph (const DString &baseName, const DString &extension, const DString &content, bool &exists) |
| void | cleanupInlineGraphs () |
Variables | |
| static const char * | hex = "0123456789ABCDEF" |
| static const char | constScope [] = { 'c', 'o', 'n', 's', 't', ':' } |
| static const char | volatileScope [] = { 'v', 'o', 'l', 'a', 't', 'i', 'l', 'e', ':' } |
| static const char | virtualScope [] = { 'v', 'i', 'r', 't', 'u', 'a', 'l', ':' } |
| static const char | operatorScope [] = { 'o', 'p', 'e', 'r', 'a', 't', 'o', 'r', '?', '?', '?' } |
| static CharAroundSpace | g_charAroundSpace |
| static std::mutex | g_matchArgsMutex |
| static std::unordered_map< std::string, int > | g_usedNames |
| static std::mutex | g_usedNamesMutex |
| static int | g_usedNamesCount =1 |
| static std::unordered_map< std::string, SrcLangExt > | g_extLookup |
| static std::vector< Lang2ExtMap > | g_lang2extMap |
| static std::mutex | writeFileContents_lock |
| static StringUnorderedSet | writeFileContents_set |
| #define HEXTONUM | ( | x | ) |
Referenced by replaceColorMarkers().
| #define MATCH AUTO_TRACE_EXIT("match at line {}",__LINE__); |
Definition at line 1490 of file util.cpp.
Referenced by matchArgument2(), and matchArguments2().
| #define NOMATCH AUTO_TRACE_EXIT("no match at line {}",__LINE__); |
Definition at line 1491 of file util.cpp.
Referenced by matchArgument2(), and matchArguments2().
| #define REL_PATH_TO_ROOT "../../" |
Definition at line 80 of file util.cpp.
Referenced by relativePathToRoot().
| void addCodeOnlyMappings | ( | ) |
Definition at line 4164 of file util.cpp.
References addCodeOnlyMappings(), and updateLanguageMapping().
Referenced by addCodeOnlyMappings(), addDirPrefix(), and generateOutput().
| void addGroupListToTitle | ( | OutputList & | ol, |
| const Definition * | d ) |
Definition at line 3923 of file util.cpp.
References addGroupListToTitle(), and recursivelyAddGroupListToTitle().
Referenced by addDirPrefix(), addGroupListToTitle(), ClassDefImpl::writeDocumentation(), ConceptDefImpl::writeDocumentation(), FileDefImpl::writeDocumentation(), GroupDefImpl::writeDocumentation(), ModuleDefImpl::writeDocumentation(), and NamespaceDefImpl::writeDocumentation().
| void addHtmlExtensionIfMissing | ( | DString & | fName | ) |
Definition at line 3933 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(), addDirPrefix(), 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().
| DString argListToString | ( | const ArgumentList & | al, |
| bool | useCanonicalType = false, | ||
| bool | showDefVals = true ) |
Returns a string representation of the parameter list al. If useCanonicalType is true then the canonical type is used for each argument. If showDefVals is true then default values are included in the string representation.
Definition at line 861 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 5116 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 3928 of file util.cpp.
References checkExtension(), DString::length(), and DString::right().
Referenced by addDirPrefix(), 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 4273 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 5385 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 2998 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 5280 of file util.cpp.
References computeQualifiedIndex(), DString::data(), and DString::length().
Referenced by addDirPrefix(), addToMap(), addVariable(), buildFunctionList(), buildTypedefList(), computeQualifiedIndex(), getMemberFromSymbol(), SymbolResolver::Private::getResolvedSymbolRec(), and SymbolResolver::Private::getResolvedTypeRec().
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 2865 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 addDirPrefix(), 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 4906 of file util.cpp.
References Config_getBool, convertProtectionLevel(), MemberListType::Invalid(), MemberListType::isPrivate(), MemberListType::isProtected(), MemberListType::isPublic(), MemberListType::toProtected(), and MemberListType::toPublic().
Referenced by addDirPrefix(), convertProtectionLevel(), ClassDefImpl::countInheritedDecMembers(), and ClassDefImpl::writeInheritedMemberDeclarations().
Converts a string to a HTML-encoded string
Definition at line 3293 of file util.cpp.
References convertToHtml(), DString::data(), DString::empty(), hex, isId(), DString::length(), and DString::reserve().
Referenced by HtmlCodeGenerator::_writeCodeLink(), HtmlHelp::addContentsItem(), addDirPrefix(), 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 3204 of file util.cpp.
References convertToId(), DString::data(), DString::empty(), hex, DString::length(), and DString::reserve().
Referenced by addDirPrefix(), convertToId(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endMemberTemplateParams(), renderQuickLinksAsJs(), HtmlGenerator::startGroupHeader(), HtmlGenerator::startMemberItem(), writeMemberList(), writeQuickMemberIndex(), ClassDefImpl::writeSummaryLinks(), and VhdlDocGen::writeVHDLDeclarations().
Definition at line 3353 of file util.cpp.
References HtmlEntityMapper::convertCharEntitiesToUTF8(), convertToJSString(), DString::data(), DString::empty(), HtmlEntityMapper::instance(), DString::length(), and DString::reserve().
Referenced by addDirPrefix(), convertToJSString(), generateJSLink(), generateJSNavTree(), renderQuickLinksAsJs(), writeJavascriptSearchData(), and writeJavasScriptSearchDataPage().
Converts a string to an XML-encoded string
Definition at line 3234 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(), addDirPrefix(), 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.
Copies the file src to dest. Returns true if the copy was successful, false otherwise. When a relative path is used, is is based on the current working directory.
Definition at line 4621 of file util.cpp.
References copyFile(), Dir::Dir(), err, and DString::str().
Referenced by addDirPrefix(), 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()(), 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 4661 of file util.cpp.
References correctURL(), DString::empty(), isURL(), and DString::prepend().
Referenced by addDirPrefix(), correctURL(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), XmlDocVisitor::operator()(), and startQuickIndexItem().
| DString createHtmlUrl | ( | const DString & | relPath, |
| const DString & | ref, | ||
| bool | isLocalFile, | ||
| const DString & | targetFileName, | ||
| const DString & | anchor ) |
Definition at line 4504 of file util.cpp.
References createHtmlUrl(), DString::empty(), DString::endsWith(), and externalRef().
Referenced by HtmlCodeGenerator::_writeCodeLink(), addDirPrefix(), createHtmlUrl(), RequirementManager::generatePage(), HtmlDocVisitor::startLink(), HtmlGenerator::startTextLink(), HtmlGenerator::writeObjectLink(), and HtmlCodeGenerator::writeTooltip().
| void createSubDirs | ( | const Dir & | d | ) |
Definition at line 2971 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 5330 of file util.cpp.
References demangleCSharpGenericName(), DString::endsWith(), DString::find(), and DString::left().
Referenced by addDirPrefix(), ClassDefImpl::className(), and demangleCSharpGenericName().
Definition at line 5181 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(), DocParser::readTextFileByName(), readTextFileByName(), MemberDefImpl::setInitializer(), DefinitionImpl::writeInlineCode(), and FileDefImpl::writeSourceBody().
Definition at line 2931 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 2690 of file util.cpp.
References Config_getBool, DString::data(), DString::DString(), DString::empty(), escapeCharsInString(), getUTF8CharNumBytes(), hex, DString::length(), DString::reserve(), and useCaseSenseNames().
Referenced by addDirPrefix(), convertNameToFile(), escapeCharsInString(), DotClassGraph::getMapLabel(), DotDirDeps::getMapLabel(), DotGfxHierarchyTable::getMapLabel(), DotGroupCollaboration::getMapLabel(), DotInclDepGraph::getMapLabel(), markdownFileNameToId(), and PageDefImpl::writeDocumentation().
| DString externalLinkTarget | ( | const bool | parent | ) |
Definition at line 4493 of file util.cpp.
References Config_getBool, externalLinkTarget(), and parent().
Referenced by HtmlCodeGenerator::_writeCodeLink(), addDirPrefix(), externalLinkTarget(), FTVHelp::Private::generateLink(), Markdown::Private::processLink(), replaceRef(), HtmlGenerator::startIndexItem(), HtmlDocVisitor::startLink(), HtmlGenerator::writeInheritedSectionTitle(), writeMapArea(), and HtmlGenerator::writeObjectLink().
Resolve a reference via a tagfile reference ref. If after resolving the reference the result points to a relative path then relPath is prepended to create the correct link.
Definition at line 4540 of file util.cpp.
References 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(), replaceRef(), HtmlGenerator::startIndexItem(), LayoutNavEntry::url(), HtmlGenerator::writeInheritedSectionTitle(), writeJavasScriptSearchDataPage(), and writeMapArea().
| DString extractBeginRawStringDelimiter | ( | const char * | rawStart | ) |
Definition at line 5341 of file util.cpp.
References extractBeginRawStringDelimiter(), DString::find(), DString::length(), DString::mid(), and DString::npos.
Referenced by addDirPrefix(), and extractBeginRawStringDelimiter().
|
static |
Definition at line 1460 of file util.cpp.
References Argument::array, DString::empty(), extractCanonicalArgType(), extractCanonicalType(), Argument::name, DString::stripWhiteSpace(), and Argument::type.
Referenced by extractCanonicalArgType(), and matchArgument2().
|
static |
Definition at line 1374 of file util.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, DString::empty(), end(), extractCanonicalType(), extractClassNameFromType(), getCanonicalTypeForIdentifier(), DString::mid(), Definition::name(), removeRedundantWhiteSpace(), DString::str(), stripIrrelevantConstVolatile(), DString::stripPrefix(), DString::stripWhiteSpace(), and DString::substr().
Referenced by extractCanonicalArgType(), extractCanonicalType(), and getCanonicalTemplateSpec().
| 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 3382 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 addDirPrefix(), extractCanonicalType(), extractClassNameFromType(), findUsedClassesForClass(), stripClassName(), and stripClassName().
Strip the direction part from docs and return it as a string in canonical form.
The input docs string can start with e.g. "[in]", "[in, out]", "[inout]", "[out,in]"...
Definition at line 4831 of file util.cpp.
References end(), extractDirection(), DString::str(), and DString::substr().
Referenced by extractDirection(), and inlineArgListToDoc().
| DString extractEndRawStringDelimiter | ( | const char * | rawEnd | ) |
Definition at line 5349 of file util.cpp.
References extractEndRawStringDelimiter(), DString::length(), and DString::mid().
Referenced by addDirPrefix(), and extractEndRawStringDelimiter().
| 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 3028 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(), addDirPrefix(), 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 1055 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().
|
static |
takes the buf of the given length 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 961 of file util.cpp.
References filterCRLF().
Referenced by filterCRLF(), and readInputFile().
Definition at line 4456 of file util.cpp.
References end(), filterTitle(), and DString::str().
Referenced by addDirPrefix(), addToIndices(), createJavaScriptSearchIndex(), filterTitle(), PerlModGenerator::generatePerlModForPage(), generateSqlite3ForPage(), generateXMLForPage(), generateXMLForRequirement(), generateXMLForRequirements(), parseCommentAsHtml(), SearchIndexExternal::setCurrentDoc(), HtmlGenerator::startFile(), and writeJavasScriptSearchDataPage().
Definition at line 2453 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().
|
static |
Definition at line 3855 of file util.cpp.
References Definition::definitionType(), findModuleDef(), ClassDef::getFileDef(), ConceptDef::getFileDef(), FileDef::getModuleDef(), toClassDef(), toConceptDef(), toFileDef(), Definition::TypeClass, Definition::TypeConcept, and Definition::TypeFile.
Referenced by findModuleDef(), and recursivelyAddGroupListToTitle().
|
static |
Returns the position in the string where a function parameter list begins, or DString::npos if one is not found.
Definition at line 686 of file util.cpp.
References findParameterList(), DString::mid(), DString::npos, and DString::rfind().
Referenced by findParameterList(), and resolveRef().
|
static |
Definition at line 1199 of file util.cpp.
References DString::at(), AUTO_TRACE, AUTO_TRACE_EXIT, DString::empty(), extractCanonicalType(), getCanonicalTemplateSpec(), DString::mid(), resolveTypeDef(), and DString::stripWhiteSpace().
Referenced by getCanonicalTemplateSpec(), and getCanonicalTypeForIdentifier().
|
static |
Definition at line 1220 of file util.cpp.
References AUTO_TRACE, AUTO_TRACE_ADD, AUTO_TRACE_EXIT, DString::empty(), getCanonicalTemplateSpec(), getCanonicalTypeForIdentifier(), Definition::getLanguage(), SymbolResolver::getResolvedType(), SymbolResolver::getTemplateSpec(), SymbolResolver::getTypedef(), MemberDef::isEnumerate(), ClassDef::isTemplate(), MemberDef::isTypedef(), ClassDef::isUsedOnly(), Definition::name(), DString::npos, Definition::qualifiedName(), ClassDef::qualifiedNameWithTemplateParameters(), removeRedundantWhiteSpace(), SymbolResolver::resolveClass(), resolveTypeDef(), DString::rfind(), DString::startsWith(), stripDeclKeywords(), DString::stripPrefix(), stripScope(), stripTemplateSpecifiersFromScope(), and MemberDef::typeString().
Referenced by extractCanonicalType(), and getCanonicalTypeForIdentifier().
| GetDefResult getDefs | ( | const GetDefInput & | input | ) |
Definition at line 1868 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 | ( | ) |
Returns the file extension to use for dot files as specified via the DOT_IMAGE_FORMAT configuration option.
Definition at line 4966 of file util.cpp.
References Config_getEnumAsString, DString::find(), getDotImageExtension(), DString::left(), and DString::npos.
Referenced by addDirPrefix(), MermaidManager::convertToImageFormat(), RTFGenerator::endCallGraph(), RTFGenerator::endDirDepGraph(), RTFGenerator::endDotGraph(), RTFGenerator::endInclDepGraph(), DotGraph::generateCode(), getDotImageExtension(), DotGraph::imgName(), HtmlDocVisitor::operator()(), HtmlDocVisitor::operator()(), 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 4479 of file util.cpp.
References Config_getString, InputFileEncoding::encoding, getEncoding(), Doxygen::inputFileEncodingList, FileInfo::match(), and useCaseSenseNames().
Referenced by addDirPrefix(), getEncoding(), 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 1022 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 4212 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().
|
static |
Definition at line 987 of file util.cpp.
References Portable::fileSystemIsCaseSensitive(), DString::find(), getFilterFromList(), reg::Ex::isValid(), DString::left(), DString::lower(), reg::match(), DString::mid(), DString::npos, DString::str(), and reg::Ex::Wildcard.
Referenced by getFileFilter(), and getFilterFromList().
| SrcLangExt getLanguageFromCodeLang | ( | DString & | fileName | ) |
Routine to handle the language attribute of the \code command.
Definition at line 4188 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 ) |
Definition at line 4170 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 4631 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().
|
static |
Definition at line 4221 of file util.cpp.
References computeQualifiedIndex(), Definition::definitionType(), DString::empty(), SymbolMap< T >::find(), getMemberFromSymbol(), Doxygen::globalScope, SymbolResolver::isAccessibleFromWithExpScope(), DString::left(), DString::mid(), replaceNamespaceAliases(), Doxygen::symbolMap, toMemberDef(), Definition::TypeClass, Definition::TypeMember, and Definition::TypeNamespace.
Referenced by checkIfTypedef(), and getMemberFromSymbol().
| 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 2653 of file util.cpp.
References DString::at(), Config_getList, DString::data(), DString::empty(), getPrefixIndex(), and DString::length().
Referenced by Index::addClassMemberNameToIndex(), addDirPrefix(), Index::addFileMemberNameToIndex(), Index::addModuleMemberNameToIndex(), Index::addNamespaceMemberNameToIndex(), SearchIndex::addWordRec(), getPrefixIndex(), parseInput(), writeAlphabeticalClassList(), and writeMemberList().
| DString getProjectId | ( | ) |
Definition at line 5272 of file util.cpp.
References Config_getString, DString::DString(), DString::empty(), getProjectId(), md5str(), and DString::view().
Referenced by addDirPrefix(), generateJSNavTree(), getProjectId(), HtmlGenerator::init(), and writeJavaScriptSearchIndex().
|
static |
Searches for a scope definition given its name as a string via parameter scope.
The parameter docScope is a string representing the name of the scope in which the scope string was found.
The function returns true if the scope is known and documented or false if it is not. If true is returned exactly one of the parameter cd, nd will be non-zero:
Definition at line 1938 of file util.cpp.
References DString::at(), Doxygen::conceptLinkedMap, DString::empty(), getClass(), getScopeDefs(), ModuleManager::instance(), Definition::isLinkable(), DString::left(), DString::length(), DString::mid(), Doxygen::namespaceLinkedMap, DString::npos, DString::prepend(), and DString::rfind().
Referenced by getScopeDefs(), and resolveRef().
| 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 3800 of file util.cpp.
References DString::at(), getScopeFragment(), and DString::length().
Referenced by addDirPrefix(), buildScopeFromQualifiedName(), findScopeFromQualifiedName(), SymbolResolver::Private::followPath(), getScopeFragment(), resolveTypeDef(), and stripAnonymousNamespaceScope().
| void initDefaultExtensionMapping | ( | ) |
Definition at line 4097 of file util.cpp.
References initDefaultExtensionMapping(), and updateLanguageMapping().
Referenced by addDirPrefix(), initDefaultExtensionMapping(), and initDoxygen().
| DString inlineArgListToDoc | ( | const ArgumentList & | al | ) |
Returns a documentation string combining the inline documentation for each parameter in the list al.
Definition at line 4867 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 | ) |
Returns a documentation string combining the inline documentation for each template parameter in the list al.
Definition at line 834 of file util.cpp.
References ArgumentList::hasTemplateDocumentation(), inlineTemplateArgListToDoc(), DString::stripPrefix(), and DString::stripWhiteSpace().
Referenced by inlineTemplateArgListToDoc(), ClassDefImpl::writeDetailedDocumentationBody(), and MemberDefImpl::writeDocumentation().
Definition at line 3078 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(), addDirPrefix(), generateXMLForClass(), insertTemplateSpecifierInScope(), DiagramItem::label(), ClassDefImpl::writeInheritanceGraph(), and ClassDefImpl::writeTagFile().
|
static |
Definition at line 2001 of file util.cpp.
References DString::data(), DString::empty(), and isLowerCase().
Referenced by isLowerCase(), and resolveRef().
| bool isURL | ( | const DString & | url | ) |
Checks whether the given url starts with a supported protocol.
Definition at line 4648 of file util.cpp.
References DString::find(), isURL(), DString::left(), DString::npos, DString::str(), and DString::stripWhiteSpace().
Referenced by addDirPrefix(), correctURL(), isURL(), and Markdown::Private::processLink().
Definition at line 742 of file util.cpp.
References DString::at(), DString::left(), leftScopeMatch(), and DString::length().
Referenced by addClassToContext(), addConceptToContext(), buildFunctionList(), leftScopeMatch(), mergeScopes(), pushScope(), and resolveRef().
| DString linkToText | ( | SrcLangExt | lang, |
| const DString & | link, | ||
| bool | ignoreDots ) |
Definition at line 2267 of file util.cpp.
References DString::at(), DString::empty(), DString::find(), getLanguageSpecificSeparator(), linkToText(), DString::mid(), DString::npos, and substitute().
Referenced by addDirPrefix(), DotCallGraph::buildGraph(), DocRef::DocRef(), DotCallGraph::DotCallGraph(), DocParser::handleLinkedWord(), and linkToText().
| bool mainPageHasTitle | ( | ) |
Definition at line 4961 of file util.cpp.
References Doxygen::mainPage, and mainPageHasTitle().
Referenced by addDirPrefix(), generateJSNavTree(), generateSqlite3ForPage(), generateXMLForPage(), and mainPageHasTitle().
Definition at line 3976 of file util.cpp.
References makeBaseName(), stripExtensionGeneral(), and stripPath().
Referenced by addDirPrefix(), 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 5321 of file util.cpp.
References DString::contains(), DString::DString(), DString::find(), DString::left(), mangleCSharpGenericName(), DString::npos, and DString::setNum().
Referenced by addClassToContext(), addDirPrefix(), addEnumValuesToEnums(), addVariable(), buildFunctionList(), extractClassName(), findClassRelation(), findEnums(), mangleCSharpGenericName(), SymbolResolver::resolveClass(), resolveLink(), and resolveRef().
|
static |
Definition at line 1525 of file util.cpp.
References AUTO_TRACE, AUTO_TRACE_EXIT, Argument::canType, DString::empty(), extractCanonicalArgType(), g_matchArgsMutex, DString::length(), MATCH, matchArgument2(), matchCanonicalTypes(), Argument::name, Definition::name(), NOMATCH, DString::right(), stripIrrelevantConstVolatile(), and Argument::type.
Referenced by matchArgument2(), and matchArguments2().
| 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 1591 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().
|
static |
Definition at line 1493 of file util.cpp.
References AUTO_TRACE, DString::find(), DString::left(), matchArguments2(), matchCanonicalTypes(), DString::mid(), DString::npos, and stringToArgumentList().
Referenced by matchArgument2(), and matchCanonicalTypes().
| 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 1835 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 1691 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().
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 3755 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 addDirPrefix(), 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 3467 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 ) |
Helper to open an output search f for writing. If the file already exists it will be renamed to .bak first. If outFile is "-" then the output will be written to standard output.
Definition at line 4973 of file util.cpp.
References FileInfo::exists(), FileInfo::filePath(), openOutputFile(), Portable::openOutputStream(), Dir::remove(), Dir::rename(), and DString::str().
Referenced by addDirPrefix(), compareDoxyfile(), generateConfigFile(), openOutputFile(), readConfiguration(), and writeDefaultLayoutFile().
| DString projectLogoFile | ( | ) |
Definition at line 2582 of file util.cpp.
References Config_getString, DString::empty(), DString::find(), DString::left(), DString::npos, and projectLogoFile().
Referenced by addDirPrefix(), copyLogo(), projectLogoFile(), substituteHtmlKeywords(), and substituteLatexKeywords().
| DString projectLogoSize | ( | ) |
Definition at line 2601 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 addDirPrefix(), projectLogoSize(), substituteHtmlKeywords(), and substituteLatexKeywords().
| bool protectionLevelVisible | ( | Protection | prot | ) |
Definition at line 4673 of file util.cpp.
References Config_getBool, and protectionLevelVisible().
Referenced by MemberDefImpl::_computeLinkableInProject(), addClassAndNestedClasses(), addDirPrefix(), computeClassRelations(), MemberDefImpl::hasDetailedDescription(), ClassDefImpl::internalInsertMember(), MemberDefImpl::isBriefSectionVisible(), ClassDefImpl::isLinkableInProject(), ClassDefImpl::isVisibleInHierarchy(), protectionLevelVisible(), MemberDefImpl::warnIfUndocumented(), MemberDefImpl::writeDeclaration(), ClassDefImpl::writeDocumentationForInnerClasses(), ClassDefImpl::writeMemberList(), and ClassDefImpl::writeTagFile().
| bool readInputFile | ( | const DString & | fileName, |
| std::string & | contents, | ||
| bool | filter, | ||
| bool | isSourceCode ) |
read a file name fileName and optionally filter and transcode it
Definition at line 4376 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().
|
static |
Definition at line 3884 of file util.cpp.
References OutputList::disableAllBut(), Definition::displayName(), findModuleDef(), Definition::getOutputFileBase(), Definition::getReference(), Html, Definition::partOfGroups(), OutputList::popGeneratorState(), OutputList::pushGeneratorState(), recursivelyAddGroupListToTitle(), theTranslator, Translator::trModule(), OutputList::writeObjectLink(), and OutputList::writeString().
Referenced by addGroupListToTitle(), and recursivelyAddGroupListToTitle().
Definition at line 2914 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 100 of file util.cpp.
References DString::empty(), end(), removeAnonymousScopes(), and DString::str().
Referenced by addDirPrefix(), MemberDefImpl::displayDefinition(), generateClassMemberLink(), ClassDefImpl::internalInsertMember(), makeDisplayName(), makeDisplayName(), removeAnonymousScopes(), simplifyTypeForTable(), MemberDefImpl::writeDeclaration(), and MemberDefImpl::writeDocumentation().
Definition at line 428 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 157 of file util.cpp.
References DString::data(), DString::empty(), reg::replace(), replaceAnonymousScopes(), and DString::str().
Referenced by addDirPrefix(), 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 4570 of file util.cpp.
References Config_getInt, DString::DString(), DString::empty(), end(), hex, HEXTONUM, ColoredImage::hsl2rgb(), replaceColorMarkers(), and DString::str().
Referenced by addDirPrefix(), ResourceMgr::copyResourceAs(), fillColorStyleMaps(), HtmlGenerator::init(), replaceColorMarkers(), and writeDefaultStyleSheet().
Definition at line 2292 of file util.cpp.
References FileInfo::absFilePath(), Config_getList, Doxygen::dirLinkedMap, FileInfo::FileInfo(), LinkedMap< T, Hash, KeyEqual, Map >::find(), resolveDirLink(), and DString::str().
Referenced by resolveDirLink(), and resolveLink().
| 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 2310 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 2010 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 * | context, |
| const DString & | qualifiedName, | ||
| const Definition ** | typedefContext ) |
Definition at line 234 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 731 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 5003 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 2569 of file util.cpp.
References dateTimeFromString(), err, formatDateTime(), and showDate().
Referenced by addDirPrefix(), showDate(), substituteHtmlKeywords(), and substituteLatexKeywords().
| void stackTrace | ( | ) |
Definition at line 4312 of file util.cpp.
References Portable::pclose(), Portable::popen(), and stackTrace().
Referenced by addDirPrefix(), and stackTrace().
Definition at line 169 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 1183 of file util.cpp.
References DString::find(), DString::left(), DString::mid(), DString::npos, and stripDeclKeywords().
Referenced by getCanonicalTypeForIdentifier(), and stripDeclKeywords().
Definition at line 3957 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 3947 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 229 of file util.cpp.
References Config_getList, stripFromIncludePath(), and stripFromPath().
Referenced by MemberDefImpl::_writeGroupInclude(), addIncludeFile(), FileNameLinkedMap::findFileDef(), FileNameLinkedMap::showFileDefMatches(), and stripFromIncludePath().
|
inlinestatic |
Definition at line 198 of file util.cpp.
References dstricmp(), DString::left(), DString::mid(), prefix, Portable::removeLongPathMarker(), and stripFromPath().
strip part of path if it matches one of the paths in the Config_getList(STRIP_FROM_PATH) list
Definition at line 221 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 4685 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(), and stripIndentation().
| void stripIndentationVerbatim | ( | DString & | doc, |
| size_t | indentationLevel, | ||
| bool | skipFirstLine ) |
Definition at line 4774 of file util.cpp.
References DString::data(), DString::empty(), DString::rawData(), DString::resize(), and stripIndentationVerbatim().
Referenced by MemberDefImpl::setInitializer(), and stripIndentationVerbatim().
| void stripIrrelevantConstVolatile | ( | DString & | s, |
| bool | insideTemplate ) |
According to the C++ spec and Ivan Vecerina:
Parameter declarations that differ only in the presence or absence of const and/or volatile are equivalent.
So the following example, show what is stripped by this routine for const. The same is done for volatile.
For Java code we also strip the "final" keyword, see bug 765070.
Definition at line 1173 of file util.cpp.
References stripIrrelevantConstVolatile(), and stripIrrelevantString().
Referenced by extractCanonicalType(), matchArgument2(), and stripIrrelevantConstVolatile().
Definition at line 1113 of file util.cpp.
References DString::at(), AUTO_TRACE, AUTO_TRACE_EXIT, DString::clear(), DString::find(), isId(), DString::left(), DString::length(), DString::mid(), DString::npos, stripIrrelevantString(), and DString::stripWhiteSpace().
Referenced by stripIrrelevantConstVolatile(), and stripIrrelevantString().
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 3989 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(), DocGroup::addDocs(), VHDLOutlineParser::checkInlineCode(), DocPara::handleCommand(), CommentScanner::parseCommentBlock(), and stripLeadingAndTrailingEmptyLines().
Definition at line 3962 of file util.cpp.
References DString::mid(), DString::npos, DString::rfind(), and stripPath().
Referenced by 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 3111 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 3688 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(), addDirPrefix(), 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 2496 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 3526 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 ) |
Returns a string representation of the template parameter list al. The lang parameter is used to determine the correct syntax for the template parameters. If includeDefaults is true then default values are included in the string representation.
Definition at line 905 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().
|
static |
Definition at line 4340 of file util.cpp.
References DString::data(), dstricmp(), DString::empty(), portable_iconv(), portable_iconv_close(), portable_iconv_open(), term, and transcodeCharacterBuffer().
Referenced by readInputFile(), and transcodeCharacterBuffer().
| void trimBaseClassScope | ( | const BaseClassList & | bcl, |
| DString & | s, | ||
| int | level = 0 ) |
Definition at line 1092 of file util.cpp.
References ClassDef::baseClasses(), DString::find(), DString::left(), DString::length(), Definition::name(), DString::npos, DString::right(), and trimBaseClassScope().
Referenced by trimBaseClassScope().
Definition at line 2777 of file util.cpp.
References DString::data(), DString::empty(), DString::length(), DString::reserve(), unescapeCharsInString(), and useCaseSenseNames().
Referenced by addDirPrefix(), and unescapeCharsInString().
Definition at line 4065 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 2681 of file util.cpp.
References Config_getEnum, Portable::fileSystemIsCaseSensitive(), and useCaseSenseNames().
Referenced by addDirPrefix(), checkAndOpenFile(), escapeCharsInString(), getEncoding(), readDir(), FileNameFn::searchKey(), unescapeCharsInString(), and useCaseSenseNames().
| void writeExamples | ( | OutputList & | ol, |
| const ExampleList & | list ) |
Definition at line 806 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 5360 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 778 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 755 of file util.cpp.
References end(), OutputList::parseText(), and writeMarkerList().
Referenced by MemberDefImpl::_writeReimplementedBy(), DefinitionImpl::_writeSourceRefList(), addDirPrefix(), RequirementManager::generatePage(), writeExamples(), ClassDefImpl::writeInheritanceGraph(), writeMarkerList(), writeMarkerList(), and DefinitionImpl::writeRequirementRefs().
| void writeTypeConstraints | ( | OutputList & | ol, |
| const Definition * | d, | ||
| const ArgumentList & | al ) |
Definition at line 4285 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(), addDirPrefix(), ClassDefImpl::writeDetailedDocumentationBody(), and writeTypeConstraints().
|
static |
Definition at line 381 of file util.cpp.
Referenced by removeRedundantWhiteSpace().
|
static |
Definition at line 425 of file util.cpp.
Referenced by removeRedundantWhiteSpace().
|
static |
Definition at line 4031 of file util.cpp.
Referenced by getLanguageFromFileName(), and updateLanguageMapping().
|
static |
Definition at line 4041 of file util.cpp.
Referenced by getLanguageFromCodeLang(), and updateLanguageMapping().
|
static |
Definition at line 1483 of file util.cpp.
Referenced by matchArgument2().
|
static |
Definition at line 2855 of file util.cpp.
Referenced by convertNameToFile().
|
static |
Definition at line 2857 of file util.cpp.
Referenced by convertNameToFile().
|
static |
Definition at line 2856 of file util.cpp.
Referenced by convertNameToFile().
|
static |
Definition at line 82 of file util.cpp.
Referenced by convertToHtml(), convertToId(), escapeCharsInString(), and replaceColorMarkers().
|
static |
Definition at line 384 of file util.cpp.
Referenced by removeRedundantWhiteSpace().
|
static |
Definition at line 383 of file util.cpp.
Referenced by removeRedundantWhiteSpace().
|
static |
Definition at line 382 of file util.cpp.
Referenced by removeRedundantWhiteSpace().
|
static |
Definition at line 5357 of file util.cpp.
Referenced by writeInlineGraph().
|
static |
Definition at line 5358 of file util.cpp.
Referenced by cleanupInlineGraphs(), and writeInlineGraph().