#ifndef _EXCEPTION_EVAL_H_
#define _EXCEPTION_EVAL_H_

#include <string>
#include <tcl.h>

#include "exceptionbase.h"
#include "../tk/tcl_interp.h"

using namespace std;

/**
 * \brief Evaluate exception.
 *
 * Handle situation if script evaluation failed.
 * 
 * \date 01-21-2006
 *
 * \author Ondrej Svejdar
 *
 * \todo 
 *
 * \bug 
 *
 */
class ExceptionEval:public ExceptionBase
{
	const string cmd;
	const string result;
	const string retCode;
	ExceptionEval(const string& cmd,const string& result,const string& retCode):
		cmd(cmd),result(result),retCode(retCode)
	{
	}
public:
	static const char* type;
	const char* getType() const;

	~ExceptionEval() throw()
	{
	}

	/**
	 * \brief Evaluate command. If error occurs, automatically construct new ExceptionEval exception.
	 * \param interp interpret
	 * \param cmd script to evaluate
	 * \return script result errorcode (TCL_OK)
	 */
	static int eval(TclInterp* interp,const string& cmd);

	const string& getMessage() const;
};


#endif/*_EXCEPTION_EVAL_H_*/
