My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
membername.cpp
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Dimitri van Heesch.
6  *
7  * Permission to use, copy, modify, and distribute this software and its
8  * documentation under the terms of the GNU General Public License is hereby
9  * granted. No representations are made about the suitability of this software
10  * for any purpose. It is provided "as is" without express or implied warranty.
11  * See the GNU General Public License for more details.
12  *
13  * Documents produced by Doxygen are derivative works derived from the
14  * input used in their production; they are not affected by this license.
15  *
16  */
17 
18 #include "membername.h"
19 #include "classdef.h"
20 #include "util.h"
21 #include "filedef.h"
22 
23 MemberName::MemberName(const char *n) : QList<MemberDef>()
24 {
25  name=n;
26  setAutoDelete(TRUE);
27 }
28 
30 {
31 }
32 
33 int MemberName::compareValues(const MemberDef *m1, const MemberDef *m2) const
34 {
35  ClassDef *c1=m1->getClassDef();
36  ClassDef *c2=m2->getClassDef();
37  FileDef *f1=m1->getFileDef();
38  FileDef *f2=m2->getFileDef();
39  if (c1 && c2)
40  return qstrcmp(c1->name(),c2->name());
41  else if (f1 && f2)
42  return qstrcmp(f1->name(),f2->name());
43  else
44  return 0;
45 }
46 
47 MemberNameInfo::MemberNameInfo(const char *n) : QList<MemberInfo>()
48 {
49  name=n;
50  setAutoDelete(TRUE);
51 }
52 
53 int MemberNameInfo::compareValues(const MemberInfo *m1,const MemberInfo *m2) const
54 {
55  ClassDef *c1=m1->memberDef->getClassDef();
56  ClassDef *c2=m2->memberDef->getClassDef();
57  FileDef *f1=m1->memberDef->getFileDef();
58  FileDef *f2=m2->memberDef->getFileDef();
59  if (c1 && c2)
60  return qstrcmp(c1->name(),c2->name());
61  else if (f1 && f2)
62  return qstrcmp(f1->name(),f2->name());
63  else
64  return 0;
65 }
67  QListIterator<MemberDef>(mnlist)
68 {
69 }
70 
72 {
73  return qstricmp(n1->memberName()+getPrefixIndex(n1->memberName()),
75  );
76 }
77