#pragma once

#include <stdlib.h>

class CCommonObject;
class CBlock;
class CINKSDoc;

class CXmlCreator
{
public:
	CXmlCreator();
	~CXmlCreator();
	void Reset();
	stringstream& WriteProject(CString strProjectName, CINKSDoc *pProjectDoc);
	stringstream& WriteScheme(CString strSchemeName, CList<CCommonObject*, CCommonObject*> *pList);
	stringstream& WriteBlock(CString strBlockName, CList<CCommonObject*, CCommonObject*> *pList, CBlock *pBlock);

private:
	void WriteElement(CCommonObject *pObj, stringstream &ss, int nLevel = 1);
	void WriteBlockDrawing(CList<CCommonObject*, CCommonObject*> *pList, stringstream &ss);

public:

private:
	stringstream ss;

	CList<CCommonObject*, CCommonObject*> *m_pList;
	CBlock *m_pNewBlock;

	CString m_strName;
	CString m_strType;
	CString m_strOrigin;
};
