kdelirc
prototype.h
Go to the documentation of this file.00001 // 00002 // 00003 // C++ Interface: $MODULE$ 00004 // 00005 // Description: 00006 // 00007 // 00008 // Author: Gav Wood <gav@kde.org>, (C) 2003 00009 // 00010 // Copyright: See COPYING file that comes with this distribution 00011 // 00012 // 00013 #ifndef PROTOTYPE_H 00014 #define PROTOTYPE_H 00015 00016 #include <qstringlist.h> 00017 #include <qpair.h> 00018 00019 00024 class Prototype 00025 { 00026 QString original, theName, theReturn; 00027 QStringList theNames, theTypes; 00028 00029 void parse(); 00030 00031 public: 00032 unsigned count() const{ return theTypes.count(); } 00033 const QPair<QString, QString> operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); } 00034 const QString &name(int i) const { return theNames[i]; } 00035 const QString &type(int i) const { return theTypes[i]; } 00036 const QString &returnType() const { return theReturn; } 00037 const QString &name() const { return theName; } 00038 const QString &prototype() const { return original; } 00039 const QString argumentList() const; 00040 const QString argumentListNN() const; 00041 const int argumentCount() { return theTypes.count(); } 00042 const QString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; } 00043 00044 void setPrototype(const QString &source) { original = source; parse(); } 00045 00046 Prototype &operator=(const QString &source) { setPrototype(source); return *this; } 00047 00048 Prototype(const QString &source); 00049 Prototype(); 00050 ~Prototype(); 00051 00052 }; 00053 00054 #endif
KDE 4.0 API Reference