// PropertyListCodeGenerator.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "NDTS2100Sdk.h"
#include "CodeGenerator.h"

using namespace NDTS::SCO;
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	NDTS::SCO::Property *pRoot = NDTS::NDTS2100::Factory::getInstance()->getRootProperty();
	CodeGenerator codeGenerator(dynamic_cast<NDTS::SCO::GroupProperty*>(pRoot));
	cout << "Generating NDTS2100PropertyVariables.h\n";
	const char *pRootDeclaration = "Factory *pFactory = Factory::getInstance();\n      pRoot = dynamic_cast<GroupProperty*>(pFactory->getRootProperty());\n";
	codeGenerator.createCPPHeaderFile("NDTS2100PropertyVariables.h", "NDTS2100", pRootDeclaration, codeGenerator.Unmanaged);
	cout << "Generating NDTS2100EnumPropertyNames.h\n";
	codeGenerator.createEnumHeaderFile("NDTS2100EnumPropertyNames.h", "NDTS2100", codeGenerator.Unmanaged);
	cout << "Generating managed files\n";
	codeGenerator.createStringsHeaderFile("NDTS2100PropertyStrings.h", "NDTS2100", codeGenerator.Unmanaged);
	cout << "Generating managed files\n";
	const char *pManagedRootDeclaration = "RootProperty ^pFactory; \n	root = dynamic_cast<GroupProperty^>(pFactory->getRootProperty());";
	codeGenerator.createCPPHeaderFile("NDTS2100ManagedPropertyVariables.h", "NDTS2100", pManagedRootDeclaration, codeGenerator.Managed);
	codeGenerator.createEnumHeaderFile("NDTS2100ManagedEnumPropertyNames.h", "NDTS2100", codeGenerator.Managed);
	cout << "Auto file generation complete\n";
	return 0;
}

