159 bool stripCodeComments,
227 if (parserName.
empty() || extension.
empty())
return false;
229 const auto &parserIt =
m_parsers.find(parserName.
str());
230 if (parserIt ==
m_parsers.end())
return false;
247 return getParsers(extension).outlineParserFactory();
262 return getParsers(extension).codeParserFactory;
278 if (ext.
empty()) ext=
".no_extension";
Clang parser object for a single translation unit, which consists of a source file and the directly o...
Abstract interface for code parsers.
virtual void resetCodeParserState()=0
Resets the state of the code parser.
virtual void parseCode(OutputCodeList &codeOutList, const DString &scopeName, const DString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
size_t find(char c, size_t pos=0) const
DString left(size_t len) const
const std::string & str() const
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
size_t length() const
Returns the length of the string, not counting the 0-terminator.
The common base class of all entity definitions found in the sources.
Represents an unstructured piece of information, about an entity found in the sources.
A model of a file symbol.
A model of a class/file/namespace member symbol.
Abstract interface for outline parsers.
virtual bool needsPreprocessing(const DString &extension) const =0
Returns true if the language identified by extension needs the C preprocessor to be run before feed t...
virtual void parseInput(const DString &fileName, const char *fileBuf, const std::shared_ptr< Entry > &root, ClangTUParser *clangParser)=0
Parses a single input file with the goal to build an Entry tree.
virtual void parsePrototype(const DString &text)=0
Callback function called by the comment block scanner.
Class representing a list of different code generators.
std::map< std::string, ParserPair > m_parsers
DString getParserName(const DString &extension)
Gets the name of the parser associated with given extension.
std::unique_ptr< CodeParserInterface > getCodeParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
CodeParserFactory & getCodeParserFactory(const DString &extension)
Get the factory for create code parser objects with a given extension.
ParserPair m_defaultParsers
void registerParser(const DString &name, const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory)
Registers an additional parser.
ParserManager(const OutlineParserFactory &outlineParserFactory, const CodeParserFactory &codeParserFactory)
Create the parser manager.
ParserPair & getParsers(const DString &extension)
std::map< std::string, ParserPair & > m_extensions
std::unique_ptr< OutlineParserInterface > getOutlineParser(const DString &extension)
Gets the interface to the parser associated with a given extension.
bool registerExtension(const DString &extension, const DString &parserName)
Registers a file extension with a parser with name parserName.
#define ABSTRACT_BASE_CLASS(cls)
Macro to implement rule of 5 for an abstract base class.
std::function< std::unique_ptr< CodeParserInterface >()> CodeParserFactory
std::function< std::unique_ptr< OutlineParserInterface >()> OutlineParserFactory
Options to configure the code parser.
CodeParserOptions & setSearchCtx(const Definition *d)
CodeParserOptions & setStartLine(int lineNr)
const Definition * searchCtx() const
DString exampleName() const
const FileDef * fileDef() const
CodeParserOptions & setInlineFragment(bool enable)
const MemberDef * memberDef() const
CodeParserOptions & setCollectXRefs(bool enable)
bool showLineNumbers() const
bool inlineFragment() const
CodeParserOptions & setEndLine(int lineNr)
const MemberDef * m_memberDef
const Definition * m_searchCtx
CodeParserOptions & setMemberDef(const MemberDef *md)
bool collectXRefs() const
const FileDef * m_fileDef
CodeParserOptions & setExample(bool isExample, const DString &name)
Associate this comment block with a given example.
CodeParserOptions & setShowLineNumbers(bool enable)
CodeParserOptions & setFileDef(const FileDef *fd)
CodeParserFactory codeParserFactory
OutlineParserFactory outlineParserFactory
ParserPair(OutlineParserFactory opf, const CodeParserFactory &cpf, const DString &pn)
This file contains a number of basic enums and types.