Doxygen
Loading...
Searching...
No Matches
docoptions.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2025 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16#ifndef DOCOPTIONS_H
17#define DOCOPTIONS_H
18
19#include "config.h"
20#include "dstring.h"
21
22/// @brief Helper class to pass options when calling OutputList::generateDoc()
24{
25 public:
26 // === getters for optional params
27 bool indexWords() const { return m_indexWords; }
28 bool isExample() const { return m_isExample; }
29 DString exampleName() const { return m_exampleName; }
30 bool singleLine() const { return m_singleLine; }
31 bool linkFromIndex() const { return m_linkFromIndex; }
32 bool markdownSupport() const { return m_markdownSupport; }
33 bool autolinkSupport() const { return m_autolinkSupport; }
34 int sectionLevel() const { return m_sectionLevel; }
35
36 // === setters for optional params
37
38 /// Indicates whether or not words should be put in the search index.
40 { m_indexWords=b; return *this; }
41
42 /// Associate this comment block with a given example
44 { m_isExample=!name.empty(); m_exampleName = name; return *this; }
45
46 /// Select if this is for a single line, so without starting a new paragraph at the end.
48 { m_singleLine=b; return *this; }
49
50 /// Select if the documentation is generated from an
51 /// index page. In this case context is not used to determine
52 /// the relative path when making a link.
54 { m_linkFromIndex=b; return *this; }
55
56 /// Select if the input needs to take markdown markup into account.
58 { m_markdownSupport=b; return *this; }
59
60 /// Select if the input need to perform auto linking of words
62 { m_autolinkSupport=b; return *this; }
63
64 /// Restrict output up to the given section level
66 { m_sectionLevel=l; return *this; }
67
68 private:
69 // optional params with defaults
70 bool m_indexWords = false;
71 bool m_isExample = false;
73 bool m_singleLine = false;
74 bool m_linkFromIndex = false;
75 bool m_markdownSupport = Config_getBool(MARKDOWN_SUPPORT);
76 bool m_autolinkSupport = Config_getBool(AUTOLINK_SUPPORT);
78};
79
80#endif
81
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:88
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:152
#define Config_getBool(name)
Definition config.h:33
Helper class to pass options when calling OutputList::generateDoc().
Definition docoptions.h:24
bool m_isExample
Definition docoptions.h:71
bool m_autolinkSupport
Definition docoptions.h:76
DocOptions & setLinkFromIndex(bool b)
Select if the documentation is generated from an index page.
Definition docoptions.h:53
DocOptions & setSingleLine(bool b)
Select if this is for a single line, so without starting a new paragraph at the end.
Definition docoptions.h:47
DocOptions & setMarkdownSupport(bool b)
Select if the input needs to take markdown markup into account.
Definition docoptions.h:57
bool autolinkSupport() const
Definition docoptions.h:33
DocOptions & setExample(const DString &name)
Associate this comment block with a given example.
Definition docoptions.h:43
bool m_indexWords
Definition docoptions.h:70
DString exampleName() const
Definition docoptions.h:29
bool linkFromIndex() const
Definition docoptions.h:31
bool markdownSupport() const
Definition docoptions.h:32
int sectionLevel() const
Definition docoptions.h:34
DocOptions & setSectionLevel(int l)
Restrict output up to the given section level.
Definition docoptions.h:65
bool m_linkFromIndex
Definition docoptions.h:74
DocOptions & setAutolinkSupport(bool b)
Select if the input need to perform auto linking of words.
Definition docoptions.h:61
bool m_markdownSupport
Definition docoptions.h:75
DocOptions & setIndexWords(bool b)
Indicates whether or not words should be put in the search index.
Definition docoptions.h:39
bool indexWords() const
Definition docoptions.h:27
bool singleLine() const
Definition docoptions.h:30
bool m_singleLine
Definition docoptions.h:73
int m_sectionLevel
Definition docoptions.h:77
DString m_exampleName
Definition docoptions.h:72
bool isExample() const
Definition docoptions.h:28