mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Use first() and last() methods in primitiveEntry.
This commit is contained in:
@ -60,34 +60,39 @@ Foam::primitiveEntry::primitiveEntry
|
||||
|
||||
Foam::label Foam::primitiveEntry::startLineNumber() const
|
||||
{
|
||||
if (size())
|
||||
const tokenList& tokens = *this;
|
||||
|
||||
if (tokens.empty())
|
||||
{
|
||||
return operator[](0).lineNumber();
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
return tokens.first().lineNumber();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::primitiveEntry::endLineNumber() const
|
||||
{
|
||||
if (size())
|
||||
const tokenList& tokens = *this;
|
||||
|
||||
if (tokens.empty())
|
||||
{
|
||||
return operator[](size()-1).lineNumber();
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
return tokens.last().lineNumber();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::ITstream& Foam::primitiveEntry::stream() const
|
||||
{
|
||||
ITstream& dataStream = const_cast<primitiveEntry&>(*this);
|
||||
dataStream.rewind();
|
||||
return dataStream;
|
||||
ITstream& is = const_cast<primitiveEntry&>(*this);
|
||||
is.rewind();
|
||||
return is;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user