diff -r 053b8645e3e9 -r 67cfa6e6b863 api.h --- a/api.h Wed Oct 18 10:45:00 2006 +0000 +++ b/api.h Tue Oct 24 15:36:38 2006 +0000 @@ -1,28 +1,37 @@ #ifndef API_H #define API_H -#include +#include + +enum ErrorLevel {NoError,Warning,Aborted}; class API { public: API(); void initCommand(); - void parseCommand (const QString&); + void parseInput (const QString &input); QString command(); QStringList parameters(); - QString errorDesc(); - bool error(); - void setError (const QString &); - bool checkParamCount (const int &); - bool checkParamIsInt (const int &); - int parInt (bool &,const uint&); - QString parString(bool &,const int &); + int paramCount(); + QString errorMessage(); + QString errorDescription(); + ErrorLevel errorLevel(); + void setError (ErrorLevel level,const QString &description); + void resetError(); + bool checkParamCount (QList plist); + bool checkParamCount (const int &index); + bool checkParamIsInt (const int &index); + int parInt (bool &,const uint &index); + QString parString(bool &ok,const int &index); + bool parBool (bool &ok, const int &index); private: + QString input; QString com; QStringList paramList; - QString errorString; - bool noErr; + QString errMessage; + QString errDescription; + ErrorLevel errLevel; }; #endif