mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
ENH: consolidate, cleanup some string methods
- consolidate word::validated() into word::validate() and also allow as short form for string::validate<word>(). Also less confusing than having similarly named methods that essentially do the same thing. - more consistent const access when iterating over strings - add valid(char) for keyType and wordRe
This commit is contained in:
@ -207,7 +207,7 @@ int main(int argc, char *argv[])
|
||||
// #include "checkHasMovingMesh.H"
|
||||
// #include "checkHasLagrangian.H"
|
||||
|
||||
IOobjectList objects(mesh, timeDirs[timeDirs.size()-1].name());
|
||||
IOobjectList objects(mesh, timeDirs.last().name());
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
|
||||
@ -488,7 +488,7 @@ mtype {space}"MTYPE:"{space}
|
||||
|
||||
<cellStreamTitle>{spaceNl}{word}{spaceNl} {
|
||||
|
||||
word streamName(Foam::string::validate<word>(YYText()));
|
||||
const word streamName(word::validate(YYText()));
|
||||
|
||||
BEGIN(cellStreamFlags);
|
||||
}
|
||||
|
||||
@ -370,7 +370,7 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
||||
lineStr >> regionI >> regionName;
|
||||
|
||||
Info<< " " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
<< word::validate(regionName) << endl;
|
||||
}
|
||||
else if (nSpaces == 2)
|
||||
{
|
||||
@ -380,21 +380,21 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
|
||||
if (physType == 1)
|
||||
{
|
||||
Info<< " " << "Line " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
<< word::validate(regionName) << endl;
|
||||
}
|
||||
else if (physType == 2)
|
||||
{
|
||||
Info<< " " << "Surface " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
<< word::validate(regionName) << endl;
|
||||
}
|
||||
else if (physType == 3)
|
||||
{
|
||||
Info<< " " << "Volume " << regionI << '\t'
|
||||
<< string::validate<word>(regionName) << endl;
|
||||
<< word::validate(regionName) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
physicalNames.insert(regionI, string::validate<word>(regionName));
|
||||
physicalNames.insert(regionI, word::validate(regionName));
|
||||
}
|
||||
|
||||
inFile.getLine(line);
|
||||
|
||||
@ -512,7 +512,7 @@ void readSets
|
||||
>> dofSet >> tempSet >> contactSet >> nFaces;
|
||||
|
||||
is.getLine(line);
|
||||
word groupName = string::validate<word>(line);
|
||||
const word groupName = word::validate(line);
|
||||
|
||||
Info<< "For group " << group
|
||||
<< " named " << groupName
|
||||
|
||||
Reference in New Issue
Block a user