• Mark Olesen's avatar
    ENH: improvements to IOstreamOption · 33f9ae50
    Mark Olesen authored
    * Support default values for format/compress enum lookups.
      - Avoids situations where the preferred default format is not ASCII.
        For example, with dictionary input:
            format binar;
        The typing mistake would previously have caused formatEnum to
        default to ASCII. We can now properly control its behaviour.
                dict.get<word>("format"), IOstream::BINARY
        Allowing us to switch ascii/binary, using BINARY by default even in
        the case of spelling mistakes. The mistakes are flagged, but the
        return value can be non-ASCII.
    * The format/compression lookup behave as pass-through if the lookup
      string is empty.
      - Allows the following to work without complaint
              dict.getOrDefault("format", word::null), IOstream::BINARY
      - Or use constructor-like failsafe method
          IOstream::formatEnum("format", dict, IOstream::BINARY);
      - Apply the same behaviour with setting stream format/compression
        from a word.
        will emit a warning, but leave the stream format UNCHANGED
    * Rationalize versionNumber construction
      - constexpr constructors where possible.
        Default construct is the "currentVersion"
      - Construct from token to shift the burden to versionNumber.
        Support token as argument to version().
        or failsafe constructor method
                IOstreamOption::versionNumber("version", headerDict)
        Before (controlled input):
        Old, uncontrolled input - has been removed:
    * improve consistency, default behaviour for IOstreamOption construct
      - constexpr constructors where possible
      - add copy construct with change of format.
      - construct IOstreamOption from streamFormat is now non-explicit.
        This is a commonly expected result with no ill-effects
ensightSurfaceWriter.C 6.63 KB