STYLE: inconsistent use of readBeginList()

- use readBegin() when the only delimiters are '()' and not '({})'
This commit is contained in:
Mark Olesen
2019-07-29 11:22:57 +02:00
committed by Andrew Heather
parent bdc1c9bfb6
commit 80fb4da9ca
7 changed files with 9 additions and 29 deletions

View File

@ -101,7 +101,7 @@ Foam::Istream& Foam::PackedList<Width>::read(Istream& is)
);
}
}
else if (delimiter == token::BEGIN_BLOCK)
else
{
// Assign for all entries
list = list.readValue(is);
@ -112,13 +112,6 @@ Foam::Istream& Foam::PackedList<Width>::read(Istream& is)
"reading the single entry"
);
}
else
{
FatalIOErrorInFunction(is)
<< "incorrect list token, expected '(' or '{', found "
<< firstTok.info()
<< exit(FatalIOError);
}
}
// Read end of contents

View File

@ -116,14 +116,9 @@ Foam::Keyed<T>::createList(const UList<T>& lst, const labelUList& keys)
template<class T>
inline Foam::Istream& Foam::operator>>(Istream& is, Keyed<T>& item)
{
// Read beginning of Keyed item/key pair
is.readBegin("Keyed<T>");
is >> static_cast<T&>(item);
is >> item.key_;
// Read end of Keyed item/key pair
is.readEnd("Keyed<T>");
is.readBegin("Keyed");
is >> static_cast<T&>(item) >> item.key_;
is.readEnd("Keyed");
is.check(FUNCTION_NAME);
return is;
@ -134,8 +129,7 @@ template<class T>
inline Foam::Ostream& Foam::operator<<(Ostream& os, const Keyed<T>& item)
{
os << token::BEGIN_LIST
<< static_cast<const T&>(item)
<< token::SPACE << item.key_
<< static_cast<const T&>(item) << token::SPACE << item.key_
<< token::END_LIST;
return os;

View File

@ -205,7 +205,7 @@ Foam::Istream& Foam::operator>>
typename Foam::SolverPerformance<Type>& sp
)
{
is.readBeginList("SolverPerformance<Type>");
is.readBegin("SolverPerformance");
is >> sp.solverName_
>> sp.fieldName_
>> sp.initialResidual_
@ -213,7 +213,7 @@ Foam::Istream& Foam::operator>>
>> sp.nIterations_
>> sp.converged_
>> sp.singular_;
is.readEndList("SolverPerformance<Type>");
is.readEnd("SolverPerformance");
return is;
}

View File

@ -126,12 +126,10 @@ inline Foam::Istream& Foam::operator>>(Istream& is, labelledTri& t)
{
if (is.format() == IOstream::ASCII)
{
// Read beginning of labelledTri point pair
is.readBegin("labelledTri");
is >> static_cast<triFace&>(t) >> t.region_;
// Read end of labelledTri point pair
is.readEnd("labelledTri");
}
else

View File

@ -100,15 +100,12 @@ Foam::tmp<Foam::Field<Foam::scalar>> Foam::vectorTensorTransform::transform
Foam::Istream& Foam::operator>>(Istream& is, vectorTensorTransform& tr)
{
// Read beginning of vectorTensorTransform
is.readBegin("vectorTensorTransform");
is >> tr.t_ >> tr.R_ >> tr.hasR_;
// Read end of vectorTensorTransform
is.readEnd("vectorTensorTransform");
// Check state of Istream
is.check(FUNCTION_NAME);
return is;

View File

@ -105,12 +105,10 @@ Foam::septernion Foam::average
Foam::Istream& Foam::operator>>(Istream& is, septernion& s)
{
// Read beginning of septernion
is.readBegin("septernion");
is >> s.t() >> s.r();
// Read end of septernion
is.readEnd("septernion");
is.check(FUNCTION_NAME);

View File

@ -153,9 +153,9 @@ class SingleKineticRateDevolatilisation
//- Read from Istream
friend Istream& operator>>(Istream& is, volatileData& vd)
{
is.readBeginList("volatileData");
is.readBegin("volatileData");
is >> vd.name_ >> vd.A1_ >> vd.E_;
is.readEndList("volatileData");
is.readEnd("volatileData");
return is;
}