ITstream.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9  Copyright (C) 2017-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "error.H"
30 #include "ITstream.H"
31 #include "SpanStream.H"
32 #include <algorithm>
33 #include <memory>
34 
35 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
36 
37 static std::unique_ptr<Foam::ITstream> emptyStreamPtr_;
38 
39 
40 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Convert input sequence into a list of tokens.
46 // Return the number of tokens in the resulting list.
47 static label parseStream(ISstream& is, tokenList& tokens)
48 {
49  tokens.clear();
50 
51  label count = 0;
52  token tok;
53  while (!is.read(tok).bad() && tok.good())
54  {
55  if (count >= tokens.size())
56  {
57  // Increase capacity (doubling) with min-size [64]
58  tokens.resize(max(label(64), 2*tokens.size()));
59  }
60 
61  tokens[count] = std::move(tok);
62  ++count;
63  }
64 
65  tokens.resize(count);
66 
67  return count;
68 }
69 
70 } // End namespace Foam
71 
72 
73 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
74 
76 {
77  if (emptyStreamPtr_)
78  {
79  emptyStreamPtr_->ITstream::clear(); // Ensure it really is empty
80  emptyStreamPtr_->ITstream::seek(0); // rewind(), but bypasss virtual
81  }
82  else
83  {
84  emptyStreamPtr_.reset(new ITstream(Foam::zero{}, "empty-stream"));
85  }
86 
87  // Set stream as bad to indicate that this is an invald stream
88  emptyStreamPtr_->setBad();
89 
90  return *emptyStreamPtr_;
91 }
92 
93 
95 (
96  const UList<char>& input,
97  IOstreamOption streamOpt
98 )
99 {
100  ISpanStream is(input, streamOpt);
101 
102  tokenList tokens;
103  parseStream(is, tokens);
104  return tokens;
105 }
106 
107 
109 (
110  const std::string& input,
111  IOstreamOption streamOpt
112 )
113 {
114  ISpanStream is(input, streamOpt);
115 
116  tokenList tokens;
117  parseStream(is, tokens);
118  return tokens;
119 }
120 
121 
123 (
124  const char* input,
125  IOstreamOption streamOpt
126 )
127 {
128  ISpanStream is(input, strlen(input), streamOpt);
129 
130  tokenList tokens;
131  parseStream(is, tokens);
132  return tokens;
133 }
134 
135 
136 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
137 
138 void Foam::ITstream::reserveCapacity(const label newCapacity)
139 {
140  // Reserve - leave excess capacity for further appends
141 
142  label len = tokenList::size();
143 
144  if (len < newCapacity)
145  {
146  // Min-size (16) when starting from zero
147  if (!len) len = 8;
148 
149  // Increase capacity. Strict doubling
150  do
151  {
152  len *= 2;
153  }
154  while (len < newCapacity);
155 
157  }
158 }
159 
160 
161 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
162 
163 Foam::ITstream::ITstream(const ITstream& is)
164 :
165  Istream(static_cast<IOstreamOption>(is)),
166  tokenList(is),
167  name_(is.name_),
168  tokenIndex_(0)
169 {
170  setOpened();
171  setGood();
172 }
173 
174 
176 :
177  Istream(static_cast<IOstreamOption>(is)),
178  tokenList(std::move(static_cast<tokenList&>(is))),
179  name_(std::move(is.name_)),
180  tokenIndex_(0)
181 {
182  setOpened();
183  setGood();
184 }
185 
186 
188 (
189  IOstreamOption streamOpt,
190  const string& name
191 )
192 :
193  Istream(IOstreamOption(streamOpt.format(), streamOpt.version())),
194  tokenList(),
195  name_(name),
196  tokenIndex_(0)
197 {
198  setOpened();
199  setGood();
200 }
201 
202 
204 (
205  const Foam::zero,
206  const string& name,
207  IOstreamOption streamOpt
208 )
209 :
210  ITstream(streamOpt, name)
211 {}
212 
213 
215 (
216  const UList<token>& tokens,
217  IOstreamOption streamOpt,
218  const string& name
219 )
220 :
221  Istream(IOstreamOption(streamOpt.format(), streamOpt.version())),
222  tokenList(tokens),
223  name_(name),
224  tokenIndex_(0)
225 {
226  setOpened();
227  setGood();
228 }
229 
230 
232 (
233  List<token>&& tokens,
234  IOstreamOption streamOpt,
235  const string& name
236 )
237 :
238  Istream(IOstreamOption(streamOpt.format(), streamOpt.version())),
239  tokenList(std::move(tokens)),
240  name_(name),
241  tokenIndex_(0)
242 {
243  setOpened();
244  setGood();
245 }
246 
247 
249 (
250  const UList<char>& input,
251  IOstreamOption streamOpt,
252  const string& name
253 )
254 :
255  ITstream(streamOpt, name)
256 {
257  ISpanStream is(input, streamOpt);
259  parseStream(is, static_cast<tokenList&>(*this));
260  ITstream::seek(0); // rewind(), but bypasss virtual
261 }
262 
263 
265 (
266  const std::string& input,
267  IOstreamOption streamOpt,
268  const string& name
269 )
270 :
271  ITstream(streamOpt, name)
272 {
273  ISpanStream is(input, streamOpt);
275  parseStream(is, static_cast<tokenList&>(*this));
276  ITstream::seek(0); // rewind(), but bypasss virtual
277 }
278 
279 
281 (
282  const char* input,
283  IOstreamOption streamOpt,
284  const string& name
285 )
286 :
287  ITstream(streamOpt, name)
288 {
289  ISpanStream is(input, strlen(input), streamOpt);
290 
291  parseStream(is, static_cast<tokenList&>(*this));
292  ITstream::seek(0); // rewind(), but bypasss virtual
293 }
294 
295 
296 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
297 
298 void Foam::ITstream::print(Ostream& os) const
299 {
300  os << "ITstream : " << name_.c_str() << ", line ";
301 
302  if (tokenList::empty())
303  {
304  os << lineNumber();
305  }
306  else
307  {
308  const tokenList& toks = *this;
309 
310  os << toks.front().lineNumber();
311 
312  if (toks.front().lineNumber() < toks.back().lineNumber())
313  {
314  os << '-' << toks.back().lineNumber();
315  }
316  }
317  os << ", ";
318 
320 }
321 
322 
323 std::string Foam::ITstream::toString() const
324 {
325  if (tokenList::empty())
326  {
327  return std::string();
328  }
329  else if (tokenList::size() == 1 && tokenList::front().isStringType())
330  {
331  // Already a string-type (WORD, STRING, ...). Just copy.
332  return tokenList::front().stringToken();
333  }
334 
335  // Stringify
336  OCharStream buf;
337  buf.precision(16); // Some reasonably high precision
338 
339  auto iter = tokenList::cbegin();
340  const auto last = tokenList::cend();
341 
342  // Note: could also just use the buffer token-wise
343 
344  // Contents - space separated
345  if (iter != last)
346  {
347  buf << *iter;
348 
349  for (++iter; (iter != last); (void)++iter)
350  {
351  buf << token::SPACE << *iter;
352  }
353  }
355  const auto view = buf.view();
356 
357  return std::string(view.data(), view.size());
358 }
359 
360 
361 const Foam::token& Foam::ITstream::peek() const
362 {
363  // Use putback token if it exists
364  if (Istream::hasPutback())
365  {
367  }
368 
369  return peekNoFail(tokenIndex_);
370 }
371 
372 
374 {
375  if (tokenIndex_ < 0 || tokenIndex_ >= tokenList::size())
376  {
378  << "Token index " << tokenIndex_ << " out of range [0,"
379  << tokenList::size() << "]\n"
381  }
382 
383  return tokenList::operator[](tokenIndex_);
384 }
385 
386 
387 void Foam::ITstream::seek(label pos)
388 {
389  lineNumber_ = 0;
390  const tokenList& toks = *this;
391  const label nToks = toks.size();
392 
393  if (!pos)
394  {
395  // Seek begin (rewind)
396  tokenIndex_ = 0;
397 
398  if (nToks)
399  {
400  lineNumber_ = toks.front().lineNumber();
401  }
402 
403  setOpened();
404  setGood();
405  }
406  else if (pos < 0 || pos >= nToks)
407  {
408  // Seek end (-1) or seek is out of range
409  tokenIndex_ = nToks;
410 
411  if (nToks)
412  {
413  lineNumber_ = toks.back().lineNumber();
414  }
415 
416  setEof();
417  }
418  else
419  {
420  // Seek middle (from the beginning)
421  tokenIndex_ = pos;
422 
423  if (nToks)
424  {
425  lineNumber_ = toks[tokenIndex_].lineNumber();
426  }
428  setOpened();
429  setGood();
430  }
431 }
432 
433 
434 bool Foam::ITstream::skip(label n)
435 {
436  if (!n)
437  {
438  // No movement - just check the current range
439  return (tokenIndex_ >= 0 && tokenIndex_ < tokenList::size());
440  }
441 
442  tokenIndex_ += n; // Move forward (+ve) or backwards (-ve)
443 
444  bool noError = true;
445 
446  if (tokenIndex_ < 0)
447  {
448  // Underflow range
449  noError = false;
450  tokenIndex_ = 0;
451  }
452  else if (tokenIndex_ >= tokenList::size())
453  {
454  // Overflow range
455  noError = false;
456  tokenIndex_ = tokenList::size();
457 
458  if (!tokenList::empty())
459  {
460  // The closest reference lineNumber
461  lineNumber_ = tokenList::back().lineNumber();
462  }
463  }
464 
465  // Update stream information
466  if (tokenIndex_ < tokenList::size())
467  {
468  lineNumber_ = tokenList::operator[](tokenIndex_).lineNumber();
469  setOpened();
470  setGood();
471  }
472  else
473  {
474  setEof();
475  }
476 
477  return noError;
478 }
479 
480 
482 {
483  // Use putback token if it exists
484  if (Istream::getBack(tok))
485  {
486  lineNumber_ = tok.lineNumber();
487  return *this;
488  }
489 
490  tokenList& toks = *this;
491  const label nToks = toks.size();
492 
493  if (tokenIndex_ < nToks)
494  {
495  tok = toks[tokenIndex_++];
496  lineNumber_ = tok.lineNumber();
497 
498  if (tokenIndex_ == nToks)
499  {
500  setEof();
501  }
502  }
503  else
504  {
505  if (eof())
506  {
508  << "attempt to read beyond EOF"
509  << exit(FatalIOError);
510  setBad();
511  }
512  else
513  {
514  setEof();
515  }
516 
517  tok.reset();
518 
519  if (nToks)
520  {
521  tok.lineNumber(toks.back().lineNumber());
522  }
523  else
524  {
525  tok.lineNumber(this->lineNumber());
526  }
527  }
528 
529  return *this;
530 }
531 
532 
534 (
535  const token::punctuationToken delimOpen,
536  const token::punctuationToken delimClose,
537  label pos
538 ) const
539 {
540  if (pos < 0)
541  {
542  pos = tokenIndex_;
543  }
544 
545  labelRange slice;
546 
547  for (label depth = 0; pos < tokenList::size(); ++pos)
548  {
549  const token& tok = tokenList::operator[](pos);
550 
551  if (tok.isPunctuation())
552  {
553  if (tok.isPunctuation(delimOpen))
554  {
555  if (!depth)
556  {
557  // Initial open delimiter
558  slice.start() = pos;
559  }
560 
561  ++depth;
562  }
563  else if (tok.isPunctuation(delimClose))
564  {
565  --depth;
566 
567  if (depth < 0)
568  {
569  // A closing delimiter without an open!
570  // Raise error?
571  break;
572  }
573  if (!depth)
574  {
575  // The end - include delimiter into the count
576  slice.size() = (pos - slice.start()) + 1;
577  break;
578  }
579  }
580  }
581  }
582 
583  return slice;
584 }
585 
586 
588 {
589  ITstream result
590  (
591  static_cast<IOstreamOption>(*this),
592  this->name()
593  );
594  result.setLabelByteSize(this->labelByteSize());
595  result.setScalarByteSize(this->scalarByteSize());
596 
597  // Validate the slice range of list
598  const labelRange slice(range.subset0(tokenList::size()));
599 
600  if (!slice.good())
601  {
602  // No-op
603  return result;
604  }
605 
606  auto first = tokenList::begin(slice.begin_value());
607  auto last = tokenList::begin(slice.end_value());
608 
609  result.resize(label(last - first));
610 
611  // Move tokens into result list
612  std::move(first, last, result.begin());
613  result.seek(0); // rewind
615  (void) remove(slice); // Adjust the original list
616 
617  return result;
618 }
619 
620 
621 Foam::label Foam::ITstream::remove(const labelRange& range)
622 {
623  // Validate the slice range of list
624  const labelRange slice(range.subset0(tokenList::size()));
625 
626  if (!slice.good())
627  {
628  // No-op
629  return 0;
630  }
631 
632  if (slice.end_value() >= tokenList::size())
633  {
634  // Remove entire tail
635  tokenList::resize(slice.begin_value());
636  }
637  else
638  {
639  // Attempt to adjust the current token index to something sensible...
640  if (slice.contains(tokenIndex_))
641  {
642  // Within the removed slice - reposition tokenIndex before it
643  seek(slice.begin_value());
644  skip(-1);
645  }
646  else if (tokenIndex_ >= slice.end_value())
647  {
648  // After the removed slice - reposition tokenIndex relatively
649  skip(-slice.size());
650  }
651 
652  // Move tokens down in the list
653  std::move
654  (
655  tokenList::begin(slice.end_value()),
656  tokenList::end(),
657  tokenList::begin(slice.begin_value())
658  );
659 
660  // Truncate
661  tokenList::resize(tokenList::size() - slice.size());
662  }
663 
664  if (tokenIndex_ >= tokenList::size())
665  {
666  tokenIndex_ = tokenList::size();
667  setEof();
668  }
669  else if (tokenIndex_ >= 0 && tokenIndex_ < tokenList::size())
670  {
671  lineNumber_ = tokenList::operator[](tokenIndex_).lineNumber();
672  }
674  return slice.size();
675 }
676 
677 
678 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
679 
681 {
683  return *this;
684 }
685 
686 
688 {
690  return *this;
691 }
692 
693 
695 {
697  return *this;
698 }
699 
700 
702 {
704  return *this;
705 }
706 
707 
709 {
711  return *this;
712 }
713 
714 
716 {
718  return *this;
719 }
720 
721 
722 Foam::Istream& Foam::ITstream::readRaw(char*, std::streamsize)
723 {
725  return *this;
726 }
727 
728 
729 Foam::Istream& Foam::ITstream::read(char*, std::streamsize)
730 {
732  return *this;
733 }
734 
737 {
738  ITstream::seek(0);
739 }
740 
741 
742 void Foam::ITstream::add_tokens(const token& tok)
743 {
744  reserveCapacity(tokenIndex_ + 1);
745 
746  tokenList::operator[](tokenIndex_) = tok;
747  ++tokenIndex_;
748 }
749 
750 
752 {
753  reserveCapacity(tokenIndex_ + 1);
754 
755  tokenList::operator[](tokenIndex_) = std::move(tok);
756  ++tokenIndex_;
757 }
758 
759 
761 {
762  const label len = toks.size();
763  reserveCapacity(tokenIndex_ + len);
764 
765  std::copy_n(toks.begin(), len, tokenList::begin(tokenIndex_));
766  tokenIndex_ += len;
767 }
768 
769 
771 {
772  const label len = toks.size();
773  reserveCapacity(tokenIndex_ + len);
774 
775  std::move(toks.begin(), toks.end(), tokenList::begin(tokenIndex_));
776  tokenIndex_ += len;
777  toks.clear();
778 }
779 
780 
781 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
782 
783 void Foam::ITstream::operator=(const ITstream& is)
784 {
785  // Self-assignment is a no-op
786  if (this != &is)
787  {
788  Istream::operator=(is);
790  name_ = is.name_;
791  ITstream::seek(0); // rewind(), but bypasss virtual
792  }
793 }
794 
795 
797 {
798  tokenList::operator=(toks);
799  ITstream::seek(0); // rewind(), but bypasss virtual
800 }
801 
802 
804 {
805  tokenList::operator=(std::move(toks));
806  ITstream::seek(0); // rewind(), but bypasss virtual
807 }
808 
809 
810 // ************************************************************************* //
void add_tokens(const token &tok)
Copy append a token at the current tokenIndex, incrementing the index.
Definition: ITstream.C:735
bool good() const noexcept
True if token is not UNDEFINED or ERROR.
Definition: tokenI.H:507
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
Definition: UListI.H:449
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
const token & peekBack() const noexcept
Examine putback token without removing it.
Definition: Istream.C:42
bool getBack(token &tok)
Retrieve the put-back token if there is one.
Definition: Istream.C:115
Input/output streams with (internal or external) character storage.
void seek(label pos)
Move tokenIndex to the specified position.
Definition: ITstream.C:380
bool bad() const noexcept
True if stream is corrupted.
Definition: IOstream.H:305
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:160
static std::unique_ptr< Foam::ITstream > emptyStreamPtr_
Definition: ITstream.C:30
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:56
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
A range or interval of labels defined by a start and a size.
Definition: labelRange.H:52
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Definition: UList.H:666
A token holds an item read from Istream.
Definition: token.H:65
T & front()
Access first element of the list, position [0].
Definition: UListI.H:237
label remove(const labelRange &range)
Remove a (start,size) subset from the list and move remaining elements down.
Definition: ITstream.C:614
A simple container for options an IOstream can normally have.
std::string toString() const
Concatenate tokens into a space-separated std::string. The resulting string may contain quote charact...
Definition: ITstream.C:316
List< token > tokenList
List of token, used for dictionary primitive entry (for example)
Definition: tokenList.H:32
scalar range
const token & peek() const
Failsafe peek at what the next read would return, including handling of any putback.
Definition: ITstream.C:354
static tokenList parse(const UList< char > &input, IOstreamOption streamOpt=IOstreamOption())
Create token list by parsing the input character sequence until no good tokens remain.
Definition: ITstream.C:88
T & operator[](const label i)
Return element of UList.
Definition: UListI.H:361
dimensionedScalar pos(const dimensionedScalar &ds)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of &#39;true&#39; entries.
Definition: BitOps.H:73
virtual Istream & read(token &tok) override
Return next token from stream.
Definition: ITstream.C:474
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
Definition: List.C:360
void clear()
Clear the list, i.e. set size to zero.
Definition: ListI.H:137
virtual Istream & readRaw(char *data, std::streamsize count) override
Low-level raw binary read : triggers not implemented error.
Definition: ITstream.C:715
A class for handling words, derived from Foam::string.
Definition: word.H:63
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:33
Space [isspace].
Definition: token.H:131
punctuationToken
Standard punctuation tokens (a character)
Definition: token.H:126
errorManip< error > abort(error &err)
Definition: errorManip.H:139
iterator begin() noexcept
Return an iterator to begin traversing the UList.
Definition: UListI.H:391
const token & currentToken() const
Read access to the token at the current tokenIndex.
Definition: ITstream.H:333
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:105
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
label size() const noexcept
The number of elements in the container.
Definition: UList.H:671
OBJstream os(runTime.globalPath()/outputName)
virtual void print(Ostream &os) const
Print stream description to Ostream.
Definition: IOstream.C:67
virtual Istream & read(token &t) override
Return next token from stream.
Definition: ISstream.C:535
unsigned scalarByteSize(const std::string &str)
Extract scalar size (in bytes) from "scalar=" tag in string.
label lineNumber() const noexcept
Const access to the current stream line number.
Definition: IOstream.H:390
word format(conversionProperties.get< word >("format"))
const std::string version
OpenFOAM version (name or stringified number) as a std::string.
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:51
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:627
bool hasPutback() const noexcept
True if putback token is in use.
Definition: Istream.H:81
labelRange find(const token::punctuationToken delimOpen, const token::punctuationToken delimClose, label pos=0) const
Find range containing matching delimiter pair, starting at the the specified position. The position -1 indicates to continue from the present tokenIndex() position.
Definition: ITstream.C:527
T & back()
Access last element of the list, position [size()-1].
Definition: UListI.H:251
unsigned labelByteSize(const std::string &str)
Extract label size (in bytes) from "label=" tag in string.
static ITstream & empty_stream()
Return reference to an empty ITstream, for functions needing to return an ITstream reference but whic...
Definition: ITstream.C:68
static label parseStream(ISstream &is, tokenList &tokens)
Definition: ITstream.C:40
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:57
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
Definition: UListI.H:405
label n
virtual void rewind() override
Rewind the stream so that it may be read again. Same as seek(0)
Definition: ITstream.C:729
void print(Ostream &os) const override
Print stream description to Ostream.
Definition: ITstream.C:291
iterator end() noexcept
Return an iterator to end traversing the UList.
Definition: UListI.H:435
bool skip(label n=1)
Move tokenIndex relative to the current position.
Definition: ITstream.C:427
ITstream(const ITstream &is)
Copy construct.
Definition: ITstream.C:156
void operator=(const ITstream &is)
Copy assignment, with rewind()
Definition: ITstream.C:776
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:686
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
Definition: ISpanStream.H:286
An input stream of tokens.
Definition: ITstream.H:52
Namespace for OpenFOAM.
ITstream extract(const labelRange &range)
Remove a (start,size) subset from the list and move remaining elements down.
Definition: ITstream.C:580
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...