Commit Graph

30 Commits

Author SHA1 Message Date
Mark Olesen
b060378dca ENH: improve consistency of fileName handling windows/non-windows (#2057)
- 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
2021-04-19 16:33:42 +00:00
Andrew Heather
69a61bf835 BUG: objToVTK - corrected for empty lines in obj file. See #1632 2020-03-16 10:21:34 +00:00
Mark Olesen
7c1190f0b1 ENH: rationalize some string methods.
- 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()
2019-11-11 18:50:00 +01:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
f38190213c ENH: support usage descriptions for command arguments 2018-12-12 11:58:56 +01:00
Mark Olesen
68ec561df8 STYLE: add usage notes to more utilities and solvers 2018-12-11 15:25:27 +01:00
Mark Olesen
1f953b807c ENH: use double for VTK legacy output (issue #891)
- 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.
2018-06-21 10:24:04 +02:00
Mark Olesen
f2ba618c19 STYLE: consistency in using argList::addArgument, argList::addOption 2017-11-22 12:54:28 +01:00
Mark Olesen
86ef9e86dc ENH: make treatment of stream allocators more uniform (issue #532)
- 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.
2017-07-17 15:14:38 +02:00
Andrew Heather
efb39a8790 ENH: (further) Doxygen documentation updates for module support 2016-06-27 20:34:19 +01:00
Henry Weller
e2ef006b91 applications: Update ...ErrorIn -> ...ErrorInFunction
Avoids the clutter and maintenance effort associated with providing the
function signature string.
2015-11-10 17:53:31 +00:00
mattijs
101aa4e6f4 ENH: objToVTK: output lines 2013-12-05 16:41:39 +00:00
andy
951c8436aa ENH: Applying Gijs' patch: Update header documentation for utilities 2013-02-21 10:54:34 +00:00
laurence
e0824b9692 BUG: objToVTK: Do not print vertex normal header in vtk if none are in the obj 2012-01-05 17:45:46 +00:00
laurence
46421f7e2d ENH: objToVTK: Add support for vertex normals (vn) 2012-01-04 11:47:49 +00:00
Henry
c2dd153a14 Copyright transfered to the OpenFOAM Foundation 2011-08-14 12:17:30 +01:00
andy
eaef8d482b STYLE: Updated 1991 start copyright year to 2004 2011-01-14 16:08:00 +00:00
andy
099cc39e2e Revert "STYLE: 2011 copyright date."
This reverts commit b18f6cc1ce.
2011-01-05 18:24:29 +00:00
graham
b18f6cc1ce STYLE: 2011 copyright date. 2011-01-05 11:14:26 +00:00
Mark Olesen
35afeb9b18 STYLE: remove superfluous uses of argList::validArgs.clear()
- a holdover from the old <root> <case> days
2010-05-03 08:38:39 +02:00
Mark Olesen
4d2a297a67 BUG: syntax problems found by gcc-4.5.0
- "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’
2010-04-22 09:00:31 +02:00
Mark Olesen
d29c438657 STYLE: use url for FSF license instead of postal address, switch to GPL v3 2010-03-29 14:07:56 +02:00
Mark Olesen
d857d671ac STYLE: use new argList argRead() method and operator[] for cleaner code.
- deprecate argList::additionalArgs() method and remove uses of it
2010-02-16 17:57:49 +01:00
Mark Olesen
fa93ce8cd7 coding style adherence
- markup codingStyleGuide.org examples so they actually indent correctly

- use 'Info<<' as per codingStyleGuide instead of 'Info <<'
2009-11-27 15:39:14 +01:00
Mark Olesen
95dcb6ded7 Simplify checking of container (List/HashTable, strings) sizes
- 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
2009-01-10 20:28:06 +01:00
Mark Olesen
b85c9a7487 avoided some unneeded conversions of string::npos, minor cleanup of className
- 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
2009-01-09 15:15:21 +01:00
Mark Olesen
28b200bcd9 update copyrights for 2009 2008-12-31 19:01:56 +01:00
Mark Olesen
02cabc3cf2 updated Copyright (C) \d+-2008 OpenCFD Ltd. 2008-06-25 15:01:46 +02:00
OpenFOAM-admin
3170c7c0c9 Creation of OpenFOAM-dev repository 15/04/2008 2008-04-15 18:56:58 +01:00