当前位置: 首页>>代码示例>>C++>>正文


C++ CWStringDynamic::AppendFormat方法代码示例

本文整理汇总了C++中CWStringDynamic::AppendFormat方法的典型用法代码示例。如果您正苦于以下问题:C++ CWStringDynamic::AppendFormat方法的具体用法?C++ CWStringDynamic::AppendFormat怎么用?C++ CWStringDynamic::AppendFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CWStringDynamic的用法示例。


在下文中一共展示了CWStringDynamic::AppendFormat方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CWStringDynamic

//---------------------------------------------------------------------------
//	@function:
//		IMDRelation::PstrColumns
//
//	@doc:
//		Serialize an array of column ids into a comma-separated string
//
//---------------------------------------------------------------------------
CWStringDynamic *
IMDRelation::PstrColumns
	(
	IMemoryPool *pmp,
	DrgPul *pdrgpul
	)
{
	CWStringDynamic *pstr = GPOS_NEW(pmp) CWStringDynamic(pmp);

	ULONG ulLen = pdrgpul->UlLength();
	for (ULONG ul = 0; ul < ulLen; ul++)
	{
		ULONG ulId = *((*pdrgpul)[ul]);
		if (ul == ulLen - 1)
		{
			// last element: do not print a comma
			pstr->AppendFormat(GPOS_WSZ_LIT("%d"), ulId);
		}
		else
		{
			pstr->AppendFormat(GPOS_WSZ_LIT("%d%ls"), ulId, CDXLTokens::PstrToken(EdxltokenComma)->Wsz());
		}
	}

	return pstr;
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:34,代码来源:IMDRelation.cpp

示例2: CWStringDynamic

//---------------------------------------------------------------------------
//	@function:
//		CMDFunctionGPDB::PstrOutArgTypes
//
//	@doc:
//		Serialize the array of output argument types into a comma-separated string
//
//---------------------------------------------------------------------------
CWStringDynamic *
CMDFunctionGPDB::PstrOutArgTypes() const
{
	GPOS_ASSERT(NULL != m_pdrgpmdidTypes);
	CWStringDynamic *pstr = GPOS_NEW(m_pmp) CWStringDynamic(m_pmp);

	const ULONG ulLen = m_pdrgpmdidTypes->UlLength();
	for (ULONG ul = 0; ul < ulLen; ul++)
	{
		IMDId *pmdid = (*m_pdrgpmdidTypes)[ul];
		if (ul == ulLen - 1)
		{
			// last element: do not print a comma
			pstr->AppendFormat(GPOS_WSZ_LIT("%ls"), pmdid->Wsz());
		}
		else
		{
			pstr->AppendFormat(GPOS_WSZ_LIT("%ls%ls"), pmdid->Wsz(), CDXLTokens::PstrToken(EdxltokenComma)->Wsz());
		}
	}

	return pstr;
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:31,代码来源:CMDFunctionGPDB.cpp

示例3: CWStringDynamic

//---------------------------------------------------------------------------
//	@function:
//		CDXLPhysicalMotion::PstrSegIds
//
//	@doc:
//		Serialize the array of segment ids into a comma-separated string		
//
//---------------------------------------------------------------------------
CWStringDynamic *
CDXLPhysicalMotion::PstrSegIds(const DrgPi *pdrgpi) const
{
	GPOS_ASSERT(pdrgpi != NULL && 0 < pdrgpi->UlLength());
	
	CWStringDynamic *pstr = GPOS_NEW(m_pmp) CWStringDynamic(m_pmp);
	
	ULONG ulNumSegments = pdrgpi->UlLength();
	for (ULONG ul = 0; ul < ulNumSegments; ul++)
	{
		INT iSegId = *((*pdrgpi)[ul]);
		if (ul == ulNumSegments - 1)
		{
			// last element: do not print a comma
			pstr->AppendFormat(GPOS_WSZ_LIT("%d"), iSegId);
		}
		else
		{
			pstr->AppendFormat(GPOS_WSZ_LIT("%d%ls"), iSegId, CDXLTokens::PstrToken(EdxltokenComma)->Wsz());
		}
	}
	
	return pstr;
}
开发者ID:MoZhonghua,项目名称:gporca,代码行数:32,代码来源:CDXLPhysicalMotion.cpp

示例4: strName

//---------------------------------------------------------------------------
//	@function:
//		CColumnFactory::PcrCreate
//
//	@doc:
//		Variant without name for computed columns
//
//---------------------------------------------------------------------------
CColRef *
CColumnFactory::PcrCreate
	(
	const IMDType *pmdtype
	)
{
	// increment atomic counter
	ULONG ulId = m_aul.TIncr();
	
	WCHAR wszFmt[] = GPOS_WSZ_LIT("ColRef_%04d");
	CWStringDynamic *pstrTempName = GPOS_NEW(m_pmp) CWStringDynamic(m_pmp);
	CAutoP<CWStringDynamic> a_pstrTempName(pstrTempName);
	pstrTempName->AppendFormat(wszFmt, ulId);
	CWStringConst strName(pstrTempName->Wsz());
	return PcrCreate(pmdtype, ulId, CName(&strName));
}
开发者ID:HanumathRao,项目名称:gporca,代码行数:24,代码来源:CColumnFactory.cpp

示例5: strName

//---------------------------------------------------------------------------
//	@function:
//		CColumnFactory::PcrCreate
//
//	@doc:
//		Variant without name for computed columns
//
//---------------------------------------------------------------------------
CColRef *
CColumnFactory::PcrCreate
	(
	const IMDType *pmdtype,
	INT type_modifier
	)
{
	// increment atomic counter
	ULONG id = m_aul.Incr();
	
	WCHAR wszFmt[] = GPOS_WSZ_LIT("ColRef_%04d");
	CWStringDynamic *pstrTempName = GPOS_NEW(m_mp) CWStringDynamic(m_mp);
	CAutoP<CWStringDynamic> a_pstrTempName(pstrTempName);
	pstrTempName->AppendFormat(wszFmt, id);
	CWStringConst strName(pstrTempName->GetBuffer());
	return PcrCreate(pmdtype, type_modifier, id, CName(&strName));
}
开发者ID:b-xiang,项目名称:gporca,代码行数:25,代码来源:CColumnFactory.cpp


注:本文中的CWStringDynamic::AppendFormat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。