本文整理汇总了C++中CWStringDynamic::FEquals方法的典型用法代码示例。如果您正苦于以下问题:C++ CWStringDynamic::FEquals方法的具体用法?C++ CWStringDynamic::FEquals怎么用?C++ CWStringDynamic::FEquals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CWStringDynamic
的用法示例。
在下文中一共展示了CWStringDynamic::FEquals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: strExpectedIndented
//---------------------------------------------------------------------------
// @function:
// CXMLSerializerTest::EresUnittest_Basic
//
// @doc:
// Testing XML serialization
//
//---------------------------------------------------------------------------
GPOS_RESULT
CXMLSerializerTest::EresUnittest_Basic()
{
CAutoMemoryPool amp;
IMemoryPool *pmp = amp.Pmp();
// test XML serializer with indentation
CWStringDynamic *pstrIndented = Pstr(pmp, true /* fIndent */);
CWStringConst strExpectedIndented(GPOS_WSZ_LIT("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<dxl:Plan>\n <Subplan/>\n</dxl:Plan>\n"));
GPOS_RESULT eresIndented = GPOS_FAILED;
if (pstrIndented->FEquals(&strExpectedIndented))
{
eresIndented = GPOS_OK;
}
// test XML serializer without indentation
CWStringDynamic *pstrNotIndented = Pstr(pmp, false /* fIndent */);
CWStringConst strExpectedNotIndented(GPOS_WSZ_LIT("<?xml version=\"1.0\" encoding=\"UTF-8\"?><dxl:Plan><Subplan/></dxl:Plan>"));
GPOS_RESULT eresNotIndented = GPOS_FAILED;
if (pstrNotIndented->FEquals(&strExpectedNotIndented))
{
eresNotIndented = GPOS_OK;
}
GPOS_DELETE(pstrIndented);
GPOS_DELETE(pstrNotIndented);
if (GPOS_FAILED == eresIndented || GPOS_FAILED == eresNotIndented)
{
return GPOS_FAILED;
}
return GPOS_OK;
}