Commit c713c814 authored by mattijs's avatar mattijs
Browse files

make output compatible with dictionary entries

parent d6bad4c5
...@@ -77,7 +77,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L) ...@@ -77,7 +77,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L)
} }
else else
{ {
// Putback the openning bracket // Putback the opening bracket
is.putBack(firstToken); is.putBack(firstToken);
} }
...@@ -190,8 +190,9 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L) ...@@ -190,8 +190,9 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
if (uniform) if (uniform)
{ {
// Write size of list and start contents delimiter // Write size of list (so it is valid dictionary entry) and
os << token::BEGIN_BLOCK; // start contents delimiter
os << L.size() << token::BEGIN_BLOCK;
// Write list contents // Write list contents
os << L[0]; os << L[0];
...@@ -201,7 +202,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L) ...@@ -201,7 +202,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
} }
else if (Size < 11 && contiguous<T>()) else if (Size < 11 && contiguous<T>())
{ {
// Write size of list and start contents delimiter // Write start of contents delimiter
os << token::BEGIN_LIST; os << token::BEGIN_LIST;
// Write list contents // Write list contents
...@@ -216,7 +217,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L) ...@@ -216,7 +217,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const FixedList<T, Size>& L)
} }
else else
{ {
// Write size of list and start contents delimiter // Write start of contents delimiter
os << nl << token::BEGIN_LIST; os << nl << token::BEGIN_LIST;
// Write list contents // Write list contents
......
Supports Markdown
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