CObArray <--> CObList

CObList の形式のデータを配列として処理したかったので,その相互変換(Sort_ind.hxx 内).


#ifdef		_MFC_VER
//*******************************************************************************
//	ObList	->	ObArray
//	Create	:	2017/10/30
//*******************************************************************************
inline	bool	To_ObArray	(const CObList& src,CObArray* dstAry)
{
	if (dstAry == NULL)		{	return	false ;		}
	dstAry->RemoveAll() ;
	{
		POSITION pos = src.GetHeadPosition();
		while (pos != NULL)	{
			CObject*	pObj = src.GetNext(pos);
			dstAry->Add(pObj) ;
			}
		}
	return	true ;
	}

//*******************************************************************************
//	ObArray	->	ObList
//	Create	:	2017/10/30
//*******************************************************************************
inline	bool	To_ObList	(const CObArray& src,CObList* dstLst)
{
	if (dstLst == NULL)		{	return	false ;		}
	dstLst->RemoveAll() ;
	{
		for (INT_PTR index=0 ; index<src.GetSize() ; index++) {
			CObject*	pObj = src[index] ;
			dstLst->AddTail(pObj) ;
			}
		}
	return	true ;
	}

#endif	//	_MFC_VER
カテゴリー: MFC, メモ パーマリンク

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です