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