Doxygen XLinks
by
V: 2511R0
Website: doxygen
Loading...
Searching...
No Matches
styles.cpp
1//==================================================================================================
2// This implementation-file is part of DoxygenXLinks - A doxygen post-processor that allows to
3// define smarter <b>Doxygen</b>-links.
4//
5// \emoji :copyright: 2025-2026 A-Worx GmbH, Germany.
6// Published under \ref mainpage_license "Boost Software License".
7//==================================================================================================
8#include "styles.hpp"
9#include "target.hpp"
10#include "dxl.hpp"
12
13using namespace alib;
14using namespace std;
15
16namespace dxl {
17
18void Styles::Set( const Index::Node& node, bool hasDisplayText, bool isIndirect)
19{
20 const Target* target= node.Target();
21 size= 0;
22 isVerbal= hasDisplayText;
23
24 // el or elRef?
26
27 // docs
29 isVerbal= true;
31 if (hasDisplayText)
33 return;
34 }
35
36 // dir/file
37 if ( target->IsA(Target::Dir | Target::File) ) {
38 if(target->IsA(Target::Dir)) { Add(Styles::Dir); isDir = true;}
39 else { Add(Styles::File); isFile= true;}
41 if (hasDisplayText)
43 return;
44 }
45
46 // code entities
48 isCodeEntity= true;
50 switch ( target->Kind() ) {
51 case Target::Macro : Add(Styles::Macro ); break;
52 case Target::Typedef : Add(Styles::Typedef ); break;
53 case Target::Concept : Add(Styles::Concept ); break;
55 case Target::Struct : Add(Styles::Struct ); break;
56 case Target::Class : Add(Styles::Class ); break;
57 case Target::Union : Add(Styles::Union ); break;
60 case Target::Variable : Add(Styles::Var ); break;
61 case Target::Function : Add(Styles::Func ); break;
62 default: ALIB_ERROR("DXL/STYLES", "Unknown target kind") break;
63 }
65
66 if ( target->IsA(Target::RECORD) ) {
68 if(static_cast<const TGTRecord*>(target)->TemplateArgs) Add(Styles::Template);
69 if(static_cast<const TGTRecord*>(target)->SpecializationArgs) Add(Styles::TemplSpec);
70 }
71
73 Add( node.Parent().IsRoot() || node.Parent().IsA(Target::Namespace)
76
77 if ( isIndirect)
79
80 if (hasDisplayText)
82}
83
84
85} //namespace [dxl]
86
#define ALIB_ALLOW_SPARSE_ENUM_SWITCH
#define ALIB_ERROR(domain,...)
#define ALIB_POP_ALLOWANCE
const bool IsMainTagFile
Definition index.hpp:242
static constexpr alib::String EL
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:54
static constexpr alib::String Namespace
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:69
static constexpr alib::String Template
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:80
static constexpr alib::String Typedef
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:67
static constexpr alib::String TemplSpec
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:81
static constexpr alib::String NsMem
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:83
bool isFile
This set when a file is targeted by the XLink.
Definition styles.hpp:50
static constexpr alib::String Indirect
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:82
static constexpr alib::String Dir
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:62
static constexpr alib::String Macro
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:66
static constexpr alib::String EnumElem
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:74
static constexpr alib::String Var
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:75
static constexpr alib::String Struct
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:70
static constexpr alib::String Concept
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:68
static constexpr alib::String ELRef
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:55
static constexpr alib::String Enum
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:73
static constexpr alib::String Doc
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:57
static constexpr alib::String RecMem
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:84
static constexpr alib::String FileOrDir
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:78
static constexpr alib::String Union
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:72
static constexpr alib::String File
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:59
static constexpr alib::String Record
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:79
bool isDir
This set when a dir is targeted by the XLink.
Definition styles.hpp:47
bool isVerbal
This is set when a display text was given to the XLink.
Definition styles.hpp:41
int size
The number of styles in #".list".
Definition styles.hpp:38
void Set(const Index::Node &node, bool hasDisplayText, bool isIndirect)
Definition styles.cpp:18
void Add(const alib::String &style)
Definition styles.hpp:118
static constexpr alib::String Class
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:71
bool isCodeEntity
This set when a code entity is targeted by the XLink.
Definition styles.hpp:44
static constexpr alib::String WithDisp
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:85
static constexpr alib::String Func
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:76
static constexpr alib::String Code
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:64
bool IsA(Kinds aKind) const
Definition target.hpp:240
Kinds Kind() const
Definition target.hpp:235
@ Struct
Denotes a struct.
Definition target.hpp:37
@ Function
Denotes a namespace- or member-function.
Definition target.hpp:46
@ Variable
Denotes a namespace- or member-variable.
Definition target.hpp:45
@ Union
Denotes a union.
Definition target.hpp:39
@ Class
Denotes a class.
Definition target.hpp:38
@ Typedef
Denotes a type definition.
Definition target.hpp:44
@ File
Denotes a source file.
Definition target.hpp:31
@ EnumElement
Denotes an enumeration element.
Definition target.hpp:48
@ Concept
Denotes a C++20 concept.
Definition target.hpp:40
@ Macro
Denotes a preprocessor definition.
Definition target.hpp:43
@ Dir
Denotes a source folder.
Definition target.hpp:30
@ Page
Denotes a page.
Definition target.hpp:32
@ Group
Denotes a group.
Definition target.hpp:33
@ Enumeration
Denotes an enumeration.
Definition target.hpp:47
@ Namespace
Denotes a namespace.
Definition target.hpp:36
@ DocAnchor
Denotes a preprocessor definition.
Definition target.hpp:34
@ RECORD
Mask to identify records types.
Definition target.hpp:67
todox
Definition doxyfile.cpp:20
The cursor type of the #"StringTree".
Definition index.hpp:105
const Target * Target() const
Definition index.hpp:176
Index & Index() const
Definition index.hpp:173
bool IsA(Target::Kinds kind) const
Definition index.hpp:197
XLink target information for C++ structs, classes and unions.
Definition target.hpp:343