Example #1
0
// The depenfunc is a recursive function which initially determines the direct dependencies from the xml file inputted
// and later recursive call is made to the same function and the indirect dependencies are also determined.
void depenfunc(stdStr depenname)
{
	Container cc;
	static std::vector<std::string> vect;
	cc.SetKey(Convert::ToString(depenname));
	if(depenname!=Convert::ToStdStr("none"))
	{
	for (unsigned i=0;i<headervec.size();i++)
		{
			if(headervec[i] == depenname)
			{
			  
			  stdStr tempstd = headervec[i];
			  std::string temp = Convert::ToString(tempstd);
			  temp.append(".xml");
			  Parser::Parsing(temp);
			 }
		}
	}
	    vect = cc.GetVector();
		vector<std::string>::iterator it1;
		std::string keee = cc.GetKey();
		static std::vector<std::string> remover;
		remover.push_back(keee);
		cc.SetRVector(remover);
		for(unsigned i=0;i<remover.size();i++)
		{
		it1 = find(vect.begin(),vect.end(),remover[i]);
		if(it1!=vect.end())
		{
			vect.erase(it1);
		}
		}
		cc.SetVector(vect);
		if(vect.size()!=0)
		{
         for (unsigned it = 0;it<vect.size();it++)
		{
			
			depenfunc(Convert::ToStdStr(vect[it])); // the recursive call of the function
		}
		}
	}