summaryrefslogtreecommitdiffstats
path: root/tdelirc/tdelirc/prototype.h
diff options
context:
space:
mode:
Diffstat (limited to 'tdelirc/tdelirc/prototype.h')
-rw-r--r--tdelirc/tdelirc/prototype.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/tdelirc/tdelirc/prototype.h b/tdelirc/tdelirc/prototype.h
new file mode 100644
index 0000000..fa101b7
--- /dev/null
+++ b/tdelirc/tdelirc/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 <tqstringlist.h>
+#include <tqpair.h>
+#include <tqstring.h>
+
+/**
+@author Gav Wood
+*/
+
+class Prototype
+{
+ TQString original, theName, theReturn;
+ TQStringList theNames, theTypes;
+
+ void parse();
+
+public:
+ unsigned count() const{ return theTypes.count(); }
+ const TQPair<TQString, TQString> operator[](int i) const { return tqMakePair(theTypes[i], theNames[i]); }
+ const TQString &name(int i) const { return theNames[i]; }
+ const TQString &type(int i) const { return theTypes[i]; }
+ const TQString &returnType() const { return theReturn; }
+ const TQString &name() const { return theName; }
+ const TQString &prototype() const { return original; }
+ const TQString argumentList() const;
+ const TQString argumentListNN() const;
+ const int argumentCount() { return theTypes.count(); }
+ const TQString prototypeNR() const { return theName + "(" + argumentListNN() + ")"; }
+
+ void setPrototype(const TQString &source) { original = source; parse(); }
+
+ Prototype &operator=(const TQString &source) { setPrototype(source); return *this; }
+
+ Prototype(const TQString &source);
+ Prototype();
+ ~Prototype();
+
+};
+
+#endif