• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ endl函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中endl函数的典型用法代码示例。如果您正苦于以下问题:C++ endl函数的具体用法?C++ endl怎么用?C++ endl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: endl

FormattedOutput& FormattedOutput::print(const char* str, size_t len) {
	for (size_t i = 0; i < len; ++i) {
		if (str[i] == '{') {
			line_ << '{';
			++offset_;
			endl();
		}
		else if (str[i] == '}') {
			endl();
			--offset_;
			print_offset();
			line_ << '}';
			endl();
		}
		else {
			if (line_.str().empty() && !std::isspace(str[i])) {
				print_offset();
				line_ << str[i];
			}
			else if (!line_.str().empty())
				line_ << str[i];
		}
	}
	return *this;
}
开发者ID:aptakhin,项目名称:jt,代码行数:25,代码来源:llvm.cpp


示例2: ALOGE

status_t ArcHmbPlayerBinder::onTransact(uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) {
    ALOGE("ArcHmbPlayerBinder::onTransact(%i) %i", code, flags);
    /*
     * Before executing actual method, check whether the RPC are from expected client.
     * Client will write interface token, to identify interface to which those methods
     * belong.
     */
    if (!data.enforceInterface(ArcHmbPlayerInterface::DESCRIPTOR)) {
        ALOGE("failed to check Interface, you might call wrong service, this is for '%s'",
                String8(ArcHmbPlayerInterface::DESCRIPTOR).string());
        return BAD_TYPE;
    }
    data.print(aout);
    endl(aout);

    switch(code) {
    case ArcHmbPlayerInterface::PRINT: {
        String16 msg = data.readString16();
        print(String8(msg).string());
        return NO_ERROR;
    }
    case ArcHmbPlayerInterface::ADD: {
        int32_t a = data.readInt32();
        int32_t b = data.readInt32();
        int32_t sum = add(a, b);
        ALOGE("ArcHmbPlayerBinder:onTransact add(%i, %i) = %i", a, b, sum);
        reply->print(aout); endl(aout);
        reply->writeInt32(sum);
        return NO_ERROR;
    }
    default:
        ALOGE("ArcHmbPlayerBinder, bad requesting code, no match found");
    }
    return BBinder::onTransact(code, data, reply, flags);
}
开发者ID:awaysu,项目名称:android_binder_native_sample,代码行数:35,代码来源:ArcHmbPlayerBinder.cpp


示例3: ts

void ScribusQApp::showUsage()
{
	QFile f;
	f.open(stderr, QIODevice::WriteOnly);
	QTextStream ts(&f);
	ts << tr("Usage: scribus [option ... ] [file]") ; endl(ts);
	ts << tr("Options:") ; endl(ts);
	printArgLine(ts, ARG_FONTINFO_SHORT, ARG_FONTINFO, tr("Show information on the console when fonts are being loaded") );
	printArgLine(ts, ARG_HELP_SHORT, ARG_HELP, tr("Print help (this message) and exit") );
	printArgLine(ts, ARG_LANG_SHORT, ARG_LANG, tr("Uses xx as shortcut for a language, eg `en' or `de'") );
	printArgLine(ts, ARG_AVAILLANG_SHORT, ARG_AVAILLANG, tr("List the currently installed interface languages") );
	printArgLine(ts, ARG_NOSPLASH_SHORT, ARG_NOSPLASH, tr("Do not show the splashscreen on startup") );
	printArgLine(ts, ARG_NEVERSPLASH_SHORT, ARG_NEVERSPLASH, tr("Stop the showing of the splashscreen on startup. Writes an empty file called .neversplash in ~/.scribus.") );
	printArgLine(ts, ARG_PREFS_SHORT, QString(QString(ARG_PREFS) + QString(" ") + tr("filename")).toLocal8Bit().constData(), tr("Use filename as path for user given preferences") );
	printArgLine(ts, ARG_PROFILEINFO_SHORT, ARG_PROFILEINFO, tr("Show location ICC profile information on console while starting") );
	printArgLine(ts, ARG_SWAPDIABUTTONS_SHORT, ARG_SWAPDIABUTTONS, tr("Use right to left dialog button ordering (eg. Cancel/No/Yes instead of Yes/No/Cancel)") );
	printArgLine(ts, ARG_UPGRADECHECK_SHORT, ARG_UPGRADECHECK, tr("Download a file from the Scribus website and show the latest available version.") );
	printArgLine(ts, ARG_VERSION_SHORT, ARG_VERSION, tr("Output version information and exit") );
	
	
#if defined(_WIN32) && !defined(_CONSOLE)
	printArgLine(ts, ARG_CONSOLE_SHORT, ARG_CONSOLE, tr("Display a console window") );
#endif
/* Delete me?
	std::cout << "-file|-- name Open file 'name'" ; endl(ts);
	std::cout << "name          Open file 'name', the file name must not begin with '-'" ; endl(ts);
	std::cout << "QT specific options as -display ..." ; endl(ts);
*/
	endl(ts);
}
开发者ID:AlterScribus,项目名称:ece15,代码行数:30,代码来源:scribusapp.cpp


