#pragma once
#include "tcl.h"
#include "vector.h"

class TclInterpreter
{
public:
	TclInterpreter(void);
	~TclInterpreter(void);
	int Eval(char * script); // evaluate a given script
	int EvalFile(char * filename); // evaluate the given file
	void Restart(); // restart the interpreter

	// the following methods obtain variable values, but using name1::name2
	char * GetString(const char * name1, const char * name2, char * defval);
	TCHAR * GetWideString(const char * name1, const char * name2, TCHAR * defval);
	int GetInt(const char * name1, const char * name2, int defval);
	double GetDouble(const char * name1, const char * name2, double);
	unsigned int GetColor(const char * name1, const char * name2, unsigned int defval);
	int GetList(Vector<std::string>& array, const char * name1, const char * name2);
private:
	Tcl_Interp * interp;
	Tcl_Obj * ScopedLookup(const char * name1, const char * name2);
	int verbose;
};
