Example #1
0
void TABLE_BASE::In(IntArray& para)
{
		int nBlockLen = g_pLineDataDisposer->MoveBlock();
	if (nBlockLen == 0)
	{
		smTableGood = false;
		Assert(false);
		return ;
	}

	int nIntCount = 0;		
	for (int i=0;i<nBlockLen;++i)
	{
		if (g_pLineDataDisposer->m_BlockData[i] == '|')
		{
			nIntCount++;
		}
	}
	para.SetCount(nIntCount+1);
	para.Init();

	char pBuf[BUFF_LEN_32] = {};
	const char* pChar = g_pLineDataDisposer->m_BlockData;
	int iBufIndex = 0;
	int iIntIndex = 0;
	for (int i=0;i<nBlockLen;++i)
	{
		if (g_pLineDataDisposer->m_BlockData[i] != '|')
		{
			pBuf[iBufIndex] = g_pLineDataDisposer->m_BlockData[i];
			iBufIndex++;
		}
		else
		{
			bool bRet = CTools::StringToInt(pBuf, para[iIntIndex++]);
			if (!bRet)
			{
				smTableGood = false;
				return;
			}
			memset(pBuf, 0, sizeof(pBuf));
			iBufIndex = 0;
		}
	}
	bool bRet = CTools::StringToInt(pBuf, para[iIntIndex]);
	if (!bRet)
	{
		smTableGood = false;
		return;
	}
}