My Project
Main Page
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
arguments.cpp
Go to the documentation of this file.
1
#include "
arguments.h
"
2
#include "
marshal.h
"
3
#include <assert.h>
4
8
bool
ArgumentList::hasDocumentation
()
const
9
{
10
bool
hasDocs=FALSE;
11
ArgumentListIterator
ali(*
this
);
12
Argument
*a;
13
for
(ali.toFirst();!hasDocs && (a=ali.current());++ali)
14
{
15
hasDocs = a->
hasDocumentation
();
16
}
17
return
hasDocs;
18
}
19
20
ArgumentList
*
ArgumentList::deepCopy
()
const
21
{
22
ArgumentList
*argList =
new
ArgumentList
;
23
argList->setAutoDelete(TRUE);
24
25
QListIterator<Argument> ali(*
this
);
26
Argument
*a;
27
for
(;(a=ali.current());++ali)
28
{
29
argList->append(
new
Argument
(*a));
30
}
31
argList->
constSpecifier
=
constSpecifier
;
32
argList->
volatileSpecifier
=
volatileSpecifier
;
33
argList->
pureSpecifier
=
pureSpecifier
;
34
argList->
trailingReturnType
=
trailingReturnType
;
35
argList->
isDeleted
=
isDeleted
;
36
37
return
argList;
38
}
39
40
ArgumentList
*
ArgumentList::unmarshal
(
StorageIntf
*s)
41
{
42
uint i;
43
uint count =
unmarshalUInt
(s);
44
if
(count==
NULL_LIST
)
return
0;
// null list
45
ArgumentList
*result =
new
ArgumentList
;
46
assert(count<1000000);
47
//printf("unmarshalArgumentList: %d\n",count);
48
for
(i=0;i<count;i++)
49
{
50
Argument
*a =
new
Argument
;
51
a->
attrib
=
unmarshalQCString
(s);
52
a->
type
=
unmarshalQCString
(s);
53
a->
canType
=
unmarshalQCString
(s);
54
a->
name
=
unmarshalQCString
(s);
55
a->
array
=
unmarshalQCString
(s);
56
a->
defval
=
unmarshalQCString
(s);
57
a->
docs
=
unmarshalQCString
(s);
58
a->
typeConstraint
=
unmarshalQCString
(s);
59
result->append(a);
60
}
61
result->
constSpecifier
=
unmarshalBool
(s);
62
result->
volatileSpecifier
=
unmarshalBool
(s);
63
result->
pureSpecifier
=
unmarshalBool
(s);
64
result->
trailingReturnType
=
unmarshalQCString
(s);
65
result->
isDeleted
=
unmarshalBool
(s);
66
return
result;
67
}
68
69
void
ArgumentList::marshal
(
StorageIntf
*s,
ArgumentList
*argList)
70
{
71
if
(argList==0)
72
{
73
marshalUInt
(s,
NULL_LIST
);
// null pointer representation
74
}
75
else
76
{
77
marshalUInt
(s,argList->count());
78
if
(argList->count()>0)
79
{
80
ArgumentListIterator
ali(*argList);
81
Argument
*a;
82
for
(ali.toFirst();(a=ali.current());++ali)
83
{
84
marshalQCString
(s,a->
attrib
);
85
marshalQCString
(s,a->
type
);
86
marshalQCString
(s,a->
canType
);
87
marshalQCString
(s,a->
name
);
88
marshalQCString
(s,a->
array
);
89
marshalQCString
(s,a->
defval
);
90
marshalQCString
(s,a->
docs
);
91
marshalQCString
(s,a->
typeConstraint
);
92
}
93
}
94
marshalBool
(s,argList->
constSpecifier
);
95
marshalBool
(s,argList->
volatileSpecifier
);
96
marshalBool
(s,argList->
pureSpecifier
);
97
marshalQCString
(s,argList->
trailingReturnType
);
98
marshalBool
(s,argList->
isDeleted
);
99
}
100
}
101