本文整理汇总了C++中Istream::version方法的典型用法代码示例。如果您正苦于以下问题:C++ Istream::version方法的具体用法?C++ Istream::version怎么用?C++ Istream::version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Istream
的用法示例。
在下文中一共展示了Istream::version方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: entry
Foam::primitiveEntry::primitiveEntry(const keyType& key, Istream& is)
:
entry(key),
ITstream
(
is.name() + '.' + key,
tokenList(10),
is.format(),
is.version()
)
{
readEntry(dictionary::null, is);
}
示例2: firstToken
bool Foam::IOobject::readHeader(Istream& is)
{
if (IOobject::debug)
{
Info<< "IOobject::readHeader(Istream&) : reading header for file "
<< is.name() << endl;
}
// Check Istream not already bad
if (!is.good())
{
if (rOpt_ == MUST_READ || rOpt_ == MUST_READ_IF_MODIFIED)
{
FatalIOErrorIn("IOobject::readHeader(Istream&)", is)
<< " stream not open for reading essential object from file "
<< is.name()
<< exit(FatalIOError);
}
if (IOobject::debug)
{
SeriousIOErrorIn("IOobject::readHeader(Istream&)", is)
<< " stream not open for reading from file "
<< is.name() << endl;
}
return false;
}
token firstToken(is);
if
(
is.good()
&& firstToken.isWord()
&& firstToken.wordToken() == "FoamFile"
)
{
dictionary headerDict(is);
is.version(headerDict.lookup("version"));
is.format(headerDict.lookup("format"));
headerClassName_ = word(headerDict.lookup("class"));
const word headerObject(headerDict.lookup("object"));
if (IOobject::debug && headerObject != name())
{
IOWarningIn("IOobject::readHeader(Istream&)", is)
<< " object renamed from "
<< name() << " to " << headerObject
<< " for file " << is.name() << endl;
}
// The note entry is optional
headerDict.readIfPresent("note", note_);
}
else
{
SeriousIOErrorIn("IOobject::readHeader(Istream&)", is)
<< "First token could not be read or is not the keyword 'FoamFile'"
<< nl << nl << "Check header is of the form:" << nl << endl;
writeHeader(Info);
return false;
}
// Check stream is still OK
if (is.good())
{
objState_ = GOOD;
}
else
{
if (rOpt_ == MUST_READ || rOpt_ == MUST_READ_IF_MODIFIED)
{
FatalIOErrorIn("IOobject::readHeader(Istream&)", is)
<< " stream failure while reading header"
<< " on line " << is.lineNumber()
<< " of file " << is.name()
<< " for essential object" << name()
<< exit(FatalIOError);
}
if (IOobject::debug)
{
Info<< "IOobject::readHeader(Istream&) :"
<< " stream failure while reading header"
<< " on line " << is.lineNumber()
<< " of file " << is.name() << endl;
}
objState_ = BAD;
return false;
}
if (IOobject::debug)
{
Info<< " .... read" << endl;
//.........这里部分代码省略.........