Blame src/arguments.cpp

Packit 1c1d7e
#include "arguments.h"
Packit 1c1d7e
#include "marshal.h"
Packit 1c1d7e
#include <assert.h>
Packit 1c1d7e
Packit 1c1d7e
/*! the argument list is documented if one of its
Packit 1c1d7e
 *  arguments is documented 
Packit 1c1d7e
 */
Packit 1c1d7e
bool ArgumentList::hasDocumentation() const
Packit 1c1d7e
{
Packit 1c1d7e
  bool hasDocs=FALSE;
Packit 1c1d7e
  ArgumentListIterator ali(*this);
Packit 1c1d7e
  Argument *a;
Packit 1c1d7e
  for (ali.toFirst();!hasDocs && (a=ali.current());++ali)
Packit 1c1d7e
  {
Packit 1c1d7e
    hasDocs = a->hasDocumentation(); 
Packit 1c1d7e
  }
Packit 1c1d7e
  return hasDocs;
Packit 1c1d7e
}
Packit 1c1d7e
Packit 1c1d7e
ArgumentList *ArgumentList::deepCopy() const
Packit 1c1d7e
{
Packit 1c1d7e
  ArgumentList *argList = new ArgumentList;
Packit 1c1d7e
  argList->setAutoDelete(TRUE);
Packit 1c1d7e
Packit 1c1d7e
  QListIterator<Argument> ali(*this);
Packit 1c1d7e
  Argument *a;
Packit 1c1d7e
  for (;(a=ali.current());++ali)
Packit 1c1d7e
  {
Packit 1c1d7e
    argList->append(new Argument(*a));
Packit 1c1d7e
  }
Packit 1c1d7e
  argList->constSpecifier     = constSpecifier;
Packit 1c1d7e
  argList->volatileSpecifier  = volatileSpecifier;
Packit 1c1d7e
  argList->pureSpecifier      = pureSpecifier;
Packit 1c1d7e
  argList->trailingReturnType = trailingReturnType;
Packit 1c1d7e
  argList->isDeleted          = isDeleted;
Packit 1c1d7e
  argList->refQualifier       = refQualifier;
Packit 1c1d7e
Packit 1c1d7e
  return argList;
Packit 1c1d7e
}
Packit 1c1d7e
Packit 1c1d7e
ArgumentList *ArgumentList::unmarshal(StorageIntf *s)
Packit 1c1d7e
{
Packit 1c1d7e
  uint i;
Packit 1c1d7e
  uint count = unmarshalUInt(s);
Packit 1c1d7e
  if (count==NULL_LIST) return 0; // null list
Packit 1c1d7e
  ArgumentList *result = new ArgumentList;
Packit 1c1d7e
  assert(count<1000000);
Packit 1c1d7e
  //printf("unmarshalArgumentList: %d\n",count);
Packit 1c1d7e
  for (i=0;i
Packit 1c1d7e
  {
Packit 1c1d7e
    Argument *a = new Argument;
Packit 1c1d7e
    a->attrib  = unmarshalQCString(s);
Packit 1c1d7e
    a->type    = unmarshalQCString(s);
Packit 1c1d7e
    a->canType = unmarshalQCString(s);
Packit 1c1d7e
    a->name    = unmarshalQCString(s);
Packit 1c1d7e
    a->array   = unmarshalQCString(s);
Packit 1c1d7e
    a->defval  = unmarshalQCString(s);
Packit 1c1d7e
    a->docs    = unmarshalQCString(s);
Packit 1c1d7e
    a->typeConstraint = unmarshalQCString(s);
Packit 1c1d7e
    result->append(a);
Packit 1c1d7e
  }
Packit 1c1d7e
  result->constSpecifier     = unmarshalBool(s);
Packit 1c1d7e
  result->volatileSpecifier  = unmarshalBool(s);
Packit 1c1d7e
  result->pureSpecifier      = unmarshalBool(s);
Packit 1c1d7e
  result->trailingReturnType = unmarshalQCString(s);
Packit 1c1d7e
  result->isDeleted          = unmarshalBool(s);
Packit 1c1d7e
  result->refQualifier       = (RefQualifierType)unmarshalInt(s);
Packit 1c1d7e
  return result;
Packit 1c1d7e
}
Packit 1c1d7e
Packit 1c1d7e
void ArgumentList::marshal(StorageIntf *s,ArgumentList *argList)
Packit 1c1d7e
{
Packit 1c1d7e
  if (argList==0)
Packit 1c1d7e
  {
Packit 1c1d7e
    marshalUInt(s,NULL_LIST); // null pointer representation
Packit 1c1d7e
  }
Packit 1c1d7e
  else
Packit 1c1d7e
  {
Packit 1c1d7e
    marshalUInt(s,argList->count());
Packit 1c1d7e
    if (argList->count()>0)
Packit 1c1d7e
    {
Packit 1c1d7e
      ArgumentListIterator ali(*argList);
Packit 1c1d7e
      Argument *a;
Packit 1c1d7e
      for (ali.toFirst();(a=ali.current());++ali)
Packit 1c1d7e
      {
Packit 1c1d7e
        marshalQCString(s,a->attrib);
Packit 1c1d7e
        marshalQCString(s,a->type);
Packit 1c1d7e
        marshalQCString(s,a->canType);
Packit 1c1d7e
        marshalQCString(s,a->name);
Packit 1c1d7e
        marshalQCString(s,a->array);
Packit 1c1d7e
        marshalQCString(s,a->defval);
Packit 1c1d7e
        marshalQCString(s,a->docs);
Packit 1c1d7e
        marshalQCString(s,a->typeConstraint);
Packit 1c1d7e
      }
Packit 1c1d7e
    }
Packit 1c1d7e
    marshalBool(s,argList->constSpecifier);
Packit 1c1d7e
    marshalBool(s,argList->volatileSpecifier);
Packit 1c1d7e
    marshalBool(s,argList->pureSpecifier);
Packit 1c1d7e
    marshalQCString(s,argList->trailingReturnType);
Packit 1c1d7e
    marshalBool(s,argList->isDeleted);
Packit 1c1d7e
    marshalInt(s,(int)argList->refQualifier);
Packit 1c1d7e
  }
Packit 1c1d7e
}
Packit 1c1d7e