mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: adjust fileName methods for similarity to std::filesystem::path
- stem(), replace_name(), replace_ext(), remove_ext() etc
- string::contains() method - similar to C++23 method
Eg,
if (keyword.contains('/')) ...
vs
if (keyword.find('/') != std::string::npos) ...
This commit is contained in:
@ -64,13 +64,12 @@ using namespace Foam::coordinateRotations;
|
||||
|
||||
static word getExtension(const fileName& name)
|
||||
{
|
||||
word ext(name.ext());
|
||||
if (ext == "gz")
|
||||
{
|
||||
ext = name.lessExt().ext();
|
||||
}
|
||||
|
||||
return ext;
|
||||
return
|
||||
(
|
||||
name.has_ext("gz")
|
||||
? name.stem().ext()
|
||||
: name.ext()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user