Skip to main content

The dotnode.cpp File Reference

Included Headers

#include "dotnode.h" #include "classdef.h" #include "config.h" #include "memberlist.h" #include "membergroup.h" #include "language.h" #include "doxygen.h" #include "util.h" #include "textstream.h"

Classes Index

structEdgeProperties

Helper struct holding the properties of a edge in a dot graph. More...

Functions Index

QCStringescapeTooltip (const QCString &tooltip)
static voidwriteBoxMemberList (TextStream &t, char prot, const MemberList *ml, const ClassDef *scope, bool &lineWritten, bool isStatic=FALSE, const StringUnorderedSet *skipNames=nullptr)
static QCStringstripProtectionPrefix (const QCString &s)

Variables Index

static const char *normalEdgeColorMap[] = ...
static const char *normalArrowStyleMap[] = ...
static const char *normalEdgeStyleMap[] = ...
static const char *umlEdgeColorMap[] = ...
static const char *umlArrowStyleMap[] = ...
static const char *umlEdgeStyleMap[] = ...
static EdgePropertiesnormalEdgeProps = ...
static EdgePropertiesumlEdgeProps = ...

Macro Definitions Index

#defineDEBUG_RENUMBERING   0

Functions

escapeTooltip()

QCString escapeTooltip (const QCString & tooltip)

Definition at line 99 of file dotnode.cpp.

100{
101 if (tooltip.isEmpty()) return tooltip;
102 QCString result;
103 const char *p=tooltip.data();
104 char c = 0;
105 while ((c=*p++))
106 {
107 switch(c)
108 {
109 case '"': result+="\\\""; break;
110 case '\\': result+="\\\\"; break;
111 default: result+=c; break;
112 }
113 }
114 return result;
115}

References QCString::data and QCString::isEmpty.

Referenced by common_attributes and DotNode::writeBox.

stripProtectionPrefix()

QCString stripProtectionPrefix (const QCString & s)
static

Definition at line 315 of file dotnode.cpp.

316{
317 if (!s.isEmpty() && (s[0]=='-' || s[0]=='+' || s[0]=='~' || s[0]=='#'))
318 {
319 return s.mid(1);
320 }
321 else
322 {
323 return s;
324 }
325}

References QCString::isEmpty and QCString::mid.

Referenced by DotNode::writeLabel.

writeBoxMemberList()

void writeBoxMemberList (TextStream & t, char prot, const MemberList * ml, const ClassDef * scope, bool & lineWritten, bool isStatic=FALSE, const StringUnorderedSet * skipNames=nullptr)
static

Definition at line 117 of file dotnode.cpp.

118 char prot,const MemberList *ml,const ClassDef *scope,
119 bool &lineWritten,
120 bool isStatic=FALSE,const StringUnorderedSet *skipNames=nullptr)
121{
122 constexpr auto tr_start = "<TR><TD VALIGN=\"top\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
123 constexpr auto tr_mid = "</TD><TD VALIGN=\"top\" ALIGN=\"LEFT\" CELLPADDING=\"1\" CELLSPACING=\"0\">";
124 constexpr auto tr_end = "</TD></TR>\n";
125 constexpr auto br = "<BR ALIGN=\"LEFT\"/>";
126 if (ml)
127 {
128 auto hideUndocMembers = Config_getEnum(HIDE_UNDOC_MEMBERS);
129 int totalCount=0;
130 for (const auto &mma : *ml)
131 {
132 if (mma->getClassDef()==scope &&
133 (skipNames==nullptr || skipNames->find(mma->name().str())==std::end(*skipNames)) &&
134 !(hideUndocMembers && !mma->hasDocumentation())
135 )
136 {
137 totalCount++;
138 }
139 }
140
141 int count=0;
142 auto dotUmlDetails = Config_getEnum(DOT_UML_DETAILS);
143 for (const auto &mma : *ml)
144 {
145 if (mma->getClassDef() == scope &&
146 (skipNames==nullptr || skipNames->find(mma->name().str())==std::end(*skipNames)) &&
147 !(hideUndocMembers && !mma->hasDocumentation())
148 )
149 {
150 int numFields = Config_getInt(UML_LIMIT_NUM_FIELDS);
151 if (numFields>0 && (totalCount>numFields*3/2 && count>=numFields))
152 {
153 t << tr_start << tr_mid << theTranslator->trAndMore(QCString().sprintf("%d",totalCount-count)) << tr_end;
154 lineWritten = true;
155 break;
156 }
157 else
158 {
159 t << tr_start << prot << tr_mid;
160 QCString label;
161 if (dotUmlDetails==DOT_UML_DETAILS_t::YES)
162 {
163 label+=mma->typeString();
164 label+=" ";
165 }
166 label+=mma->name();
167 if (!mma->isObjCMethod() && (mma->isFunction() || mma->isSlot() || mma->isSignal()))
168 {
169 if (dotUmlDetails==DOT_UML_DETAILS_t::YES)
170 {
171 label+=mma->argsString();
172 }
173 else
174 {
175 label+="()";
176 }
177 }
179 t << br << tr_end;
180 lineWritten = true;
181 count++;
182 }
183 }
184 }
185 // write member groups within the memberlist
186 for (const auto &mg : ml->getMemberGroupList())
187 {
188 if (!mg->members().empty())
189 {
190 writeBoxMemberList(t,prot,&mg->members(),scope,lineWritten,isStatic,skipNames);
191 }
192 }
193 }
194}

