diff -r 270593ab83b2 -r 67a91e28b30f api.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api.cpp Mon Jun 06 20:27:42 2005 +0000 @@ -0,0 +1,38 @@ +#include "api.h" + +#include + +void API::parseCommand (const QString &s,QString &command,QString +¶m) +{ + param=""; + command=""; + QRegExp re; + int pos; + + // Get command + re.setPattern ("(.*)\\s"); + re.setMinimal (false); + pos=re.search (s); + if (pos>=0) + command=re.cap(1); + + // Get parameters + re.setPattern ("\\((.*)\\)"); + pos=re.search (s); + if (pos>=0) + param=re.cap (1); +} + +void API::getString (const QString &s, QString &rs) +{ + // return the string in s, this could be also stored in + // a variable later + QRegExp re("\"(.*)\""); + int pos=re.search (s); + if (pos>=0) + rs=re.cap (1); + else + rs=""; + +} \ No newline at end of file