mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: failsafe version of Istream peek()
- return undefinedToken on error STYLE: fix slicing of ITstream from dictionary lookup
This commit is contained in:
@ -52,7 +52,7 @@ Foam::Function1Types::Constant<Type>::Constant
|
||||
Function1<Type>(entryName, dict),
|
||||
value_(Zero)
|
||||
{
|
||||
Istream& is = dict.lookup(entryName);
|
||||
ITstream& is = dict.lookup(entryName);
|
||||
word entryType(is);
|
||||
is >> value_;
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ Foam::Function1<Type>::New
|
||||
// - non-word : value for constant function
|
||||
// - word : the modelType
|
||||
|
||||
Istream& is = eptr->stream();
|
||||
ITstream& is = eptr->stream();
|
||||
|
||||
token firstToken(is);
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ Foam::Function1Types::Polynomial<Type>::Polynomial
|
||||
coeffs_(),
|
||||
canIntegrate_(true)
|
||||
{
|
||||
Istream& is = dict.lookup(entryName);
|
||||
ITstream& is = dict.lookup(entryName);
|
||||
const word entryType(is);
|
||||
|
||||
is >> coeffs_;
|
||||
|
||||
@ -39,7 +39,7 @@ Foam::Function1Types::Table<Type>::Table
|
||||
:
|
||||
TableBase<Type>(entryName, dict)
|
||||
{
|
||||
Istream& is = dict.lookup(entryName);
|
||||
ITstream& is = dict.lookup(entryName);
|
||||
const word entryType(is);
|
||||
is >> this->table_;
|
||||
TableBase<Type>::check();
|
||||
|
||||
Reference in New Issue
Block a user