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:
Mark Olesen
2022-10-06 11:33:07 +02:00
parent 98a510c317
commit 779a2ca084
89 changed files with 686 additions and 580 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2013 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -156,10 +156,10 @@ int main(int argc, char *argv[])
if (changed)
{
const fileName name(surf.name());
surf.rename(name.lessExt() + "_patched." + name.ext());
const word oldName(surf.name());
surf.rename(oldName.lessExt() + "_patched." + oldName.ext());
Info<< "Writing repatched surface " << name << " to "
Info<< "Writing repatched surface " << oldName << " to "
<< surf.name() << nl << endl;
surf.write();