Doxygen
Loading...
Searching...
No Matches
memberlist.cpp File Reference
#include "memberlist.h"
#include "classdef.h"
#include "message.h"
#include "util.h"
#include "language.h"
#include "doxygen.h"
#include "outputlist.h"
#include "groupdef.h"
#include "vhdldocgen.h"
#include "namespacedef.h"
#include "filedef.h"
#include "membergroup.h"
#include "config.h"
#include "docparser.h"
#include "moduledef.h"
+ Include dependency graph for memberlist.cpp:

Go to the source code of this file.

Functions

int genericCompareMembers (const MemberDef *c1, const MemberDef *c2)
 

Function Documentation

◆ genericCompareMembers()

int genericCompareMembers ( const MemberDef * c1,
const MemberDef * c2 )

Definition at line 48 of file memberlist.cpp.

49{
50 bool sortConstructorsFirst = Config_getBool(SORT_MEMBERS_CTORS_1ST);
51 if (sortConstructorsFirst)
52 {
53 int ord1 = c1->isConstructor() ? 2 : (c1->isDestructor() ? 1 : 0);
54 int ord2 = c2->isConstructor() ? 2 : (c2->isDestructor() ? 1 : 0);
55 if (ord1 > ord2)
56 return -1;
57 else if (ord2 > ord1)
58 return 1;
59 }
60 // sort on name, first case in-sensitive
61 int cmp = qstricmp_sort(c1->name(),c2->name());
62 // then on qualified name
63 if (cmp==0)
64 {
65 cmp = qstricmp_sort(c1->qualifiedName(),c2->qualifiedName());
66 }
67 // then on argument list
68 if (cmp==0 && !c1->argsString().isEmpty() && !c2->argsString().isEmpty())
69 {
70 cmp = qstricmp_sort(c1->argsString(),c2->argsString());
71 }
72 // then on file in which the item is defined
73 if (cmp==0)
74 {
76 }
77 // then on line number at which the member is defined
78 if (cmp==0)
79 {
80 cmp = c1->getDefLine()-c2->getDefLine();
81 }
82 return cmp;
83}
virtual QCString getDefFileName() const =0
virtual int getDefLine() const =0
virtual QCString qualifiedName() const =0
virtual const QCString & name() const =0
virtual bool isDestructor() const =0
virtual bool isConstructor() const =0
virtual QCString argsString() const =0
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
#define Config_getBool(name)
Definition config.h:33
int qstricmp_sort(const char *str1, const char *str2)
Definition qcstring.h:86

References MemberDef::argsString(), Config_getBool, Definition::getDefFileName(), Definition::getDefLine(), MemberDef::isConstructor(), MemberDef::isDestructor(), QCString::isEmpty(), Definition::name(), qstricmp_sort(), and Definition::qualifiedName().

Referenced by MemberVector::lessThan().