api.h
changeset 394 67cfa6e6b863
parent 377 5391ab620c95
child 395 7ced3733ba60
     1.1 --- a/api.h	Wed Oct 18 10:45:00 2006 +0000
     1.2 +++ b/api.h	Tue Oct 24 15:36:38 2006 +0000
     1.3 @@ -1,28 +1,37 @@
     1.4  #ifndef API_H
     1.5  #define API_H
     1.6  
     1.7 -#include <qstringlist.h>
     1.8 +#include <QStringList>
     1.9 +
    1.10 +enum ErrorLevel {NoError,Warning,Aborted};
    1.11  
    1.12  class API
    1.13  {
    1.14  public:
    1.15  	API();
    1.16  	void initCommand();
    1.17 -	void parseCommand (const QString&);
    1.18 +	void parseInput (const QString &input);
    1.19  	QString command();
    1.20  	QStringList parameters();
    1.21 -	QString errorDesc();
    1.22 -	bool error();
    1.23 -	void setError (const QString &);
    1.24 -	bool checkParamCount (const int &);
    1.25 -	bool checkParamIsInt (const int &);
    1.26 -	int parInt (bool &,const uint&);
    1.27 -	QString parString(bool &,const int &);
    1.28 +	int paramCount();
    1.29 +	QString errorMessage();
    1.30 +	QString errorDescription();
    1.31 +	ErrorLevel errorLevel();
    1.32 +	void setError (ErrorLevel level,const QString &description);
    1.33 +	void resetError();
    1.34 +	bool checkParamCount (QList <int> plist);
    1.35 +	bool checkParamCount (const int &index);
    1.36 +	bool checkParamIsInt (const int &index);
    1.37 +	int parInt (bool &,const uint &index);
    1.38 +	QString parString(bool &ok,const int &index);
    1.39 +	bool parBool (bool &ok, const int &index);
    1.40  private:
    1.41 +	QString input;
    1.42  	QString com;
    1.43  	QStringList paramList;
    1.44 -	QString errorString;
    1.45 -	bool noErr;
    1.46 +	QString errMessage;
    1.47 +	QString errDescription;
    1.48 +	ErrorLevel errLevel;
    1.49  };
    1.50  
    1.51  #endif