Commit dc43311e authored by Henry Weller's avatar Henry Weller
Browse files

src/OpenFOAM: Update ...IOErrorIn -> ...IOErrorInFunction

Avoids the clutter and maintenance effort associated with providing the
function signature string.
parent e2ef006b
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -76,9 +76,8 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -92,9 +91,8 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -125,9 +123,8 @@ void Foam::HashPtrTable<T, Key, Hash>::read(Istream& is, const INew& inewt)
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)",
is
) << "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -145,9 +145,8 @@ Foam::Istream& Foam::operator>>
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"operator>>(Istream&, HashTable<T, Key, Hash>&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -161,9 +160,8 @@ Foam::Istream& Foam::operator>>
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"operator>>(Istream&, HashTable<T, Key, Hash>&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -199,9 +197,8 @@ Foam::Istream& Foam::operator>>
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"operator>>(Istream&, HashTable<T, Key, Hash>&)",
is
) << "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -89,9 +89,8 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"operator>>(Istream&, ILList<LListBase, T>&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -117,7 +116,7 @@ void Foam::ILList<LListBase, T>::read(Istream& is, const INew& iNew)
}
else
{
FatalIOErrorIn("operator>>(Istream&, ILList<LListBase, T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......
......@@ -90,9 +90,8 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn
FatalIOErrorInFunction
(
" operator>>(Istream&, LList<LListBase, T>&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -120,7 +119,7 @@ Foam::Istream& Foam::operator>>(Istream& is, LList<LListBase, T>& L)
}
else
{
FatalIOErrorIn(" operator>>(Istream&, LList<LListBase, T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -94,9 +94,8 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"LPtrList<LListBase, T>::read(Istream&, const INew&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -125,9 +124,8 @@ void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew)
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"LPtrList<LListBase, T>::read(Istream&, const INew&)",
is
) << "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
......
......@@ -68,7 +68,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
}
else if (!firstToken.isPunctuation())
{
FatalIOErrorIn("operator>>(Istream&, FixedList<T, Size>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected <label> "
"or '(' or '{', found "
<< firstToken.info()
......
......@@ -129,7 +129,7 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn("operator>>(Istream&, List<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......@@ -146,7 +146,7 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L)
}
else
{
FatalIOErrorIn("operator>>(Istream&, List<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......@@ -167,7 +167,7 @@ Foam::List<T> Foam::readList(Istream& is)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn("readList<T>(Istream&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......
......@@ -306,11 +306,7 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
}
else
{
FatalIOErrorIn
(
"PackedList<nBits>::read(Istream&)",
is
)
FatalIOErrorInFunction(is)
<< "incorrect list token, expected '(' or '{', found "
<< firstTok.info()
<< exit(FatalIOError);
......@@ -380,11 +376,7 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
}
else
{
FatalIOErrorIn
(
"PackedList<nBits>::read(Istream&)",
is
)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected '(', found "
<< firstTok.info()
<< exit(FatalIOError);
......@@ -392,11 +384,7 @@ Foam::Istream& Foam::PackedList<nBits>::read(Istream& is)
}
else
{
FatalIOErrorIn
(
"PackedList<nBits>::read(Istream&)",
is
)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected <int>, '(' or '{', found "
<< firstTok.info()
<< exit(FatalIOError);
......
......@@ -95,9 +95,8 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"PtrList<T>::read(Istream&, const INew&)",
is
) << "incorrect first token, '(', found " << firstToken.info()
<< exit(FatalIOError);
......@@ -118,9 +117,8 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
if (is.eof())
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"PtrList<T>::read(Istream&, const INew&)",
is
) << "Premature EOF after reading " << lastToken.info()
<< exit(FatalIOError);
......@@ -145,9 +143,8 @@ void Foam::PtrList<T>::read(Istream& is, const INew& inewt)
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"PtrList<T>::read(Istream&, const INew&)",
is
) << "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
......
......@@ -162,7 +162,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
if (s != L.size())
{
FatalIOErrorIn("operator>>(Istream&, UList<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect length for UList. Read " << s
<< " expected " << L.size()
<< exit(FatalIOError);
......@@ -179,7 +179,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
// Set list length to that read
if (s != L.size())
{
FatalIOErrorIn("operator>>(Istream&, UList<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect length for UList. Read " << s
<< " expected " << L.size()
<< exit(FatalIOError);
......@@ -244,7 +244,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
{
if (firstToken.pToken() != token::BEGIN_LIST)
{
FatalIOErrorIn("operator>>(Istream&, UList<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......@@ -258,7 +258,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
if (sll.size() != L.size())
{
FatalIOErrorIn("operator>>(Istream&, UList<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect length for UList. Read " << sll.size()
<< " expected " << L.size()
<< exit(FatalIOError);
......@@ -279,7 +279,7 @@ Foam::Istream& Foam::operator>>(Istream& is, UList<T>& L)
}
else
{
FatalIOErrorIn("operator>>(Istream&, UList<T>&)", is)
FatalIOErrorInFunction(is)
<< "incorrect first token, expected <int> or '(', found "
<< firstToken.info()
<< exit(FatalIOError);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -41,7 +41,7 @@ bool Foam::IOobject::readHeader(Istream& is)
{
if (rOpt_ == MUST_READ || rOpt_ == MUST_READ_IF_MODIFIED)
{
FatalIOErrorIn("IOobject::readHeader(Istream&)", is)
FatalIOErrorInFunction(is)
<< " stream not open for reading essential object from file "
<< is.name()
<< exit(FatalIOError);
......@@ -49,7 +49,7 @@ bool Foam::IOobject::readHeader(Istream& is)
if (IOobject::debug)
{
SeriousIOErrorIn("IOobject::readHeader(Istream&)", is)
SeriousIOErrorInFunction(is)
<< " stream not open for reading from file "
<< is.name() << endl;
}
......@@ -75,7 +75,7 @@ bool Foam::IOobject::readHeader(Istream& is)
const word headerObject(headerDict.lookup("object"));
if (IOobject::debug && headerObject != name())
{
IOWarningIn("IOobject::readHeader(Istream&)", is)
IOWarningInFunction(is)
<< " object renamed from "
<< name() << " to " << headerObject
<< " for file " << is.name() << endl;
......@@ -86,7 +86,7 @@ bool Foam::IOobject::readHeader(Istream& is)
}
else
{
IOWarningIn("IOobject::readHeader(Istream&)", is)
IOWarningInFunction(is)
<< "First token could not be read or is not the keyword 'FoamFile'"
<< nl << nl << "Check header is of the form:" << nl << endl;
......@@ -104,7 +104,7 @@ bool Foam::IOobject::readHeader(Istream& is)
{
if (rOpt_ == MUST_READ || rOpt_ == MUST_READ_IF_MODIFIED)
{
FatalIOErrorIn("IOobject::readHeader(Istream&)", is)
FatalIOErrorInFunction(is)
<< " stream failure while reading header"
<< " on line " << is.lineNumber()
<< " of file " << is.name()
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -45,9 +45,8 @@ void Foam::CompactIOField<T, BaseType>::readFromStream()
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"CompactIOField<T, BaseType>::readFromStream()",
is
) << "unexpected class name " << headerClassName()
<< " expected " << typeName << " or " << IOField<T>::typeName
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -45,9 +45,8 @@ void Foam::CompactIOList<T, BaseType>::readFromStream()
}
else
{
FatalIOErrorIn
FatalIOErrorInFunction
(
"CompactIOList<T, BaseType>::readFromStream()",
is
) << "unexpected class name " << headerClassName()
<< " expected " << typeName << " or " << IOList<T>::typeName
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -35,7 +35,7 @@ Foam::IOField<Type>::IOField(const IOobject& io)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOField::IOField(const IOobject&)")
WarningInFunction
<< "IOField " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOField does not support automatic rereading."
......@@ -65,7 +65,7 @@ Foam::IOField<Type>::IOField(const IOobject& io, const label size)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOField::IOField(const IOobject&, const label)")
WarningInFunction
<< "IOField " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOField does not support automatic rereading."
......@@ -99,7 +99,7 @@ Foam::IOField<Type>::IOField(const IOobject& io, const Field<Type>& f)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOField::IOField(const IOobject&, const Field<Type>&)")
WarningInFunction
<< "IOField " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOField does not support automatic rereading."
......@@ -133,10 +133,8 @@ Foam::IOField<Type>::IOField(const IOobject& io, const Xfer<Field<Type> >& f)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn
(
"IOField::IOField(const IOobject&, const Xfer<Field<Type> >&)"
) << "IOField " << name()
WarningInFunction
<< "IOField " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOField does not support automatic rereading."
<< endl;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -35,7 +35,7 @@ Foam::IOList<T>::IOList(const IOobject& io)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOList::IOList(const IOobject&)")
WarningInFunction
<< "IOList " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOList does not support automatic rereading."
......@@ -64,7 +64,7 @@ Foam::IOList<T>::IOList(const IOobject& io, const label size)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOList::IOList(const IOobject&, const label)")
WarningInFunction
<< "IOList " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOList does not support automatic rereading."
......@@ -97,7 +97,7 @@ Foam::IOList<T>::IOList(const IOobject& io, const List<T>& list)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn("IOList::IOList(const IOobject&, const List<T>&)")
WarningInFunction
<< "IOList " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOList does not support automatic rereading."
......@@ -131,10 +131,8 @@ Foam::IOList<T>::IOList(const IOobject& io, const Xfer<List<T> >& list)
// Temporary warning
if (io.readOpt() == IOobject::MUST_READ_IF_MODIFIED)
{
WarningIn
(
"IOList::IOList(const IOobject&, const Xfer<List<T> >&)"
) << "IOList " << name()
WarningInFunction
<< "IOList " << name()
<< " constructed with IOobject::MUST_READ_IF_MODIFIED"
" but IOList does not support automatic rereading."
<< endl;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -49,7 +49,7 @@ Foam::IOdictionary::IOdictionary(const IOobject& io)
// Temporary warning
if (debug && io.readOpt() == IOobject::MUST_READ)
{
WarningIn("IOdictionary::IOdictionary(const IOobject&)")
WarningInFunction
<< "Dictionary " << name()
<< " constructed with IOobject::MUST_READ"
" instead of IOobject::MUST_READ_IF_MODIFIED." << nl
......@@ -105,10 +105,8 @@ Foam::IOdictionary::IOdictionary(const IOobject& io, const dictionary& dict)
// Temporary warning
if (debug && io.readOpt() == IOobject::MUST_READ)
{
WarningIn
(
"IOdictionary::IOdictionary(const IOobject& const dictionary&)"
) << "Dictionary " << name()
WarningInFunction
<< "Dictionary " << name()
<< " constructed with IOobject::MUST_READ"
" instead of IOobject::MUST_READ_IF_MODIFIED." << nl
<< "Use MUST_READ_IF_MODIFIED if you need automatic rereading."
......
......@@ -48,7 +48,7 @@ Foam::IOstream::formatEnum(const word& format)
}
else
{
WarningIn("IOstream::formatEnum(const word&)")
WarningInFunction
<< "bad format specifier '" << format << "', using 'ascii'"
<< endl;
......@@ -77,7 +77,7 @@ Foam::IOstream::compressionEnum(const word& compression)
}
else
{
WarningIn("IOstream::compressionEnum(const word&)")
WarningInFunction
<< "bad compression specifier '" << compression
<< "', using 'uncompressed'"
<< endl;
......@@ -93,10 +93,8 @@ bool Foam::IOstream::check(const char* operation) const
{
if (bad())
{
FatalIOErrorIn
(
"IOstream::check(const char*) const", *this
) << "error in IOstream " << name() << " for operation " << operation
FatalIOErrorInFunction(*this)
<< "error in IOstream " << name() << " for operation " << operation
<< exit(FatalIOError);
}
......@@ -108,10 +106,8 @@ void Foam::IOstream::fatalCheck(const char* operation) const
{
if (bad())
{
FatalIOErrorIn
(
"IOstream::fatalCheck(const char*) const", *this
) << "error in IOstream " << name() << " for operation " << operation
FatalIOErrorInFunction(*this)
<< "error in IOstream " << name() << " for operation " << operation
<< exit(FatalIOError);
}
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -31,13 +31,13 @@ void Foam::Istream::putBack(const token& t)
{
if (bad())
{
FatalIOErrorIn("void Istream::putBack(const token&)", *this)
FatalIOErrorInFunction(*this)
<< "Attempt to put back onto bad stream"
<< exit(FatalIOError);
}
else if (putBack_)
{
FatalIOErrorIn("void Istream::putBack(const token&)", *this)
FatalIOErrorInFunction(*this)
<< "Attempt to put back another token"
<< exit(FatalIOError);
}
......@@ -53,7 +53,7 @@ bool Foam::Istream::getBack(token& t)
{
if (bad())
{
FatalIOErrorIn("void Istream::getBack(token&)", *this)
FatalIOErrorInFunction(*this)
<< "Attempt to get back from bad stream"
<< exit(FatalIOError);
}
......@@ -91,7 +91,7 @@ Foam::Istream& Foam::Istream::readBegin(const char* funcName)
if (delimiter != token::BEGIN_LIST)
{
setBad();
FatalIOErrorIn("Istream::readBegin(const char*)", *this)
FatalIOErrorInFunction(*this)
<< "Expected a '" << token::BEGIN_LIST
<< "' while reading " << funcName
<< ", found " << delimiter.info()
......@@ -108,7 +108,7 @@ Foam::Istream& Foam::Istream::readEnd(const char* funcName)