Detailed description of fields for C++ members
Contents
- Common fields
- Alias-specific fields
- Class- or struct-specific fields
- Enum-specific fields
- Enumvalue-specific fields
- Function-specific fields
- Function-specific fields, if class or struct member
- Macro-specific fields
- Namespace-specific fields
- Union-specific fields
- Variable-specific fields
- Variable-specific fields, if class, struct or union member
- variable-specific fields, if bitfield
- Template-specific fields
- The type dictionary
Each member is a dictionary with the following fields:
- “id”: unique identifier
- “name”: member name
- “brief”: brief description (see “brief” and “doc”)
- “doc”: full documentation (see “brief” and “doc”)
- “sections”: (ID, title, level) for sections in “doc”
- “anchors”: IDs of anchors in “doc”
- “member_type”: member type
- “parent”: ID of the parent member
- “relates”: ID of a class/struct that the member relates to
- “header”: ID of the header file where the member is declared
- “group”: group ID or name
- “deprecated”:
true
orfalse
depending on if the member has a[[deprecated]]
attribute
Additionally, the dictionary will contain other fields that depend on the “member_type” value:
- Alias-specific fields
- Class- or struct-specific fields
- Enum-specific fields
- Enumvalue-specific fields
- Function-specific fields
- Function-specific fields, if class or struct member
- Macro-specific fields
- Namespace-specific fields
- Union-specific fields
- Variable-specific fields
- Variable-specific fields, if class, struct or union member
- variable-specific fields, if bitfield
Common fields
“id”
This is a unique identifier. When the member is referenced, a link to its ID is used.
Member IDs are not unrecognizable hash codes as Doxygen does it, but simply created from the fully qualified name and parameters, guaranteeing uniqueness. For example:
int ns::foo()
⇒"ns-foo"
int ns::foo(int, double)
⇒"ns-foo-int--double-"
int ns::foo(int&, double const&)
⇒"ns-foo-int-L-double-CL"
class ns::bar
⇒"ns-bar"
ns::bar::bar(float*)
⇒"ns-bar-bar-float-P"
“name”
Name of the member. The fully qualified name can be obtained by iterating through the “parent” links and prepending their names.
“member_type”
The type of the member, one of:
"alias"
"class"
"enum"
"enumvalue"
"function"
"macro"
"namespace"
"struct"
"union"
"variable"
“relates”
ID of a class/struct that the member relates to. The class/struct will list this member in its “related” list. This value can only be set in functions, variables, enums, aliases and macros.
“header”
ID of the header file where the member is declared. If the declaration appears in multiple files, the first one it was encountered in will be used.
“group”
For namespace members, ID of the group that this member belongs to. If an empty string, the member doesn’t belong to any groups.
For class or struct members, the header text for the group. Can be an empty string if no grouping is used.
For members of type "enumvalue"
(enum members), the group is always the empty string.
Alias-specific fields
If the member is an alias (using
or typedef
declaration), then it additionally has the
following fields:
- “templated”:
true
if this is an alias template. - “type”: the type being aliased, see The type dictionary.
- “oldfashioned”:
true
if this is atypedef
declaration,false
if it is ausing
declaration.
Class- or struct-specific fields
If the member is a class or struct, it additionally has the following fields:
- “templated”:
true
if this is a class template - “abstract”:
true
if this is an abstract class (has a pure virtual member function) - “bases”: a list of base classes
- “derived”: a list of strings, the IDs of derived classes
- “members”: a list of dictionaries for the child members
- “related”: a list of strings, the IDs of related members
The “members” list contains dictionaries of members. These members can be of type alias, enum, function, variable, class, struct or union.
“bases”
A list of dictionaries listing the base classes. It contains the following fields:
- “typename”: the fully qualified name of the base class.
- “id”: ID of the type, if declared in the project being documented.
- “access”: set to a string
"public"
,"protected"
or"private"
.
“related”
A list of strings, the IDs of related members. These are not child members, but are related to the class and their documentation could be shown together with that of the class’ members.
The members listed here will have the ID of this class as their “relates” field.
Enum-specific fields
If the member is an enum, it additionally has the following fields:
- “scoped”:
true
if scoped enum (declared asenum class
), orfalse
if unscoped (a plainenum
) - “type”: the type underlying the enumerator (
"int"
,"short"
,"char"
, etc.) - “members”: member dictionaries, these members should all be of type
"enumvalue
Enumvalue-specific fields
If the member is an enumvalue (a child of an enum), it additionally has the following field:
- “value”: the integer value of the enumerator constant
Function-specific fields
If the member is a function, it additionally has the following fields:
- “templated”:
true
if this is a function template - “operator”:
true
if the function is an operator - “constexpr”:
true
if this is aconstexpr
function - “noexcept”:
true
if the function is markednoexcept
- “return_type”: the function’s return type, see The type dictionary
- “arguments”: the function’s arguments
For constructors, destructors and conversion functions (see the field “method_type”), “return_type” is empty.
“arguments”
A list of dictionaries listing the input arguments. It contains the standard “type” fields (see The type dictionary) as well as the following fields:
- “name”: the name of the argument
- “default”: the default value for the argument (as a string)
Function-specific fields, if class or struct member
If the function is a class or struct member, it additionally has the following fields:
- “static”:
true
orfalse
depending on if the function is declared static or not - “virtual”:
true
orfalse
depending on if the function is declared virtual or not - “pure_virtual”:
true
orfalse
depending on if the function is pure virtual or not - “final”:
true
orfalse
depending on if the function is markedfinal
- “override”:
true
orfalse
depending on if the function is markedoverride
- “const”:
true
orfalse
depending on if the function is declared const or not - “access”: set to a string
"public"
,"protected"
or"private"
- “method_type”: set to a string
"method"
,"conversionfunction"
,"assignmentoperator"
,"operator"
,"constructor"
or"destructor"
- “explicit”:
true
orfalse
depending on if the function is markedexplicit
(exists only if “method_type” is either"conversionfunction"
or"constructor"
)
“method_type” is "operator"
or "assignmentoperator"
if “operator” is true
.
Macro-specific fields
If the member is a macro, it additionally has the following field:
- “macro_params”: list of strings containing macro parameters, if given
For a macro, the "parent"
field is always the empty string.
Namespace-specific fields
If the member is a namespace, it additionally has the following fields:
- “inline”:
true
for inline namespaces - “members”: a list of dictionaries for the child members
Child members can be anything except macros.
Union-specific fields
If the member is a union, it additionally has the following fields:
- “templated”:
true
if this is a union template. - “members”: a list of dictionaries for the child members
- “related”: a list of strings, the IDs of related members
The “members” list contains dictionaries of members. These members can be of type alias, enum, function, variable, class, struct or union.
Variable-specific fields
If the member is a variable, it additionally has the following fields:
- “type”: the variable’s type, see The type dictionary
- “static”:
true
orfalse
depending on if the variable is declaredstatic
or not - “constexpr”:
true
if this is aconstexpr
value - “value”: the value assigned to the variable when first declared (as a string); this field is not present if no value is assigned
Variable-specific fields, if class, struct or union member
If the variable is a class or struct or union member, it additionally has the following fields:
- “mutable”:
true
orfalse
depending on if the member is declaredmutable
or not - “access”: set to a string
"public"
,"protected"
or"private"
variable-specific fields, if bitfield
If the variable is a bitfield, it additionally has the following field:
- “width”: The bitfield width (an integer)
Template-specific fields
For members that are a class template, struct template, union template, function template or alias template, the following field is additionally present:
“template_parameters”
A list of dictionaries, one for each template parameter. Each of these dictionaries contains the following fields:
"name"
: name of template parameter"type"
: type of template parameter: the string"type"
, or a dictionary encoding the type in case of a non-type template parameter, see The type dictionary"default"
: a type dictionary for type parameters, a string for non-type parameters, ornull
(translates toNone
in Python) if no default is given
For example, for template<typename A>
, “type” will be equal to "type"
, whereas
for template<int A>
, “type” will be a dictionary {"typename": "int", "id": "", "qualifiers": ""}
.
The type dictionary
Types are encoded as a dictionary with the following fields:
- “typename”: name of the type
- “id”: ID of the type, if declared in the project being documented
- “qualifiers”: qualifiers (as a string)
The type could be rendered in Markdown as follows: [<typename>](#<id>) <qualifiers>
.
If the type represents a function prototype, “typename” is a full representation, but the dictionary will additionally contain the following fields:
- “retval”: type dictionary for the function’s return value
- “arguments”: list of type dictionaries for the function arguments