arguments.cpp
Go to the documentation of this file.
1 #include "arguments.h"
2 #include "marshal.h"
3 #include <assert.h>
4 
5 /*! the argument list is documented if one of its
6  * arguments is documented
7  */
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 
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;
33  argList->pureSpecifier = pureSpecifier;
35  argList->isDeleted = isDeleted;
36 
37  return argList;
38 }
39 
41 {
42  uint i;
44  if (count==NULL_LIST) return 0; // null list
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);
59  result->append(a);
60  }
61  result->constSpecifier = unmarshalBool(s);
62  result->volatileSpecifier = unmarshalBool(s);
63  result->pureSpecifier = unmarshalBool(s);
65  result->isDeleted = unmarshalBool(s);
66  return result;
67 }
68 
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);
92  }
93  }
94  marshalBool(s,argList->constSpecifier);
95  marshalBool(s,argList->volatileSpecifier);
96  marshalBool(s,argList->pureSpecifier);
98  marshalBool(s,argList->isDeleted);
99  }
100 }
101 
QCString type
Definition: arguments.h:67
bool hasDocumentation() const
Definition: arguments.cpp:8
This class represents an function or template argument list.
Definition: arguments.h:82
static QCString result
#define NULL_LIST
Definition: marshal.h:41
void append(const type *d)
Definition: qlist.h:73
QCString defval
Definition: arguments.h:71
const bool FALSE
Definition: qglobal.h:370
Abstract interface for file based memory storage operations.
Definition: store.h:27
QCString unmarshalQCString(StorageIntf *s)
Definition: marshal.cpp:451
static void marshal(StorageIntf *s, ArgumentList *argList)
Definition: arguments.cpp:69
QCString canType
Definition: arguments.h:68
bool constSpecifier
Definition: arguments.h:99
void marshalBool(StorageIntf *s, bool b)
Definition: marshal.cpp:42
QCString typeConstraint
Definition: arguments.h:73
This class contains the information about the argument of a function or template. ...
Definition: arguments.h:28
uint count() const
Definition: qlist.h:66
bool volatileSpecifier
Definition: arguments.h:101
bool unmarshalBool(StorageIntf *s)
Definition: marshal.cpp:443
const double a
static ArgumentList * unmarshal(StorageIntf *s)
Definition: arguments.cpp:40
type * current() const
Definition: qlist.h:146
uint unmarshalUInt(StorageIntf *s)
Definition: marshal.cpp:427
bool pureSpecifier
Definition: arguments.h:103
QCString attrib
Definition: arguments.h:66
void marshalUInt(StorageIntf *s, uint v)
Definition: marshal.cpp:26
bool isDeleted
Definition: arguments.h:107
QCString name
Definition: arguments.h:69
QCString trailingReturnType
Definition: arguments.h:105
void marshalQCString(StorageIntf *s, const QCString &str)
Definition: marshal.cpp:48
ArgumentList * deepCopy() const
Definition: arguments.cpp:20
unsigned uint
Definition: qglobal.h:351
void setAutoDelete(bool enable)
Definition: qlist.h:99
static QCString * s
Definition: config.cpp:1042
const bool TRUE
Definition: qglobal.h:371
QCString array
Definition: arguments.h:70
QCString docs
Definition: arguments.h:72
type * toFirst()
Definition: qlist.h:135