- wrap command-line retrieval of fileName with an implicit validate.
Instead of this:
fileName input(args[1]);
fileName other(args["someopt"]);
Now use this:
auto input = args.get<fileName>(1);
auto other = args.get<fileName>("someopt");
which adds a fileName::validate on the inputs
Because of how it is implemented, it will automatically also apply
to argList getOrDefault<fileName>, readIfPresent<fileName> etc.
- adjust fileName::validate and clean to handle backslash conversion.
This makes it easier to ensure that path names arising from MS-Windows
are consistently handled internally.
- dictionarySearch: now check for initial '/' directly instead of
relying on fileName isAbsolute(), which now does more things
BREAKING: remove fileName::clean() const method
- relying on const/non-const to control the behaviour (inplace change
or return a copy) is too fragile and the const version was
almost never used.
Replace:
fileName sanitized = constPath.clean();
With:
fileName sanitized(constPath);
sanitized.clean());
STYLE: test empty() instead of comparing with fileName::null
- silently deprecate 'startsWith', 'endsWith' methods
(added in 2016: 2b14360662), in favour of
'starts_with', 'ends_with' methods, corresponding to C++20 and
allowing us to cull then in a few years.
- handle single character versions of starts_with, ends_with.
- add single character version of removeEnd and silently deprecate
removeTrailing which did the same thing.
- drop the const versions of removeRepeated, removeTrailing.
Unused and with potential confusion.
STYLE: use shrink_to_fit(), erase()
- some paraview versions (eg, on windows) don't support float, only double.
This mostly affected the vtkSurfaceWriter.
The foamToVTK is also affected, but since it also supports the XML
output formats (vtp, vtu) these can be used instead.
- use allocator class to wrap the stream pointers instead of passing
them into ISstream, OSstream and using a dynamic cast to delete
then. This is especially important if we will have a bidirectional
stream (can't delete twice!).
STYLE:
- file stream constructors with std::string (C++11)
- for rewind, explicit about in|out direction. This is not currently
important, but avoids surprises with any future bidirectional access.
- combined string streams in StringStream.H header.
Similar to <sstream> include that has both input and output string
streams.
- "cpp -traditional-cpp" doesn't strip C++-style comments
Probably need a workaround with sed -e 's@^ *//@@' if we
wish to support C++-style comments in Make/{files,options}
- lduMatrixTests.C:121:1:
error: ‘Foam::lduMatrix::solverPerformance::solverPerformance’ names
the constructor, not the type
- edgeFaceCirculatorI.H:355:1:
error: ‘Foam::edgeFaceCirculator::edgeFaceCirculator’ names the
constructor, not the type
- patchPointEdgeCirculatorI.H:236:1:
error: ‘Foam::patchPointEdgeCirculator::patchPointEdgeCirculator’
names the constructor, not the type
- objToVTK.C:116:5:
error: ‘Foam::argList::argList’ names the constructor, not the type
same in surfaceClean.C, surfaceRefineRedGreen.C, surfaceSplitByPatch.C
- fireFoam/createFields.H:74:41:
error: type/value mismatch at argument 1 in template parameter list
for ‘template<class T> class Foam::autoPtr’
- can use 'XX.empty()' instead of 'XX.size() == 0', 'XX.size() < 1' or
'XX.size() <= 0' or for simpler coding.
It also has the same number of characters as '!XX.size()' and /might/ be
more readable
- many size checking had 'XX.size() > 0', 'XX.size() != 0', or 'XX.size() >= 1'
when a simple 'XX.size()' suffices
- string doesn't use any debug info, remove it
- restructured the macros to add in NoDebug macro versions to className,
typeInfo. Might be helpful with tackling the globals bootstrapping issue.
- HashTableName + StaticHashTableName - avoid lookup of debug switch when
FULLDEBUG is not defined