• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdeutils
  • Sitemap
  • Contact Us
 

kdelirc

prototype.cpp

Go to the documentation of this file.
00001 //
00002 //
00003 // C++ Implementation: $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 #include <QRegExp>
00014 
00015 #include "prototype.h"
00016 
00017 Prototype::Prototype()
00018 {
00019     original = "";
00020 }
00021 
00022 Prototype::Prototype(const QString &source)
00023 {
00024     original = source;
00025     parse();
00026 }
00027 
00028 Prototype::~Prototype()
00029 {
00030 }
00031 
00032 const QString Prototype::argumentList() const
00033 {
00034     QString ret = "";
00035     for(int i = 0; i < theTypes.count(); i++)
00036         ret += (i ? ", " : "") + theTypes[i] + " " + theNames[i];
00037     return ret;
00038 }
00039 
00040 const QString Prototype::argumentListNN() const
00041 {
00042     QString ret = "";
00043     for(int i = 0; i < theTypes.count(); i++)
00044         ret += (i ? ", " : "") + theTypes[i];
00045     return ret;
00046 }
00047 
00048 void Prototype::parse()
00049 {
00050     theNames.clear();
00051     theTypes.clear();
00052 
00053     QRegExp main("^(.*) (\\w[\\d\\w]*)\\((.*)\\)");
00054     QRegExp parameters("^\\s*([^,\\s]+)(\\s+(\\w[\\d\\w]*))?(,(.*))?$");
00055 
00056     if(main.search(original) == -1) return;
00057     theReturn = main.cap(1);
00058     theName = main.cap(2);
00059 
00060     QString args = main.cap(3);
00061     while(parameters.search(args) != -1)
00062     {   theTypes += parameters.cap(1);
00063         theNames += parameters.cap(3);
00064         args = parameters.cap(5);
00065     }
00066 }
00067 

kdelirc

Skip menu "kdelirc"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

kdeutils

Skip menu "kdeutils"
  • ark
  • kcalc
  • kcharselect
  • kdelirc
  • kdessh
  • kdf
  • kfloppy
  • kgpg
  • kjots
  • klaptopdaemon
  • kmilo
  • ksim
  • ktimer
  • kwallet
  • superkaramba
Generated for kdeutils by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal