#include "ParameterParser.h"
#include <iostream>

namespace DFF_VideoMat
{

CParameterParser::CParameterParser()
{
	m_actfile = "";
	m_DspMax=0.02f;
	m_DspMin=0.001f;
}


bool CParameterParser::ReadParaFile(const char* filename)
{
	std::ifstream inputfile(filename);
	if(!inputfile)
	{
		printf("Can't open this file!\n");
		return false;
	}

	char paraname[100];
	inputfile>>paraname;
	while(!inputfile.eof())
	{
		if(strcmp(paraname,"ACTFile")==0)
		{
			char tmp[200];
			inputfile>>tmp;
			m_actfile = std::string(tmp);

		}
		else if(strcmp(paraname,"DspMax")==0)
		{
			inputfile>>m_DspMax; 

		}
		else if(strcmp(paraname,"DspMin")==0)
		{
			inputfile>>m_DspMin;

		}
		else
		{
			printf("Can't recognize!\n");
			return false;
		}
		inputfile>>paraname;
	}

	return true;
}

}