本文整理汇总了C++中Ostream::format方法的典型用法代码示例。如果您正苦于以下问题:C++ Ostream::format方法的具体用法?C++ Ostream::format怎么用?C++ Ostream::format使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ostream
的用法示例。
在下文中一共展示了Ostream::format方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: word
void Foam::CSV<Type>::writeData(Ostream& os) const
{
DataEntry<Type>::writeData(os);
os << token::END_STATEMENT << nl;
os << indent << word(type() + "Coeffs") << nl;
os << indent << token::BEGIN_BLOCK << incrIndent << nl;
// Note: for TableBase write the dictionary entries it needs but not
// the values themselves
TableBase<Type>::writeEntries(os);
os.writeKeyword("hasHeaderLine") << headerLine_ << token::END_STATEMENT
<< nl;
os.writeKeyword("refColumn") << refColumn_ << token::END_STATEMENT << nl;
// Force writing labelList in ascii
os.writeKeyword("componentColumns");
if (os.format() == IOstream::BINARY)
{
os.format(IOstream::ASCII);
os << componentColumns_;
os.format(IOstream::BINARY);
}
os << token::END_STATEMENT << nl;
os.writeKeyword("separator") << string(separator_)
<< token::END_STATEMENT << nl;
os.writeKeyword("fileName") << fName_ << token::END_STATEMENT << nl;
os << decrIndent << indent << token::END_BLOCK << endl;
}
示例2:
void Foam::fanFvPatchField<Type>::write(Ostream& os) const
{
fixedJumpFvPatchField<Type>::write(os);
IOstream::streamFormat fmt0 = os.format(IOstream::ASCII);
os.writeKeyword("f") << f_ << token::END_STATEMENT << nl;
os.format(fmt0);
this->writeEntry("value", os);
}
示例3: writeBanner
bool Foam::IOobject::writeHeader(Ostream& os, const word& type) const
{
if (!os.good())
{
Info<< "IOobject::writeHeader(Ostream&) : "
<< "no stream open for write" << nl
<< os.info() << endl;
return false;
}
writeBanner(os)
<< "FoamFile\n{\n"
<< " version " << os.version() << ";\n"
<< " format " << os.format() << ";\n"
<< " class " << type << ";\n";
if (note().size())
{
os << " note " << note() << ";\n";
}
os << " location " << instance()/local() << ";\n"
<< " object " << name() << ";\n"
<< "}" << nl;
writeDivider(os) << endl;
return true;
}
示例4: writeEntry
void Foam::csvTableReader<Type>::write(Ostream& os) const
{
tableReader<Type>::write(os);
writeEntry(os, "hasHeaderLine", headerLine_);
writeEntry(os, "timeColumn", timeColumn_);
// Force writing labelList in ascii
os.writeKeyword("valueColumns");
if (os.format() == IOstream::BINARY)
{
os.format(IOstream::ASCII);
os << componentColumns_;
os.format(IOstream::BINARY);
}
os << token::END_STATEMENT << nl;
writeEntry(os, "separator", string(separator_));
}