References Config_getEnum, Config_getInt, DotNode::convertLabel, FALSE, DotNode::List, theTranslator and writeBoxMemberList.

Referenced by writeBoxMemberList and DotNode::writeLabel.

Variables

normalArrowStyleMap

const char* normalArrowStyleMap[]
static
Initialiser
= { "empty", "empty", "empty", "open", nullptr, nullptr }

Definition at line 46 of file dotnode.cpp.

46static const char *normalArrowStyleMap[] =
47{
48 "empty", // Public
49 "empty", // Protected
50 "empty", // Private
51 "open", // "use" relation
52 nullptr, // Undocumented
53 nullptr // template relation
54};

normalEdgeColorMap

const char* normalEdgeColorMap[]
static
Initialiser
= { "steelblue1", "darkgreen", "firebrick4", "darkorchid3", "grey75", "orange", "orange" }

mapping from protection levels to color names

Definition at line 35 of file dotnode.cpp.

35static const char *normalEdgeColorMap[] =
36{
37 "steelblue1", // Public
38 "darkgreen", // Protected
39 "firebrick4", // Private
40 "darkorchid3", // "use" relation
41 "grey75", // Undocumented
42 "orange", // template relation
43 "orange" // type constraint
44};

normalEdgeProps

EdgeProperties normalEdgeProps
static

normalEdgeStyleMap

const char* normalEdgeStyleMap[]
static
Initialiser
= { "solid", "dashed" }

Definition at line 56 of file dotnode.cpp.

56static const char *normalEdgeStyleMap[] =
57{
58 "solid", // inheritance
59 "dashed" // usage
60};

umlArrowStyleMap

const char* umlArrowStyleMap[]
static
Initialiser
= { "onormal", "onormal", "onormal", "odiamond", nullptr, nullptr }

Definition at line 73 of file dotnode.cpp.

73static const char *umlArrowStyleMap[] =
74{
75 "onormal", // Public
76 "onormal", // Protected
77 "onormal", // Private
78 "odiamond", // "use" relation
79 nullptr, // Undocumented
80 nullptr // template relation
81};

umlEdgeColorMap

const char* umlEdgeColorMap[]
static
Initialiser
= { "steelblue1", "darkgreen", "firebrick4", "steelblue1", "grey75", "orange", "orange" }

Definition at line 62 of file dotnode.cpp.

62static const char *umlEdgeColorMap[] =
63{
64 "steelblue1", // Public
65 "darkgreen", // Protected
66 "firebrick4", // Private
67 "steelblue1", // "use" relation
68 "grey75", // Undocumented
69 "orange", // template relation
70 "orange" // type constraint
71};

umlEdgeProps

EdgeProperties umlEdgeProps
static
Initialiser

Definition at line 94 of file dotnode.cpp.

Referenced by DotNode::writeArrow.

umlEdgeStyleMap

const char* umlEdgeStyleMap[]
static
Initialiser
= { "solid", "solid" }

Definition at line 83 of file dotnode.cpp.

83static const char *umlEdgeStyleMap[] =
84{
85 "solid", // inheritance
86 "solid" // usage
87};

Macro Definitions

DEBUG_RENUMBERING

#define DEBUG_RENUMBERING   0

Definition at line 920 of file dotnode.cpp.

920#define DEBUG_RENUMBERING 0

Generated via doxygen2docusaurus by Doxygen 1.14.0.