コード例 #1
0
ファイル: CColRefSet.cpp プロジェクト: MoZhonghua/gporca
//---------------------------------------------------------------------------
//	@function:
//		CColRefSet::OsPrint
//
//	@doc:
//		Helper function to print a colref set
//
//---------------------------------------------------------------------------
IOstream &
CColRefSet::OsPrint
	(
	IOstream &os,
	ULONG ulLenMax
	)
	const
{
	ULONG ulLen = CElements();
	ULONG ul = 0;
	
	CColRefSetIter crsi(*this);
	while(crsi.FAdvance() && ul < std::min(ulLen, ulLenMax))
	{
		CColRef *pcr = crsi.Pcr();
		pcr->OsPrint(os);
		if (ul < ulLen - 1)
		{
			os << ", ";
		}
		ul++;
	}
	
	if (ulLenMax < ulLen)
	{
		os << "...";
	}

	return os;
}