ENH: improve consistency in version handling (issue #1010)

- use std::string instead of c-string for the string constants

- centralize some definitions of resources into foamVersion.H

  Now expose some of the hard-coded values used in foamEtcFiles()
  so that they can be known or even overridden as required.

  Relocate to src/OpenFOAM/include as a constant location.
This commit is contained in:
Mark Olesen
2018-11-23 11:08:36 +01:00
parent 45d5d7bbc1
commit ac03307258
15 changed files with 286 additions and 166 deletions

View File

@ -24,7 +24,6 @@ License
\*---------------------------------------------------------------------------*/
#include "ensightGeoFile.H"
#include "foamVersion.H"
#include "macros.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -39,9 +38,9 @@ void Foam::ensightGeoFile::initialize()
// Description line 2
#if OPENFOAM
write("Written by OpenFOAM-" STRING_QUOTE(OPENFOAM));
write("Written by OpenFOAM " STRING_QUOTE(OPENFOAM));
#else
write(string("Written by OpenFOAM-" + string(foamVersion::version)));
write("Written by OpenFOAM");
#endif
newline();