Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/membername.cpp

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: membername.cpp,v 1.16 2001/03/19 19:27:41 root Exp $
4 *
5 * Copyright (C) 1997-2011 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
23MemberName::MemberName(const char *n) : QList<MemberDef>()
24{
25 name=n;
26 setAutoDelete(TRUE);
27}
28
29MemberName::~MemberName()
30{
31}
32
33int MemberName::compareItems(GCI item1, GCI item2)
34{
35 MemberDef *m1=(MemberDef *)item1;
36 MemberDef *m2=(MemberDef *)item2;
37 ClassDef *c1=m1->getClassDef();
38 ClassDef *c2=m2->getClassDef();
39 FileDef *f1=m1->getFileDef();
40 FileDef *f2=m2->getFileDef();
41 if (c1 && c2)
42 return strcmp(c1->name(),c2->name());
43 else if (f1 && f2)
44 return strcmp(f1->name(),f2->name());
45 else
46 return 0;
47}
48
49MemberNameInfo::MemberNameInfo(const char *n) : QList<MemberInfo>()
50{
51 name=n;
52 setAutoDelete(TRUE);
53}
54
55int MemberNameInfo::compareItems(GCI item1, GCI item2)
56{
57 MemberInfo *m1=(MemberInfo *)item1;
58 MemberInfo *m2=(MemberInfo *)item2;
59 ClassDef *c1=m1->memberDef->getClassDef();
60 ClassDef *c2=m2->memberDef->getClassDef();
61 FileDef *f1=m1->memberDef->getFileDef();
62 FileDef *f2=m2->memberDef->getFileDef();
63 if (c1 && c2)
64 return strcmp(c1->name(),c2->name());
65 else if (f1 && f2)
66 return strcmp(f1->name(),f2->name());
67 else
68 return 0;
69}
70MemberNameIterator::MemberNameIterator(const MemberName &mnlist) :
71 QListIterator<MemberDef>(mnlist)
72{
73}
74
75int MemberNameSDict::compareItems(GCI item1, GCI item2)
76{
77 MemberName *n1=(MemberName *)item1;
78 MemberName *n2=(MemberName *)item2;
79 return stricmp(n1->memberName()+getPrefixIndex(n1->memberName()),
80 n2->memberName()+getPrefixIndex(n2->memberName())
81 );
82}
83
84

Archive Download this file

Revision: 1322