示例4: popStack

void
ZDriver::writeParserUtilDecl( std::ostream &out )
{
	out << "    void popStack( void );" << endl();
	out << "    ParserAct findParserAction( int &newVal, int tok );"
		<< endl();
	out << "    void initTables( void );" << endl();
}
开发者ID:iangodin,项目名称:lime,代码行数:8,代码来源:ZDriver.cpp


示例5: endl

void
ZDriver::emitFuncBreak( std::ostream &out )
{
	out << endl();
	out << endl();
	out << "////////////////////////////////////////" << endl();
	out << endl();
	out << endl();
}
开发者ID:iangodin,项目名称:lime,代码行数:9,代码来源:ZDriver.cpp


示例6: ts

void LanguageManager::printInstalledList()
{
	QFile f;
	f.open(stderr, QIODevice::WriteOnly);
	QTextStream ts(&f);
	for (int i = 0; i < langTable.size(); ++i)
	{
		ts << "  " << langTable[i].m_priAbbrev.leftJustified(8) << ": " << langTable[i].m_name;
		endl(ts);
	}
	endl(ts);
	f.close();
}
开发者ID:QuLogic,项目名称:scribus,代码行数:13,代码来源:langmgr.cpp


示例7: getValue

void
ZDriver::writeAcceptFuncDecl( std::ostream &out )
{
	const std::string &extraArg = getValue( "extra_argument" ).first;

	if ( isValueSet( "parse_accept" ) )
	{
		if ( extraArg.empty() )
			out << "    void accept( void );" << endl();
		else
			out << "    void accept( " << extraArg << " );" << endl();
	}
}
开发者ID:iangodin,项目名称:lime,代码行数:13,代码来源:ZDriver.cpp


示例8: ts

void ScribusQApp::showAvailLangs()
{
	QFile f;
	f.open(stderr, QIODevice::WriteOnly);
	QTextStream ts(&f);
	ts << tr("Installed interface languages for Scribus are as follows:"); endl(ts);
	endl(ts);

	LanguageManager::instance()->printInstalledList();

	endl(ts);
	ts << tr("To override the default language choice:"); endl(ts);
	ts << tr("scribus -l xx or scribus --lang xx, where xx is the language of choice."); endl(ts);
}
开发者ID:alanz,项目名称:scribus,代码行数:14,代码来源:scribusapp.cpp


示例9: tr

void LogBrowserDialog::save()
{
	QString saveFileName = QFileDialog::getSaveFileName(this, tr("Save Log Output"),
														tr("%1/logfile.txt").arg(QDir::homePath()),
														tr("Text Files (*.txt);;All Files (*)"));

	if (saveFileName.isEmpty()) {
		return;
	}

	QFile file(saveFileName);
	if (!file.open(QIODevice::WriteOnly)) {
		QMessageBox::warning(this, tr("Error"), QString(tr("<nobr>File '%1'<br/>cannot be opened for writing.<br/><br/>"
														   "The log output could <b>not</b> be saved!</nobr>")).arg(saveFileName));
		return;
	}

	QTextStream stream(&file);
	for (int row = 0; row < _browser->rowCount(); row++) {
		if (_browser->item(row, 0)) {
			stream << tr("Warning: ");
		}
		stream << _browser->item(row, 1)->text();
		endl(stream);
	}
	file.close();
}
开发者ID:VengefulVeggie,项目名称:Miam-Player,代码行数:27,代码来源:logbrowserdialog.cpp


示例10: emitFuncBreak

void
ZDriver::writeImplClassCtorDtor( std::ostream &out )
{
	emitFuncBreak( out );
	out << myPimplName << "::" << myPimplName
		<< "( void )" << endl();
	out << "    : myErrCount( -1 )" << endl();
	out << "{" << endl();
	out << "    initTables();" << endl();
	out << "}" << endl();

	emitFuncBreak( out );
	out << myPimplName << "::~" << myPimplName
		<< "( void )" << endl();
	out << "{" << endl();
	out << "    while ( ! myStack.empty() )" << endl();
	out << "        popStack();" << endl();
	out << "}" << endl();
}
开发者ID:iangodin,项目名称:lime,代码行数:19,代码来源:ZDriver.cpp


