本文整理汇总了C++中TextStream::writeLine方法的典型用法代码示例。如果您正苦于以下问题:C++ TextStream::writeLine方法的具体用法?C++ TextStream::writeLine怎么用?C++ TextStream::writeLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextStream
的用法示例。
在下文中一共展示了TextStream::writeLine方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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 );
}
示例3: write
/**
* @brief テキストストリームに出力する
* @param stream (TextStream) 出力先のストリーム
*/
void write( TextStream &stream ) const{
stream.writeLine( "[Mixer]" );
stream.writeLine( "MasterFeder=" + StringUtil::toString( this->masterFeder ) );
stream.writeLine( "MasterPanpot=" + StringUtil::toString( this->masterPanpot ) );
stream.writeLine( "MasterMute=" + StringUtil::toString( this->masterMute ) );
stream.writeLine( "OutputMode=" + StringUtil::toString( this->outputMode ) );
stream.writeLine( "Tracks=" + StringUtil::toString( this->slave.size() ) );
for( int i = 0; i < this->slave.size(); ++i ){
MixerItem item = this->slave[i];
stream.writeLine( "Feder" + StringUtil::toString( i ) + "=" + StringUtil::toString( item.feder ) );
stream.writeLine( "Panpot" + StringUtil::toString( i ) + "=" + StringUtil::toString( item.panpot ) );
stream.writeLine( "Mute" + StringUtil::toString( i ) + "=" + StringUtil::toString( item.mute ) );
stream.writeLine( "Solo" + StringUtil::toString( i ) + "=" + StringUtil::toString( item.solo ) );
}
}