Doxygen
|
Singleton class used to generate anchors for Markdown headers. More...
#include <src/anchor.h>
Classes | |
struct | Private |
Public Member Functions | |
std::string | generate (const std::string &title) |
generates an anchor for a section with title. | |
bool | isGenerated (const std::string &anchor) const |
Returns true iff anchor is one of the generated anchors. | |
int | reserve (const std::string &anchor) |
Reserves a non-generated anchor. | |
Static Public Member Functions | |
static AnchorGenerator & | instance () |
Returns the singleton instance. | |
static bool | looksGenerated (const std::string &anchor) |
Returns true if anchor is a potentially generated anchor. | |
static std::string | addPrefixIfNeeded (const std::string &anchor) |
Private Member Functions | |
AnchorGenerator () | |
~AnchorGenerator () | |
Private Attributes | |
std::unique_ptr< Private > | p |
Singleton class used to generate anchors for Markdown headers.
|
private |
Definition at line 34 of file anchor.cpp.
References p.
Referenced by instance(), and ~AnchorGenerator().
|
privatedefault |
References AnchorGenerator().
|
static |
Definition at line 46 of file anchor.cpp.
References Config_getEnum, and prefix.
Referenced by generate(), and Markdown::Private::processLink().
std::string AnchorGenerator::generate | ( | const std::string & | title | ) |
generates an anchor for a section with title.
Returns the anchor.
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().
|
static |
Returns the singleton instance.
Definition at line 38 of file anchor.cpp.
References AnchorGenerator().
Referenced by Markdown::Private::extractTitleId(), DocRoot::parse(), DocSection::parse(), MarkdownOutlineParser::parseInput(), and DefinitionImpl::writeDocAnchorsToTagFile().
bool AnchorGenerator::isGenerated | ( | const std::string & | anchor | ) | const |
Returns true iff anchor is one of the generated anchors.
Definition at line 128 of file anchor.cpp.
References p.
Referenced by DefinitionImpl::writeDocAnchorsToTagFile().
|
static |
Returns true if anchor is a potentially generated anchor.
Note this is a much weaker check than isGenerated() and may not always work.
Definition at line 140 of file anchor.cpp.
References Config_getEnum.
Referenced by anonymous_namespace{tagreader.cpp}::TagFileParser::endDocAnchor().
int AnchorGenerator::reserve | ( | const std::string & | anchor | ) |
|
private |
Definition at line 54 of file anchor.h.
Referenced by AnchorGenerator(), generate(), isGenerated(), and reserve().