#include "stdafx.h"
#include "4Document.h"			// For MC4Document.
#include "4ObjBase.h"			// For MC4ObjBase.
#include "4ToolManager.h"		// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

MC4ToolManager::MC4ToolManager ()
{
} // MC4ToolManager::MC4ToolManager.

MC4ToolManager::~MC4ToolManager ()
{
} // MC4ToolManager::~MC4ToolManager.

void MC4ToolManager::InStream (CArchive& ar)
{
	// _xZkqqHx_iDgPiDgCiDhEiDeAiCpAiDeOiDiKiDeBiBeC_xHqqkZx_
	m_vBuff.clear();

	BYTE byTool;
	WORD wDataSize;
	for (;;)
	{
		// _xZkqqHx_iDgDiBfLiDiL_xHqqkZx_ID_xZkqqHx_iCpAjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
		ar >> byTool;
		// _xZkqqHx_iDgDiBfLiDiL_xHqqkZx_ID_xZkqqHx_iCpAiLeMjIfOiBeC_xHqqkZx_
		m_vBuff << byTool;

		// _xZkqqHx_iPeJjHlJiDhNiBfLiDeOiCmIiCoHiCmOiDiLiBfLiDhGiCpAiPeJjHlJiBeC_xHqqkZx_
		if (byTool == BYTE(-1)) break;

		// _xZkqqHx_iDgGiBfLiDfOiDfEiDeDiDfJiCpAjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
		ar >> wDataSize;
		// _xZkqqHx_iDgGiBfLiDfOiDfEiDeDiDfJiCpAiLeMjIfOiBeC_xHqqkZx_
		m_vBuff << wDataSize;

		if (wDataSize != 0)
		//----- _xZkqqHx_iDgGiBfLiDfOiCkKiCkAiCoJiPoKiNiH_xHqqkZx_ -----
		{
			// _xZkqqHx_iDgGiBfLiDfOiCpAjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
			long lTopIndex = m_vBuff.size();
			m_vBuff.resize(lTopIndex + wDataSize);
			ar.Read(&m_vBuff.at(lTopIndex), wDataSize);
		}
	}
} // MC4ToolManager::InStream.

void MC4ToolManager::OutStream (CArchive& ar)
{
	ar.Write(&m_vBuff.front(), m_vBuff.size());
} // MC4ToolManager::OutStream.

