void Foam::LPtrList<LListBase, T>::read(Istream& is, const INew& iNew) { is.fatalCheck ( "LPtrList<LListBase, T>::read(Istream&, const INew&)" ); token firstToken(is); is.fatalCheck ( "LPtrList<LListBase, T>::read(Istream&, const INew&) : " "reading first token" ); if (firstToken.isLabel()) { label s = firstToken.labelToken(); // Read beginning of contents char delimiter = is.readBeginList("LPtrList<LListBase, T>"); if (s) { if (delimiter == token::BEGIN_LIST) { for (label i=0; i<s; ++i) { this->append(iNew(is).ptr()); is.fatalCheck ( "LPtrList<LListBase, T>::read(Istream&, const INew&) : " "reading entry" ); } } else { T* tPtr = iNew(is).ptr(); this->append(tPtr); is.fatalCheck ( "LPtrList<LListBase, T>::read(Istream&, const INew&) : " "reading entry" ); for (label i=1; i<s; ++i) { this->append(tPtr->clone().ptr()); } } } // Read end of contents is.readEndList("LPtrList<LListBase, T>"); } else if (firstToken.isPunctuation()) { if (firstToken.pToken() != token::BEGIN_LIST) { FatalIOErrorIn ( "LPtrList<LListBase, T>::read(Istream&, const INew&)", is ) << "incorrect first token, '(', found " << firstToken.info() << exit(FatalIOError); } token lastToken(is); is.fatalCheck("LPtrList<LListBase, T>::read(Istream&, const INew&)"); while ( !( lastToken.isPunctuation() && lastToken.pToken() == token::END_LIST ) ) { is.putBack(lastToken); this->append(iNew(is).ptr()); is >> lastToken; is.fatalCheck ( "LPtrList<LListBase, T>::read(Istream&, const INew&)" ); } } else {