Debian Codegraph @

documentation/source/struct.rst

raw
1
2 .. This is more or less the class documentation with s/class/struct/g
3
4 .. _struct-example:
5
6 doxygenstruct Directive
7 =======================
8
9 This directive generates the appropriate output for a single struct. It takes the
10 standard ``project``, ``path``, ``outline`` and ``no-link`` options and
11 additionally the ``members``, ``protected-members``, ``private-members``,
12 ``undoc-members``, ``membergroups`` and ``members-only`` options.
13
14 ``members``
15 Designed to behavior in a similar manner to the ``members`` option for the
16 ``autostruct`` directive that comes with the Sphinx ``autodoc`` extension.
17
18 If you do not specify this option you will not get any information about the
19 struct members, just the general struct documentation. If you provide it
20 without arguments, then Breathe adds all the public members and their
21 documentation. If you specify it with **comma separated** arguments, then
22 Breathe will treat the arguments as names of members and provide
23 documentation for only those members that have been named.
24
25 ``protected-members``
26 If specified, the protected members of the struct will be displayed.
27
28 ``private-members``
29 If specified, the private members of the struct will be displayed.
30
31 ``undoc-members``
32 If specified, the undocumented members of the struct will be displayed.
33
34 ``membergroups``
35 If specified, only the groups in a space-delimited list following this
36 directive will be displayed.
37
38 ``members-only``
39 This will allow to show only the members, not the struct information. Child
40 classes and structs are also not shown.
41
42 If you would like to always specify some combination of ``members``,
43 ``protected-members``, ``private-members`` and ``undoc-members`` then you can
44 use the :ref:`breathe_default_members <breathe-default-members>` configuration
45 variable to set it in the ``conf.py``.
46
47
48
49 Basic Example
50 -------------
51
52 .. cpp:namespace:: @ex_struct_basic
53
54 This displays the struct documentation without any members:
55
56 .. code-block:: rst
57
58 .. doxygenstruct:: StructTest
59 :project: struct
60
61 It produces this output:
62
63 .. doxygenstruct:: StructTest
64 :project: struct
65
66
67 Members Example
68 ---------------
69
70 .. cpp:namespace:: @ex_struct_members
71
72 This directive call will display the struct documentation with all the public
73 members:
74
75 .. code-block:: rst
76
77 .. doxygenstruct:: StructTest
78 :project: struct
79 :members:
80
81 It produces this output:
82
83 .. doxygenstruct:: StructTest
84 :project: struct
85 :members:
86 :no-link:
87
88 Specific Members Example
89 ------------------------
90
91 .. cpp:namespace:: @ex_struct_members_specific
92
93 This displays the struct documentation with only the members listed in the
94 ``:members:`` option:
95
96 .. code-block:: rst
97
98 .. doxygenstruct:: StructTest
99 :project: struct
100 :members: publicFunction, protectedFunction
101
102 It produces this output:
103
104 .. doxygenstruct:: StructTest
105 :project: struct
106 :members: publicFunction, protectedFunction
107 :no-link:
108
109 Protected Members
110 -----------------
111
112 .. cpp:namespace:: @ex_struct_members_protected
113
114 This displays only the protected members of the struct. Normally this is combined
115 with the ``:members:`` option to show the public members as well.
116
117 .. code-block:: rst
118
119 .. doxygenstruct:: StructTest
120 :project: struct
121 :protected-members:
122
123 It produces this output:
124
125 .. doxygenstruct:: StructTest
126 :project: struct
127 :protected-members:
128 :no-link:
129
130 Private Members
131 ---------------
132
133 .. cpp:namespace:: @ex_struct_members_private
134
135 This displays only the private members of the struct. Normally this is combined
136 with the ``:members:`` option to show the public members as well.
137
138 .. code-block:: rst
139
140 .. doxygenstruct:: StructTest
141 :project: struct
142 :private-members:
143
144 It produces this output:
145
146 .. doxygenstruct:: StructTest
147 :project: struct
148 :private-members:
149 :no-link:
150
151 Undocumented Members
152 --------------------
153
154 .. cpp:namespace:: @ex_struct_members_undocumented
155
156 This displays the undocumented members of the struct which are suppressed by
157 default. Undocumented public members are only shown if the ``:members:`` option
158 is also used. The same goes for the undocumented private members and the
159 ``private-members`` option.
160
161 .. code-block:: rst
162
163 .. doxygenstruct:: StructTest
164 :project: struct
165 :members:
166 :private-members:
167 :undoc-members:
168
169 It produces this output:
170
171 .. doxygenstruct:: StructTest
172 :project: struct
173 :members:
174 :private-members:
175 :undoc-members:
176 :no-link:
177
178 .. note::
179
180 Undocumented internal classes are still not shown in the output due to an
181 implementation issue. Please post an issue on github if you would like this
182 resolved.
183
184
185 Membergroups
186 ------------
187
188 .. cpp:namespace:: @ex_struct_membersgroups
189
190 Lists one or more names member groups.
191
192 See the :ref:`doxygenclass documentation <class-example-membergroups>`.
193
194
195 Members-only
196 ------------
197
198 See the :ref:`doxygenclass documentation <class-example-membersonly>`.
199
200
201 Outline Example
202 ---------------
203
204 .. cpp:namespace:: @ex_struct_outline
205
206 This displays only the names of the struct members and not their
207 documentation. The ``:members:`` and ``:private-members:`` options determine
208 which members are displayed.
209
210 .. code-block:: rst
211
212 .. doxygenstruct:: StructTest
213 :project: struct
214 :members:
215 :outline:
216
217 It produces this output:
218
219 .. doxygenstruct:: StructTest
220 :project: struct
221 :members:
222 :outline:
223 :no-link:
224
225 Failing Example
226 ---------------
227
228 .. cpp:namespace:: @ex_struct_failing
229
230 This intentionally fails:
231
232 .. code-block:: rst
233
234 .. doxygenstruct:: made_up_struct
235 :project: struct
236 :members:
237
238 It produces the following warning message:
239
240 .. warning::
241 doxygenstruct: Cannot find struct "made_up_struct" in doxygen xml
242 output for project “struct” from directory: ../../examples/doxygen/struct/xml/