Skip to content
Snippets Groups Projects
  1. Nov 05, 2021
  2. Mar 16, 2021
    • Mark OLESEN's avatar
      ENH: additional routines for reading/writing/parsing IOObject headers · 0c985edf
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - support selective enable/disable of the file banner.
      
      ENH: improve code isolation for decomposedBlockData
      
      - use readBlockEntry/writeBlockEntry to encapsulate the IO handling,
        which ensures more consistency
      
      - new decomposedBlockData::readHeader for chaining into the
        block header information.
      
      - remove unused constructors for decomposedBlockData
      
      ENH: minor cleanup of collated fileOperations
      0c985edf
    • Mark OLESEN's avatar
      ENH: more consistent use of IOstreamOption · e8cf2a2c
      Mark OLESEN authored and Andrew Heather's avatar Andrew Heather committed
      - improves interface and data consistency.
        Older signatures are still active (via the Foam_IOstream_extras
        define).
      
      - refine internals for IOstreamOption streamFormat, versionNumber
      
      ENH: improve data alignment for IOstream and IOobject
      
      - fit sizeof label/scalar into unsigned char
      
      STYLE: remove dead code
      e8cf2a2c
  3. Mar 09, 2021
    • Mark OLESEN's avatar
      ENH: improvements for token methods · 51cd7cee
      Mark OLESEN authored
      - direct check of punctuation.
        For example,
      
            while (!tok.isPunctuation(token::BEGIN_LIST)) ..
      
        instead of
      
        while (!(tok.isPunctuation() && tok.pToken() == token::BEGIN_LIST)) ..
      
        Using direct comparison (tok != token::BEGIN_LIST) can be fragile
        when comparing int values:
      
            int c = readChar(is);
            while (tok != c) ..  // Danger, uses LABEL comparison!
      
      - direct check of word.
        For example,
      
            if (tok.isWord("uniform")) ..
      
        instead of
      
            if (tok.isWord() && tok.wordToken() == "uniform") ..
      
      - make token lineNumber() a setter method
      
      ENH: adjust internal compound method empty() -> moved()
      
      - support named compound tokens
      
      STYLE: setter method for stream indentation
      51cd7cee
  4. Feb 18, 2020
    • 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.
      
              IOstream::formatEnum
              (
                  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
      
            IOstream::formatEnum
            (
                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.
      
             is.format("binar");
      
          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().
      
          Now:
      
              is.version(headerDict.get<token>("version"));
      
          or failsafe constructor method
      
              is.version
              (
                  IOstreamOption::versionNumber("version", headerDict)
              );
      
          Before (controlled input):
      
              is.version
              (
                  IOstreamOption::versionNumber
                  (
                      headerDict.get<float>("version")
                  )
              );
      
          Old, uncontrolled input - has been removed:
      
              is.version(headerDict.lookup("version"));
      
      * 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
      33f9ae50
  5. Oct 31, 2019
  6. Jul 31, 2019
    • Mark OLESEN's avatar
      ENH: make OSstream indentation adjustable · 8b3d77ba
      Mark OLESEN authored
      - this is principally for cases where reduced indentation is desired,
        such as when streaming to a memory location. If the indentation size
        is zero or one, only a single space will be used to separate the
        key/value.
      
        This change does not affect the stream allocation size, since the
        extra data falls within the padding.
      
      ENH: relocate label/scalar sizes from Istream to IOstream.
      
      - could allow future use for output streams as well?
      
        Due to padding, reorganization has no effect on allocated size
        of output streams.
      
      STYLE: add read/write name qualifier to beginRaw, endRaw
      
      - removes ambiguity for bi-directional streams
      
      STYLE: fix inconsistent 'const' qualifier on std::streamsize
      
      - base Ostream was without const, some derived streams with const
      8b3d77ba
  7. Jul 18, 2019
  8. Apr 16, 2019
  9. Feb 06, 2019
  10. Nov 10, 2018
    • Mark OLESEN's avatar
      ENH: add IOobject::isHeaderClassName() method · f44e59fb
      Mark OLESEN authored
      - in parameter form, check if it headerClassName() corresponds to the
        specified class name
      
      - in templated form, check if headerClassName() corresponds to the
        Type:typeName value.
        Specialization for <void> always returns true (ie, no checks)
      f44e59fb
  11. Aug 02, 2018
    • Mark OLESEN's avatar
      ENH: IOobject::selectIO helper method · 88e5334a
      Mark OLESEN authored
      - centralizes IOobject handling and treatment of alternative locations.
        If an alternative file location is specified, it will be used instead.
      
      - provide decompositionMethod::canonicalName instead of using
        "decomposeParDict" in various places.
      88e5334a
  12. Jul 30, 2018
  13. Jul 29, 2017
    • Mark OLESEN's avatar
      ENH: additional method for switching error throwing on/off (issue #552) · 797155f8
      Mark OLESEN authored
      - error::throwExceptions(bool) returning the previous state makes it
        easier to set and restore states.
      
      - throwing() method to query the current handling (if required).
      
      - the normal error::throwExceptions() and error::dontThrowExceptions()
        also return the previous state, to make it easier to restore later.
      797155f8
  14. Jan 19, 2016
  15. Nov 10, 2015
  16. Jan 22, 2013
  17. Aug 14, 2011
  18. Jan 19, 2011
  19. Jan 14, 2011
  20. Jan 07, 2011
  21. Jan 05, 2011
  22. Jul 28, 2010
  23. Jun 02, 2010
  24. Apr 20, 2010
  25. Mar 29, 2010
  26. Jan 20, 2010
  27. Mar 04, 2009
  28. Dec 31, 2008
  29. Jul 20, 2008
  30. Jun 25, 2008
  31. Apr 15, 2008