// PropertyListCodeGenerator.cpp : Defines the entry point for the console application.
//
#include <tchar.h>
#include "NDTSRS2a.h"
#include "CodeGenerator.h"

using namespace NDTS::SCO;

using namespace std;
int _tmain(int argc, _TCHAR* argv[]) 
{
	cout << "start";
	NDTS::SCO::Property *pRoot = NDTS::RS2A::Factory::getInstance()->getRootProperty();
	CodeGenerator codeGenerator(dynamic_cast<NDTS::SCO::GroupProperty*>(pRoot));
	cout << "Generating RS2APropertyVariables.h\n";
	const char *pRootDeclaration = "Factory *pFactory = Factory::getInstance();\n      pRoot = dynamic_cast<GroupProperty*>(pFactory->getRootProperty());\n";
	codeGenerator.createCPPHeaderFile("RS2APropertyVariables.h", "RS2A", pRootDeclaration, codeGenerator.Unmanaged);
	cout << "Generating RS2AEnumPropertyNames.h\n";
	codeGenerator.createEnumHeaderFile("RS2AEnumPropertyNames.h", "RS2A", codeGenerator.Unmanaged);
	cout << "Generating managed files\n";
	const char *pManagedRootDeclaration = "RootProperty ^pFactory; \n      root = dynamic_cast<GroupProperty^>(pFactory->getRootProperty());";
	codeGenerator.createCPPHeaderFile("RS2AManagedPropertyVariables.h", "RS2A", pManagedRootDeclaration, codeGenerator.Managed);
	codeGenerator.createEnumHeaderFile("RS2AManagedEnumPropertyNames.h", "RS2A", codeGenerator.Managed);
	cout << "Auto file generation complete\n";
	return 0;
	
}