示例11: drawBar

	void drawBar()
	{
		out << "[";
		const unsigned stop = value * width / max;
		for(unsigned i = 0; i < width; ++i) {
			out << (i <= stop? '*' : ' ');
		}
		out << "] " << std::min<int>(100, value * 100 / max + 1) << "\n";
		endl();
	}
开发者ID:mrkline,项目名称:ece556-router,代码行数:10,代码来源:progress.hpp


示例12: f

bool PythonHandler::exportData(regina::NPacket* data, const QString& fileName,
        QWidget* parentWidget) const {
    regina::NScript* script = dynamic_cast<regina::NScript*>(data);

    QFile f(fileName);
    if (! f.open(QIODevice::WriteOnly)) {
        ReginaSupport::warn(parentWidget,
            QObject::tr("The export failed."), 
            QObject::tr("<qt>I could not write to the file <tt>%1</tt>.</qt>").
                arg(fileName.toHtmlEscaped()));
        return false;
    }
    QTextStream out(&f);

    out.setCodec(ReginaPrefSet::importExportCodec());

    // Write the name of the script.
    out << "### " << scriptMarker << ' ';
    out << QString(script->label().c_str());
    endl(out);
    out << "###";
    endl(out);

    // Output the value of each variable.
    unsigned long i;
    regina::NPacket* value;
    for (i = 0; i < script->countVariables(); i++) {
        value = script->variableValue(i);
        out << "### " << varMarker
            << QString(script->variableName(i).c_str())
            << ": " << (value ? QString(value->label().c_str()) : "");
        endl(out);
    }

    out << "###";
    endl(out);
    out << "### " << endMetadataMarker;
    endl(out);
    out << script->text().c_str();

    // All done!
    return true;
}
开发者ID:WPettersson,项目名称:regina,代码行数:43,代码来源:pythonhandler.cpp


示例13: main

int main()
{
    {
        testbuf<char> sb;
        std::ostream os(&sb);
        endl(os);
        assert(sb.str() == "\n");
        assert(sync_called == 1);
        assert(os.good());
    }
    {
        testbuf<wchar_t> sb;
        std::wostream os(&sb);
        endl(os);
        assert(sb.str() == L"\n");
        assert(sync_called == 2);
        assert(os.good());
    }
}
开发者ID:themiwi,项目名称:libcxx,代码行数:19,代码来源:endl.pass.cpp


示例14: endl

//-------------------------------------------------------------------------------------------------
// begin of new line
log& log::beginLine(int col, int style)
{
	if ( !isLineEnded )
	{
		*this << efont;
		endl( *this );
	}
	*this << font(col, style);
	isLineEnded = false;

	return *this;
}
开发者ID:rgde,项目名称:rgdengine,代码行数:14,代码来源:log.cpp


示例15: printArgLine

/*! \brief Format an arguments line for printing
Helper procedure */
static void printArgLine(QTextStream & ts, const char * smallArg,
						  const char* fullArg, const QString desc)
{
	const char* lineformat = "  %1, %2 %3";
	const int saw = 4;   // Short argument width
	const int aw = -18;   // Argument width (negative is left aligned)
	QString line = QString(lineformat)
		.arg(smallArg, saw)
		.arg(fullArg, aw)
		.arg(desc);
	ts << line;
	endl(ts);
}
开发者ID:AlterScribus,项目名称:ece15,代码行数:15,代码来源:scribusapp.cpp


示例16: endl

void LirchChannel::persist() const {
	if (stream) {
		int num_blocks = document->blockCount();
		QTextBlock block = document->begin();
		for (int i = 0; i < num_blocks; ++i) {
			endl(*stream << block.text());
			emit progress(i * 100 / num_blocks);
			block = block.next();
		}
		emit progress(100);
	}
	emit persisted();
}
开发者ID:hagemt,项目名称:Lirch,代码行数:13,代码来源:lirch_channel.cpp


示例17: ts

