ENH: simplify stream construction

- with IOstreamOption there are no cases where we need to construct
  top-level streams (eg, IFstream, OFstream) with additional information
  about the internal IOstream 'version' (eg, version: 2.0).

  Makes it more convenient to open files with a specified
  format/compression combination - no clutter of specifying the
  version
This commit is contained in:
Mark Olesen
2022-09-27 13:07:29 +02:00
parent 36d7954004
commit 623c0624fb
29 changed files with 197 additions and 261 deletions

View File

@ -80,23 +80,22 @@ public:
// Constructors
//- Construct from pathname
//- Construct from pathname (ASCII, uncompressed)
explicit OBJstream
(
const fileName& pathname,
IOstreamOption streamOpt = IOstreamOption()
);
//- Construct from pathname
//- Construct from pathname, format (uncompressed)
OBJstream
(
const fileName& pathname,
IOstreamOption::streamFormat fmt,
IOstreamOption::versionNumber ver = IOstreamOption::currentVersion,
IOstreamOption::compressionType cmp = IOstreamOption::UNCOMPRESSED
)
:
OBJstream(pathname, IOstreamOption(fmt, ver, cmp))
OBJstream(pathname, IOstreamOption(fmt, cmp))
{}