浏览该文件的文档.
101 if (tooltip.
isEmpty())
return tooltip;
103 const char *p=tooltip.
data();
109 case '"': result+=
"\\\"";
break;
110 case '\\': result+=
"\\\\";
break;
111 default: result+=c;
break;
124 for (
const auto &mma : *ml)
126 if (mma->getClassDef()==scope &&
127 (skipNames==
nullptr || skipNames->find(mma->name().str())==
std::end(*skipNames)))
135 for (
const auto &mma : *ml)
137 if (mma->getClassDef() == scope &&
138 (skipNames==
nullptr || skipNames->find(mma->name().str())==
std::end(*skipNames)))
141 if (numFields>0 && (totalCount>numFields*3/2 && count>=numFields))
150 if (dotUmlDetails==DOT_UML_DETAILS_t::YES)
152 label+=mma->typeString();
156 if (!mma->isObjCMethod() && (mma->isFunction() || mma->isSlot() || mma->isSignal()))
158 if (dotUmlDetails==DOT_UML_DETAILS_t::YES)
160 label+=mma->argsString();
174 for (
const auto &mg : ml->getMemberGroupList())
176 if (!mg->members().empty())
186 QCString bBefore(
"\\_/<({[: =-+@%#~?$");
203 case '\\': replacement=
"\\\\";
break;
204 case '\n': replacement=
"\\n";
break;
205 case '<': replacement=
"\\<";
break;
206 case '>': replacement=
"\\>";
break;
207 case '|': replacement=
"\\|";
break;
208 case '{': replacement=
"\\{";
break;
209 case '}': replacement=
"\\}";
break;
210 case '"': replacement=
"\\\"";
break;
211 default: replacement+=c;
break;
218 foldLen = (3*foldLen+sinceLast+2)/4;
221 else if ((pc!=
':' || c!=
':') && charsLeft>foldLen/3 && sinceLast>foldLen && bBefore.
contains(c))
225 foldLen = (foldLen+sinceLast+1)/2;
228 else if (charsLeft>1+foldLen/4 && sinceLast>foldLen+foldLen/3 &&
229 !isupper(c) && isupper(p[idx]))
233 foldLen = (foldLen+sinceLast+1)/2;
236 else if (charsLeft>foldLen/3 && sinceLast>foldLen && bAfter.
contains(c) && (c!=
':' || p[idx]!=
':'))
240 foldLen = (foldLen+sinceLast+1)/2;
256 if (!s.
isEmpty() && (s[0]==
'-' || s[0]==
'+' || s[0]==
'~' || s[0]==
'#'))
295 edgeLabCol==-1 ? edgeColor : edgeLabCol);
322 pn->deleteNode(deletedList);
327 cn->deleteNode(deletedList);
330 deletedList.push_back(
this);
351 for (
const auto &dotNode : deletedNodes)
360 bool hasNonReachableChildren)
const
364 (hasNonReachableChildren ?
"red" :
"black");
365 t <<
" Node" <<
m_number <<
" [label=\"";
375 if (!ei.label().isEmpty())
377 int i=ei.label().find(
'\n');
380 while ((i=ei.label().find(
'\n',p))!=-1)
383 arrowNames.insert(lab.
str());
387 arrowNames.insert(lab.
str());
428 if (!mg->members().empty())
441 t <<
"\",height=0.2,width=0.4";
444 t <<
",color=\"black\", fillcolor=\"grey75\", style=\"filled\", fontcolor=\"black\"";
450 t <<
",color=\"" << labCol <<
"\", fillcolor=\"";
452 t <<
"\", style=\"filled\"";
456 t <<
",color=\"" << labCol <<
"\"";
478 t <<
",tooltip=\" \"";
489 bool pointBack)
const
505 bool umlUseArrow = aStyle==
"odiamond";
507 if (pointBack && !umlUseArrow) t <<
"dir=\"back\",";
520 bool rev = pointBack;
521 if (umlUseArrow) rev=!rev;
537 bool backArrows)
const
552 writeArrow(t,gt,format,cn,&(*it),topDown,backArrows);
554 cn->write(t,gt,format,topDown,toChildren,backArrows);
564 const auto &
children = pn->children();
566 size_t index = child_it -
children.begin();
572 &pn->edgeInfo()[index],
577 pn->write(t,gt,format,
TRUE,
FALSE,backArrows);
585 t <<
" <node id=\"" <<
m_number <<
"\">\n";
590 int dollarPos = url.
find(
'$');
605 t <<
" <childnode refid=\"" << childNode->number() <<
"\" relation=\"";
628 while ((ni=
edgeInfo.label().find(
'\n',p))!=-1)
639 t <<
" </childnode>\n";
647 t <<
" <node id=\"" <<
m_number <<
"\">\n";
652 int dollarPos = url.
find(
'$');
667 t <<
" <childnode refid=\"" << childNode->number() <<
"\" relation=\"";
690 while ((ni=
edgeInfo.label().find(
'\n',p))!=-1)
701 t <<
" </childnode>\n";
710 const char* nodePrefix =
" node-";
713 t << nodePrefix <<
"id = " <<
m_number <<
";\n";
714 t << nodePrefix <<
"label = '" <<
m_label <<
"';\n";
719 int dollarPos = url.
find(
'$');
722 t << nodePrefix <<
"link = {\n" <<
" "
723 << nodePrefix <<
"link-id = '" << url.
mid(dollarPos+1) <<
"';\n";
726 t <<
" " << nodePrefix <<
"link-external = '"
727 << url.
left(dollarPos) <<
"';\n";
736 t <<
" node-child = {\n";
737 t <<
" child-id = '" << childNode->number() <<
"';\n";
754 t <<
" edgelabel = <<_EnD_oF_dEf_TeXt_\n"
756 <<
"_EnD_oF_dEf_TeXt_;\n";
758 t <<
" }; /* node-child */\n";
761 t <<
" }; /* node */\n";
768 for (
const auto &pn :
m_parents)
if (pn->isWritten()) pn->clearWriteFlag();
769 for (
const auto &cn :
m_children)
if (cn->isWritten()) cn->clearWriteFlag();
776 if (cn->subgraphId()==-1)
778 cn->setSubgraphId(curColor);
780 cn->colorConnectedNodes(curColor);
787 if (pn->subgraphId()==-1)
789 pn->setSubgraphId(curColor);
791 pn->colorConnectedNodes(curColor);
797 #define DEBUG_RENUMBERING 0
803 #if DEBUG_RENUMBERING
804 static int level = 0;
806 for (
int i = 0; i < level; i++) printf(
" ");
814 cn->renumberNodes(
number);
818 pn->renumberNodes(
number);
820 #if DEBUG_RENUMBERING
823 for (
int i = 0; i < level; i++) printf(
" ");
void writeXML(TextStream &t, bool isClassGraph) const
static EdgeProperties normalEdgeProps
bool m_deleted
used to mark a node as deleted
void addChild(DotNode *n, int edgeColor=EdgeInfo::Purple, int edgeStyle=EdgeInfo::Solid, const QCString &edgeLab=QCString(), const QCString &edgeURL=QCString(), int edgeLabCol=-1)
@ MemberListType_priStaticMethods
@ MemberListType_priStaticAttribs
#define Config_getEnum(name)
@ MemberListType_pacStaticAttribs
void setDistance(int distance)
uint length() const
Returns the length of the string, not counting the 0-terminator.
void write(TextStream &t, GraphType gt, GraphOutputFormat f, bool topDown, bool toChildren, bool backArrows) const
int findRev(char c, int index=-1, bool cs=TRUE) const
@ MemberListType_priAttribs
bool isEmpty() const
Returns TRUE iff the string is empty
const ClassDef * m_classDef
class representing this node (can be 0)
void writeDEF(TextStream &t) const
@ MemberListType_priSlots
static void deleteNodes(DotNode *node)
const char *const * edgeStyleMap
DotNode(int n, const QCString &lab, const QCString &tip, const QCString &url, bool rootNode=FALSE, const ClassDef *cd=0)
void addParent(DotNode *n)
int findParent(DotNode *n)
bool isRenumbered() const
Text streaming class that buffers data.
int find(char c, int index=0, bool cs=TRUE) const
@ MemberListType_proAttribs
@ MemberListType_pubMethods
virtual SrcLangExt getLanguage() const =0
Returns the programming language this definition was written in.
void colorConnectedNodes(int curColor)
static QCString escapeTooltip(const QCString &tooltip)
DirIterator end(const DirIterator &) noexcept
int contains(char c, bool cs=TRUE) const
std::unordered_set< std::string > StringUnorderedSet
void removeParent(DotNode *n)
void writeDocbook(TextStream &t, bool isClassGraph) const
static const char * umlEdgeStyleMap[]
bool m_written
used to mark a node as written
QCString addHtmlExtensionIfMissing(const QCString &fName)
@ MemberListType_pubSlots
A abstract class representing of a compound symbol.
#define Config_getInt(name)
@ MemberListType_proStaticMethods
QCString left(size_t len) const
void writeBox(TextStream &t, GraphType gt, GraphOutputFormat f, bool hasNonReachableChildren) const
static const char * umlEdgeColorMap[]
Translator * theTranslator
static void writeBoxMemberList(TextStream &t, char prot, const MemberList *ml, const ClassDef *scope, bool isStatic=FALSE, const StringUnorderedSet *skipNames=nullptr)
QCString m_tooltip
node's tooltip
const char *const * edgeColorMap
@ MemberListType_pacAttribs
static QCString stripProtectionPrefix(const QCString &s)
static const char * umlArrowStyleMap[]
@ MemberListType_pubStaticAttribs
QCString m_url
url of the node (format: remote$local)
const EdgeInfoVector & edgeInfo() const
void writeArrow(TextStream &t, GraphType gt, GraphOutputFormat f, const DotNode *cn, const EdgeInfo *ei, bool topDown, bool pointBack=TRUE) const
@ MemberListType_proMethods
static const char * normalEdgeColorMap[]
Attributes of an edge of a dot graph
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
@ MemberListType_pacMethods
const char *const * arrowStyleMap
void removeChild(DotNode *n)
@ MemberListType_proStaticAttribs
static EdgeProperties umlEdgeProps
TruncState m_truncated
does the node have non-visible children/parents
Helper struct holding the properties of a edge in a dot graph.
#define Config_getBool(name)
@ MemberListType_priMethods
bool m_isRoot
indicates if this is a root node
int m_distance
shortest path to the root node
@ MemberListType_proSlots
EdgeInfoVector m_edgeInfo
edge info for each child
const char * qPrint(const char *s)
#define Config_getString(name)
void renumberNodes(int &number)
bool m_visible
is the node visible in the output
@ MemberListType_pubAttribs
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string
virtual MemberList * getMemberList(MemberListType lt) const =0
Returns the members in the list identified by lt
QCString convertToXML(const QCString &s, bool keepEntities)
static const char * normalEdgeStyleMap[]
@ MemberListType_pacStaticMethods
static QCString convertLabel(const QCString &l)
DotNodeRefVector m_children
list of child nodes (outgoing arrows)
virtual const MemberGroupList & getMemberGroups() const =0
Returns the member groups defined for this class
@ MemberListType_properties
virtual QCString trAndMore(const QCString &number)=0
void deleteNode(DotNodeRefVector &deletedList)
A bunch of utility functions.
@ MemberListType_pubStaticMethods
A list of MemberDef objects as shown in documentation sections.
DotNodeRefVector m_parents
list of parent nodes (incoming arrows)
std::vector< DotNode * > DotNodeRefVector
QCString right(size_t len) const
QCString m_label
label text
static const char * normalArrowStyleMap[]
const DotNodeRefVector & children() const
This is an alternative implementation of QCString.