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

@ -455,7 +455,7 @@ Foam::string Foam::stringOps::getVariable
}
else if (allowEnvVars)
{
value = getEnv(name);
value = Foam::getEnv(name);
if (value.empty() && !name.empty())
{
@ -468,7 +468,7 @@ Foam::string Foam::stringOps::getVariable
if (altType)
{
value = getEnv
value = Foam::getEnv
(
// var-name
word(name.substr(0, altPos), false)
@ -872,7 +872,7 @@ void Foam::stringOps::inplaceExpand
);
}
const string varValue = getEnv(varName);
const string varValue = Foam::getEnv(varName);
if (varValue.size())
{
if (altPos != std::string::npos && altType == '+')
@ -948,7 +948,7 @@ bool Foam::stringOps::inplaceReplaceVar(std::string& s, const word& varName)
return false;
}
const string content(getEnv(varName));
const string content(Foam::getEnv(varName));
if (content.empty())
{
return false;