void ScribusQApp::showUsage()
{
	QFile f;
	f.open(stderr, QIODevice::WriteOnly);
	QTextStream ts(&f);
	ts << tr("Usage: scribus [options] [files]") ; endl(ts); endl(ts);
	ts << tr("Options:") ; endl(ts);
	printArgLine(ts, ARG_FONTINFO_SHORT, ARG_FONTINFO, tr("Show information on the console when fonts are being loaded") );
	printArgLine(ts, ARG_HELP_SHORT, ARG_HELP, tr("Print help (this message) and exit") );
	printArgLine(ts, ARG_LANG_SHORT, ARG_LANG, tr("Uses xx as shortcut for a language, eg `en' or `de'") );
	printArgLine(ts, ARG_AVAILLANG_SHORT, ARG_AVAILLANG, tr("List the currently installed interface languages") );
	printArgLine(ts, ARG_NOSPLASH_SHORT, ARG_NOSPLASH, tr("Do not show the splashscreen on startup") );
	printArgLine(ts, ARG_NEVERSPLASH_SHORT, ARG_NEVERSPLASH, tr("Stop showing the splashscreen on startup. Writes an empty file called .neversplash in ~/.scribus") );
	printArgLine(ts, ARG_PREFS_SHORT, qPrintable(QString("%1 <%2>").arg(ARG_PREFS).arg(tr("filename"))), tr("Use filename as path for user given preferences") );
	printArgLine(ts, ARG_PROFILEINFO_SHORT, ARG_PROFILEINFO, tr("Show location of ICC profile information on console while starting") );
	printArgLine(ts, ARG_UPGRADECHECK_SHORT, ARG_UPGRADECHECK, tr("Download a file from the Scribus website and show the latest available version") );
	printArgLine(ts, ARG_VERSION_SHORT, ARG_VERSION, tr("Output version information and exit") );
	printArgLine(ts, ARG_PYTHONSCRIPT_SHORT, qPrintable(QString("%1 <%2>").arg(ARG_PYTHONSCRIPT).arg(tr("filename"))), tr("Run filename in Python scripter") );
	printArgLine(ts, ARG_SCRIPTARG_SHORT, qPrintable(QString("%1 <%2> [%3]").arg(ARG_SCRIPTARG).arg(tr("argument")).arg(tr("value"))), tr("Argument passed on to python script, with an optional value, no effect without -py") );
	printArgLine(ts, ARG_NOGUI_SHORT, ARG_NOGUI, tr("Do not start GUI") );
	ts << (QString("     %1").arg(CMD_OPTIONS_END,-39)) << tr("Explicit end of command line options"); endl(ts);
 	
	
#if defined(_WIN32) && !defined(_CONSOLE)
	printArgLine(ts, ARG_CONSOLE_SHORT, ARG_CONSOLE, tr("Display a console window") );
#endif

#if WITH_TESTS
	printArgLine(ts, ARG_TESTS_SHORT, ARG_TESTS, tr("Run unit tests and exit") );
#endif

/* Delete me?
	std::cout << "-file|-- name Open file 'name'" ; endl(ts);
	std::cout << "name          Open file 'name', the file name must not begin with '-'" ; endl(ts);
	std::cout << "QT specific options as -display ..." ; endl(ts);
*/
	endl(ts);
	f.close();
}
开发者ID:berteh,项目名称:scribus,代码行数:39,代码来源:scribusapp.cpp


示例18: emitLineInfo

void
ZDriver::emitValue( const Producer::ValueSetting	&val,
					std::ostream					&out )
{
	if ( ! val.first.empty() )
	{
		emitLineInfo( getSourceFile(), val.second, out );
		out << val.first << endl();
		myCurLineNum += std::count_if( val.first.begin(), val.first.end(),
									   std::bind2nd( std::equal_to<char>(), '\n' ) );
		emitLineInfo( myFileName, getOutLine(), out );
	}
}
开发者ID:iangodin,项目名称:lime,代码行数:13,代码来源:ZDriver.cpp


示例19: switch

void BufferedFTPrinter::printOut(const size_t rows) {
  size_t row = rows;
  size_t column = 0;
  for (int lineType: _lines) {
	if (lineType < 0 && column > 0)
      FTPrinter::append(endl());
	switch(lineType) {
      case lineHeader:    FTPrinter::printHeader(); break;
      case lineFooter:    FTPrinter::printFooter();  break;
      case lineTableName: FTPrinter::printTableName(); break;
      default: //a data line
        if (row == 0) break;

		for (size_t i = 0; i < static_cast<size_t>(lineType); ++i) {
          FTPrinter::append( _columnFormats[column]).append(_columns[column]);
          ++column;
        }

		FTPrinter::append(endl());
	--row;
    }
  }
}
开发者ID:lordgeorg,项目名称:formatted-table-printer,代码行数:23,代码来源:BufferedFTPrinter.cpp


示例20: ValueReader

    // -----------------------------------------------------------------
    ValueReader(const core::ReaderInputPort& port)
    {
        assert( port.connectedOutput()->data() );

        _container = dynamic_cast<ValueContainerInterface<TValueType>* >(
                         port.data()
                     );
        if(!_container)
        {
            Debug::error() << "ValueReader<"
                           << types::str<ValueType>()
                           << ">::Constructor : "
                           << "enable to determine the Container type"
                           << endl();
        }
    }
开发者ID:holdensmagicalunicorn,项目名称:kiwi,代码行数:17,代码来源:ValueReader.hpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ endlog函数代码示例发布时间:2022-05-30
下一篇:
C++ endingSelection函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap