summaryrefslogtreecommitdiffstats
path: root/kdelirc/kdelirc/prototype.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit2bda8f7717adf28da4af0d34fb82f63d2868c31d (patch)
tree8d927b7b47a90c4adb646482a52613f58acd6f8c /kdelirc/kdelirc/prototype.h
downloadtdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.tar.gz
tdeutils-2bda8f7717adf28da4af0d34fb82f63d2868c31d.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdelirc/kdelirc/prototype.h')
-rw-r--r--kdelirc/kdelirc/prototype.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/kdelirc/kdelirc/prototype.h b/kdelirc/kdelirc/prototype.h
new file mode 100644
index 0000000..22c1123
--- /dev/null
+++ b/kdelirc/kdelirc/prototype.h
@@ -0,0 +1,54 @@
+//
+//
+// C++ Interface: $MODULE$
+//
+// Description:
+//
+//
+// Author: Gav Wood <gav@kde.org>, (C) 2003
+//
+// Copyright: See COPYING file that comes with this distribution
+//
+//
+#ifndef PROTOTYPE_H
+#define PROTOTYPE_H
+
+#include <qstringlist.h>
+#include <qpair.h>
+#include <qstring.h>
+
+/**
+@author Gav Wood
+*/
+
+class Prototype
+{
+ QString original, theName, theReturn;
+ QStringList theNames, theTypes;
+
+ void parse();
+
+public:
+ unsigned count() const{ return theTypes.count(); }
+ const QPair<QString, QString> operator[](int i) const { return qMakePair(theTypes[i], theNames[i]); }
+ const QString &name(int i) const { return theNames[i]; }
+ const QString &type(int i) const { return theTypes[i]; }
+ const QString &returnType() const { return theReturn; }
+ const QString &name() const { return theName; }
+ const QString &prototype() const { return original; }
+ const QString argumentList() const;
+ const QString argumentListNN() const;
+ const int argumentCount() { return theTypes.count(); }
+ const QString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; }
+
+ void setPrototype(const QString &source) { original = source; parse(); }
+
+ Prototype &operator=(const QString &source) { setPrototype(source); return *this; }
+
+ Prototype(const QString &source);
+ Prototype();
+ ~Prototype();
+
+};
+
+#endif