本文整理汇总了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());
}
示例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() );
}