#pragma once
#include "NameValidator.h"
#include <iostream>
#include <map>

namespace DESpot
{
	class Des;
	class TemplateNameParser
	{
		public:
			typedef std::map<std::wstring, std::wstring> TemplateParameter;
			typedef TemplateParameter::iterator TemplateParameterItr;
			typedef TemplateParameter::const_iterator TemplateParameterCItr;
	 	public:
			const std::wstring& m_templateName;
			//static int m_countPercent;
			unsigned int m_currentIndex;
			//int m_countPercent;
			//bool ppcount;
			//bool p_count;
			//void setCount(bool ppcount);
			//bool pppcount() const {return p_count;}
			int m_variableIndex;
			std::wstring* m_variableName;
			TemplateParameter* m_variablesName;
			static NameValidator m_templateNameValidator;
			static NameValidator m_NameValidator;
			TemplateNameParser(const std::wstring& m_templateName);
			~TemplateNameParser(void);
			void matchPercent();
			bool isTemplateName();
			void start();
		        TemplateParameter* extractVariables();
			static TemplateParameter* getVariablesFromName(const std::wstring& name);
			//TemplateParameter* TemplateNameParser::processTemplateName();
			void RemoveOthers();
			int getPercentCount();

	};
}
