Skip to content
Snippets Groups Projects
Commit 80fb4da9 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

STYLE: inconsistent use of readBeginList()

- use readBegin() when the only delimiters are '()' and not '({})'
parent bdc1c9bf
Branches
Tags
No related merge requests found
......@@ -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
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment