1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
#include <iostream>
/// A sample namespace
///
/// This is an extended
/// description of this
/// sample namespace.
///
/// ```cpp
/// std::cout << "Example code" << std::endl;
/// ```
namespace sample_namespace {
/// A sample static variable
///
/// This is an extended
/// description of this
/// static variable.
static int VARIABLE = 42;
/// A nested namespace
///
/// This is an extended
/// description of this
/// nested namespace.
namespace nested_namespace {
}
}
/// A sample class
///
/// This is an extended
/// description of this
/// sample class.
class Sample {
public:
/// \brief A public type
///
/// This is an extended description of this typedef.
using Blabla = int;
/// A sample inner class.
///
/// This is an extended description of this sample inner class.
///
/// We have a reference to the class Sample.
///
/// Also a [link](#bla)
///
/// And inline code:
///
/// ```cpp
/// auto a = int{};
/// ```
class InnerClass {
/// A sample attribute.
///
/// This is an extended description of this sample attribute,
void* sample_attribute;
};
/// A sample inner struct.
///
/// This is an extended description of this sample inner struct.
struct InnerStruct {
/// A sample attribute.
///
/// This is an extended description of this sample attribute.
void* sample_attribute;
};
/// A sample inner struct.
///
/// This is an extended description of this sample inner struct.
enum InnerEnum {
/// A sample variant.
///
/// This is an extended description of this sample variant,
SAMPLE_VARIANT1,
/// Another sample variant.
///
/// This is an extended description of this sample variant,
SAMPLE_VARIANT2,
/// Another other sample variant.
///
/// This is an extended description of this sample variant,
SAMPLE_VARIANT3,
};
/// A sample method.
///
/// This is an extended description of this sample method.
///
/// # Parameters
///
/// - `param1` is an input parameter
/// - `param2` is an input parameter
/// - `param3` is an input parameter
///
/// # Preconditions
///
/// - A precondition.
///
/// # Preconditions
///
/// - A postcondition.
int sample_method(char param1, std::string param2) const;
/// A sample static function.
///
/// This is an extended description of this sample static function.
static int sample_static_func(char param1, std::string param2);
protected:
/// A sample protected method.
///
/// This is an extended description of this sample protected method.
int sample_protected_method(char param1, std::string param2) const;
private:
/// A sample attribute.
///
/// This is an extended description of this sample attribute,
void* sample_attribute1;
/// Another sample attribute.
///
/// This is an extended description of this sample attribute,
InnerClass sample_attribute2;
/// Another other sample attribute.
///
/// This is an extended description of this sample attribute,
InnerStruct sample_attribute3;
/// Another other other sample attribute.
///
/// This is an extended description of this sample attribute,
InnerEnum sample_attribute4;
};
/// A sample function.
///
/// This is an extended description of this sample function.
///
/// # Parameters
///
/// - `param1` is an input parameter
/// - `param2` is an input parameter
/// - `param3` is an input parameter
///
/// # Preconditions
///
/// - A precondition.
///
/// # Preconditions
///
/// - A postcondition.
int sample_function(char param1, std::string param2, int hello_world) {
std::cout << helloworld << std::endl;
}
/// Another sample function.
///
/// This is an extended description of this sample function.
///
/// # Preconditions
///
/// - A precondition.
///
/// # Preconditions
///
/// - A postcondition.
int another_sample_function(
/// Documentation of param1
char param1,
/// Documentation of param2
std::string param2,
/// Documentation of hello_world
int hello_world
) {
std::cout << helloworld << std::endl;
}
int main(int argc, char** argv) {
std::cout << "Hello World" << std::endl;
std::cout << arga << std::endl;
}
int add(float a, float b) { return a + b; }
template <typename T> struct A { typedef T::U dependent; };
struct Integer { int i; }; Integer i = { i: 0 };
|