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"
11
12using namespace alib;
13using namespace std;
14
15namespace dxl {
16
17void Styles::Set( const Index::Node& node, bool hasDisplayText, bool isIndirect) {
18 const Target* target= node.Target();
19 size= 0;
20 isVerbal= hasDisplayText;
21
22 // el or elRef?
24
25 // docs
27 isVerbal= true;
29 if (hasDisplayText)
31 return;
32 }
33
34 // dir/file
35 if ( target->IsA(Target::Dir | Target::File) ) {
36 if(target->IsA(Target::Dir)) { Add(Styles::Dir); isDir = true;}
37 else { Add(Styles::File); isFile= true;}
39 if (hasDisplayText)
41 return;
42 }
43
44 // code entities
46 isCodeEntity= true;
48 switch ( target->Kind() ) {
49 case Target::Macro : Add(Styles::Macro ); break;
50 case Target::Typedef : Add(Styles::Typedef ); break;
51 case Target::Concept : Add(Styles::Concept ); break;
53 case Target::Struct : Add(Styles::Struct ); break;
54 case Target::Class : Add(Styles::Class ); break;
55 case Target::Union : Add(Styles::Union ); break;
58 case Target::Variable : Add(Styles::Var ); break;
59 case Target::Function : Add(Styles::Func ); break;
60 default: ALIB_ERROR("DXL/STYLES", "Unknown target kind") break;
61 }
63
64 if ( target->IsA(Target::RECORD) ) {
66 if(static_cast<const TGTRecord*>(target)->TemplateArgs) Add(Styles::Template);
67 if(static_cast<const TGTRecord*>(target)->SpecializationArgs) Add(Styles::TemplSpec);
68 }
69
71 Add( node.Parent().IsRoot() || node.Parent().IsA(Target::Namespace)
74
75 if ( isIndirect)
77
78 if (hasDisplayText)
80}
81
82
83} //namespace [dxl]
#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:70
static constexpr alib::String Template
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:81
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:82
static constexpr alib::String NsMem
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:84
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:83
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:75
static constexpr alib::String Var
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:76
static constexpr alib::String Struct
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:71
static constexpr alib::String Concept
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:69
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:74
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:85
static constexpr alib::String FileOrDir
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:79
static constexpr alib::String Union
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:73
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:80
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:17
void Add(const alib::String &style)
Definition styles.hpp:119
static constexpr alib::String Class
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:72
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:86
static constexpr alib::String Func
CSS class name. See user manual chapter #"dxl_styling".
Definition styles.hpp:77
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:241
Kinds Kind() const
Definition target.hpp:236
@ Struct
Denotes a struct.
Definition target.hpp:37
@ Function
Denotes a namespace- or member-function.
Definition target.hpp:47
@ Variable
Denotes a namespace- or member-variable.
Definition target.hpp:46
@ Union
Denotes a union.
Definition target.hpp:39
@ Class
Denotes a class.
Definition target.hpp:38
@ Typedef
Denotes a type definition.
Definition target.hpp:45
@ File
Denotes a source file.
Definition target.hpp:31
@ EnumElement
Denotes an enumeration element.
Definition target.hpp:49
@ Concept
Denotes a C++20 concept.
Definition target.hpp:40
@ Macro
Denotes a preprocessor definition.
Definition target.hpp:44
@ 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:48
@ 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:68
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:350