// ServerSetting.cpp : CServerSetting ‚ÌŽÀ‘•

#include "stdafx.h"
#include "ServerSetting.h"
#include ".\serversetting.h"
#include ".\config.h"


// CServerSetting


STDMETHODIMP CServerSetting::WriteServerSetting(BSTR setting)
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	CConfig	temp;
	temp.FromString((char *)_bstr_t(setting));
	temp.SaveToFile(GET_APP()->GetAppPath() + "04WebServer.xml");

	return S_OK;
}

STDMETHODIMP CServerSetting::ReadServerSetting(BSTR* setting)
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	CConfig	temp;
	temp.LoadFromFile(GET_APP()->GetAppPath() + "04WebServer.xml");
	_bstr_t	info = temp.ToString();
	*setting = info.copy();

	return S_OK;
}

STDMETHODIMP CServerSetting::GetSettingFilePath(BSTR* path)
{
	AFX_MANAGE_STATE(AfxGetAppModuleState());

	_bstr_t	info = GET_APP()->GetAppPath() + "04WebServer.xml";
	*path = info.copy();

	return S_OK;
}
