The AnchorGenerator
Class Reference
Singleton class used to generate anchors for Markdown headers. More...
Declaration
Included Headers
Private Constructors Index
AnchorGenerator () | |
Private Destructor Index
~AnchorGenerator () | |
Public Member Functions Index
std::string | generate (const std::string &title) |
generates an anchor for a section with title. More... | |
bool | isGenerated (const std::string &anchor) const |
Returns true iff anchor is one of the generated anchors. More... | |
int | reserve (const std::string &anchor) |
Reserves a non-generated anchor. More... | |
Private Member Attributes Index
std::unique_ptr< Private > | p |
Public Static Functions Index
static AnchorGenerator & | instance () |
Returns the singleton instance. More... | |
static bool | looksGenerated (const std::string &anchor) |
Returns true if anchor is a potentially generated anchor. More... | |
static std::string | addPrefixIfNeeded (const std::string &anchor) |
Description
Singleton class used to generate anchors for Markdown headers.
Definition at line 25 of file anchor.h.
Private Constructors
AnchorGenerator()
|
Declaration at line 50 of file anchor.h, definition at line 34 of file anchor.cpp.
Reference p.
Referenced by instance and ~AnchorGenerator.
Private Destructor
~AnchorGenerator()
|
Definition at line 51 of file anchor.h.
Reference AnchorGenerator.
Public Member Functions
generate()
|
generates an anchor for a section with title.
Returns the anchor.
Declaration at line 34 of file anchor.h, definition at line 59 of file anchor.cpp.
References addPrefixIfNeeded, Config_getEnum, convertUTF8ToLower, getUnicodeForUTF8CharAt, getUTF8CharAt, getUTF8CharNumBytes, isUTF8PunctuationCharacter, p, prefix and qisspace.
Referenced by Markdown::Private::extractTitleId and MarkdownOutlineParser::parseInput.
isGenerated()
|
Returns true iff anchor is one of the generated anchors.
Declaration at line 37 of file anchor.h, definition at line 128 of file anchor.cpp.
Reference p.
reserve()
|
Reserves a non-generated anchor.
Declaration at line 40 of file anchor.h, definition at line 134 of file anchor.cpp.
Reference p.
Private Member Attributes
p
|
Definition at line 54 of file anchor.h.
Referenced by AnchorGenerator, generate, isGenerated and reserve.
Public Static Functions
addPrefixIfNeeded()
| static |
Declaration at line 47 of file anchor.h, definition at line 46 of file anchor.cpp.
References Config_getEnum and prefix.
Referenced by generate and Markdown::Private::processLink.
instance()
| static |
Returns the singleton instance.
Declaration at line 29 of file anchor.h, definition at line 38 of file anchor.cpp.
Reference AnchorGenerator.
Referenced by Markdown::Private::extractTitleId, DocRoot::parse, DocSection::parse, MarkdownOutlineParser::parseInput and DefinitionImpl::writeDocAnchorsToTagFile.
looksGenerated()
| static |
Returns true if anchor is a potentially generated anchor.
Note this is a much weaker check than isGenerated() and may not always work.
Declaration at line 45 of file anchor.h, definition at line 140 of file anchor.cpp.
References Config_getEnum and QCString::startsWith.
Referenced by anonymous{tagreader.cpp}::TagFileParser::endDocAnchor.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus by Doxygen 1.14.0.