本文整理汇总了C++中TextStream::setPointer方法的典型用法代码示例。如果您正苦于以下问题:C++ TextStream::setPointer方法的具体用法?C++ TextStream::setPointer怎么用?C++ TextStream::setPointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStream
的用法示例。
在下文中一共展示了TextStream::setPointer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testConstructFromStream
void testConstructFromStream(){
TextStream stream;
stream.writeLine( "MasterFeder=1" );
stream.writeLine( "MasterPanpot=2" );
stream.writeLine( "MasterMute=3" );
stream.writeLine( "OutputMode=4" );
stream.writeLine( "Tracks=1" );
stream.writeLine( "Feder0=5" );
stream.writeLine( "Panpot0=6" );
stream.writeLine( "Mute0=7" );
stream.writeLine( "Solo0=8" );
stream.setPointer( -1 );
std::string lastLine = "";
Mixer mixer( stream, lastLine );
CPPUNIT_ASSERT_EQUAL( (std::size_t)1, mixer.slave.size() );
CPPUNIT_ASSERT_EQUAL( 1, mixer.masterFeder );
CPPUNIT_ASSERT_EQUAL( 2, mixer.masterPanpot );
CPPUNIT_ASSERT_EQUAL( 3, mixer.masterMute );
CPPUNIT_ASSERT_EQUAL( 4, mixer.outputMode );
CPPUNIT_ASSERT_EQUAL( 5, mixer.slave[0].feder );
CPPUNIT_ASSERT_EQUAL( 6, mixer.slave[0].panpot );
CPPUNIT_ASSERT_EQUAL( 7, mixer.slave[0].mute );
CPPUNIT_ASSERT_EQUAL( 8, mixer.slave[0].solo );
}
示例2: list
TEST(BPListTest, testAppendFromText)
{
BPList list("foo", 63, -10, 1000);
TextStream stream;
stream.writeLine("0=11");
stream.writeLine("340=13");
stream.writeLine("480=17");
stream.writeLine("[foooo]");
stream.writeLine("481=19");
stream.setPointer(-1);
string lastLine = list.appendFromText(stream);
string expected = "0=11,340=13,480=17";
EXPECT_EQ(expected, list.data());
EXPECT_EQ(string("[foooo]"), lastLine);
}