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


C++ TextStream::toString方法代码示例

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


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

示例1: list

TEST(BPListTest, testPrint)
{
	BPList list("foo", 63, -10, 1000);
	string header = "[BPList]";

	TextStream stream;
	list.print(stream, 0, header);
	string expected =
		"[BPList]\n";
	EXPECT_EQ(expected, stream.toString());
	stream.close();

	stream = TextStream();
	list.add(480, 11);
	list.add(1920, 12);
	list.print(stream, 0, header);
	expected =
		"[BPList]\n"
		"480=11\n"
		"1920=12\n";
	EXPECT_EQ(expected, stream.toString());
	stream.close();

	stream = TextStream();
	list.print(stream, 1921, header);
	expected =
		"[BPList]\n"
		"1921=12\n";
	EXPECT_EQ(expected, stream.toString());
}
开发者ID:kbinani,项目名称:libvsq,代码行数:30,代码来源:BPListTest.cpp

示例2: testWrite

 void testWrite(){
     Mixer mixer( 1, 2, 3, 4 );
     mixer.slave.push_back( MixerItem( 5, 6, 7, 8 ) );
     mixer.slave.push_back( MixerItem( 9, 10, 11, 12 ) );
     TextStream stream;
     mixer.write( stream );
     std::string expected =
         "[Mixer]\n"
         "MasterFeder=1\n"
         "MasterPanpot=2\n"
         "MasterMute=3\n"
         "OutputMode=4\n"
         "Tracks=2\n"
         "Feder0=5\n"
         "Panpot0=6\n"
         "Mute0=7\n"
         "Solo0=8\n"
         "Feder1=9\n"
         "Panpot1=10\n"
         "Mute1=11\n"
         "Solo1=12\n";
     CPPUNIT_ASSERT_EQUAL( expected, stream.toString() );
 }
开发者ID:qtau-devgroup,项目名称:libvsq,代码行数:23,代码来源:MixerTest.cpp


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