#include "pch.h"
#include "MxHead.h"
#include "MxDxf.h"
#include "MxReadOpt.h"
#include "MxWriteOpt.h"

CMxDxf CMxDxf::s_instance;

CMxDxf::CMxDxf(void)
{
}

CMxDxf::~CMxDxf(void)
{
}


Mcad::ErrorStatus 
		CMxDxf::readDxfFile(void* pVoid,
		LPCTSTR pszFileName
		)
{
	MxReadOpt readOpt;
	
	McDbDatabase* pDatabase = (McDbDatabase*)(pVoid);

	if(readOpt.Do(pDatabase,pszFileName) )
	{
		return Mcad::eOk;
	}
	else
	{
		return Mcad::eInvalidInput;
	}
}

Mcad::ErrorStatus 
CMxDxf::writeDxfFile(void* pDatabase,
			 LPCTSTR pszFileName
			 )
{
	MxWriteOpt writeOpt;
	if(writeOpt.Do((McDbDatabase*)pDatabase,pszFileName) )
	{
		return Mcad::eOk;
	}
	else
	{
		return Mcad::eInvalidInput;
	}
}


IMxDxf::Version CMxDxf::GetApiVersion()
{

	return IMxDxf::k1_0;
}
