From f98d8784579bc1695f10d7a58b658fae8d7c7edf Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 14 Sep 2020 11:27:05 +0100 Subject: [PATCH] OpenFOAM: Rationalised naming convention for file path pathName, pathname -> filePath --- applications/test/fileName/Test-fileName.C | 18 +++---- .../test/fileNameClean/Test-fileNameClean.C | 36 +++++++------- src/OSspecific/POSIX/POSIX.C | 36 +++++++------- src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C | 28 +++++------ src/OpenFOAM/db/IOstreams/Fstreams/IFstream.H | 16 +++---- src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C | 38 +++++++-------- src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H | 16 +++---- .../db/IOstreams/Fstreams/masterOFstream.C | 12 ++--- .../db/IOstreams/Fstreams/masterOFstream.H | 6 +-- .../collatedFileOperation/OFstreamCollator.C | 8 ++-- .../collatedFileOperation/OFstreamCollator.H | 4 +- .../threadedCollatedOFstream.C | 4 +- .../threadedCollatedOFstream.H | 2 +- .../primitives/strings/fileName/fileName.H | 4 +- src/conversion/ensight/file/ensightFile.C | 6 +-- src/conversion/ensight/file/ensightFile.H | 4 +- src/conversion/ensight/file/ensightGeoFile.C | 6 +-- src/conversion/ensight/file/ensightGeoFile.H | 4 +- src/fileFormats/obj/OBJstream.C | 4 +- src/fileFormats/obj/OBJstream.H | 4 +- wmake/scripts/makeFiles | 8 ++-- wmake/src/wmkdep.l | 48 +++++++++---------- 22 files changed, 156 insertions(+), 156 deletions(-) diff --git a/applications/test/fileName/Test-fileName.C b/applications/test/fileName/Test-fileName.C index b86c2cdf4a..c9be593cdd 100644 --- a/applications/test/fileName/Test-fileName.C +++ b/applications/test/fileName/Test-fileName.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,16 +50,16 @@ int main() wrdList[3] = "hello3"; wrdList[4] = "hello4.hmm"; - fileName pathName(wrdList); + fileName filePath(wrdList); - Info<< "pathName = " << pathName << nl - << "pathName.name() = >" << pathName.name() << "<\n" - << "pathName.path() = " << pathName.path() << nl - << "pathName.ext() = >" << pathName.ext() << "<\n" - << "pathName.name(true) = >" << pathName.name(true) << "<\n"; + Info<< "filePath = " << filePath << nl + << "filePath.name() = >" << filePath.name() << "<\n" + << "filePath.path() = " << filePath.path() << nl + << "filePath.ext() = >" << filePath.ext() << "<\n" + << "filePath.name(true) = >" << filePath.name(true) << "<\n"; - Info<< "pathName.components() = " << pathName.components() << nl - << "pathName.component(2) = " << pathName.component(2) << nl + Info<< "filePath.components() = " << filePath.components() << nl + << "filePath.component(2) = " << filePath.component(2) << nl << endl; // try with different combination diff --git a/applications/test/fileNameClean/Test-fileNameClean.C b/applications/test/fileNameClean/Test-fileNameClean.C index 1654d9604d..044554a11f 100644 --- a/applications/test/fileNameClean/Test-fileNameClean.C +++ b/applications/test/fileNameClean/Test-fileNameClean.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,19 +38,19 @@ Description using namespace Foam; -void printCleaning(fileName& pathName) +void printCleaning(fileName& filePath) { - Info<< "fileName = " << pathName << nl - << " path() = " << pathName.path() << nl - << " name() = " << pathName.name() << nl - << " joined = " << pathName.path()/pathName.name() << nl << nl; + Info<< "fileName = " << filePath << nl + << " path() = " << filePath.path() << nl + << " name() = " << filePath.name() << nl + << " joined = " << filePath.path()/filePath.name() << nl << nl; - pathName.clean(); + filePath.clean(); - Info<< "cleaned = " << pathName << nl - << " path() = " << pathName.path() << nl - << " name() = " << pathName.name() << nl - << " joined = " << pathName.path()/pathName.name() << nl << nl; + Info<< "cleaned = " << filePath << nl + << " path() = " << filePath.path() << nl + << " name() = " << filePath.name() << nl + << " joined = " << filePath.path()/filePath.name() << nl << nl; IOobject::writeDivider(Info); } @@ -74,8 +74,8 @@ int main(int argc, char *argv[]) args.printUsage(); } - fileName pathName; - if (args.optionReadIfPresent("case", pathName)) + fileName filePath; + if (args.optionReadIfPresent("case", filePath)) { Info<< nl << "-case" << nl @@ -86,18 +86,18 @@ int main(int argc, char *argv[]) << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl << endl; - printCleaning(pathName); + printCleaning(filePath); } for (label argI=1; argI < args.size(); ++argI) { - pathName = args[argI]; - printCleaning(pathName); + filePath = args[argI]; + printCleaning(filePath); } if (args.optionFound("istream")) { - args.optionLookup("istream")() >> pathName; + args.optionLookup("istream")() >> filePath; Info<< nl << "-case" << nl @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl << endl; - printCleaning(pathName); + printCleaning(filePath); } Info<< "\nEnd\n" << endl; diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index 15d143de6e..9ed0585878 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -287,11 +287,11 @@ bool Foam::chDir(const fileName& dir) } -bool Foam::mkDir(const fileName& pathName, mode_t mode) +bool Foam::mkDir(const fileName& filePath, mode_t mode) { if (POSIX::debug) { - Pout<< FUNCTION_NAME << " : pathName:" << pathName << " mode:" << mode + Pout<< FUNCTION_NAME << " : filePath:" << filePath << " mode:" << mode << endl; if ((POSIX::debug & 2) && !Pstream::master()) { @@ -300,13 +300,13 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) } // Empty names are meaningless - if (pathName.empty()) + if (filePath.empty()) { return false; } // Construct instance path directory if does not exist - if (::mkdir(pathName.c_str(), mode) == 0) + if (::mkdir(filePath.c_str(), mode) == 0) { // Directory made OK so return true return true; @@ -318,7 +318,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case EPERM: { FatalErrorInFunction - << "The filesystem containing " << pathName + << "The filesystem containing " << filePath << " does not support the creation of directories." << exit(FatalError); @@ -334,7 +334,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case EFAULT: { FatalErrorInFunction - << "" << pathName + << "" << filePath << " points outside your accessible address space." << exit(FatalError); @@ -346,7 +346,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) FatalErrorInFunction << "The parent directory does not allow write " "permission to the process,"<< nl - << "or one of the directories in " << pathName + << "or one of the directories in " << filePath << " did not allow search (execute) permission." << exit(FatalError); @@ -356,7 +356,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENAMETOOLONG: { FatalErrorInFunction - << "" << pathName << " is too long." + << "" << filePath << " is too long." << exit(FatalError); return false; @@ -365,14 +365,14 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENOENT: { // Part of the path does not exist so try to create it - if (pathName.path().size() && mkDir(pathName.path(), mode)) + if (filePath.path().size() && mkDir(filePath.path(), mode)) { - return mkDir(pathName, mode); + return mkDir(filePath, mode); } else { FatalErrorInFunction - << "Couldn't create directory " << pathName + << "Couldn't create directory " << filePath << exit(FatalError); return false; @@ -382,7 +382,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENOTDIR: { FatalErrorInFunction - << "A component used as a directory in " << pathName + << "A component used as a directory in " << filePath << " is not, in fact, a directory." << exit(FatalError); @@ -393,7 +393,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) { FatalErrorInFunction << "Insufficient kernel memory was available to make " - "directory " << pathName << '.' + "directory " << filePath << '.' << exit(FatalError); return false; @@ -402,7 +402,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case EROFS: { FatalErrorInFunction - << "" << pathName + << "" << filePath << " refers to a file on a read-only filesystem." << exit(FatalError); @@ -413,7 +413,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) { FatalErrorInFunction << "Too many symbolic links were encountered in resolving " - << pathName << '.' + << filePath << '.' << exit(FatalError); return false; @@ -422,7 +422,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) case ENOSPC: { FatalErrorInFunction - << "The device containing " << pathName + << "The device containing " << filePath << " has no room for the new directory or " << "the user's disk quota is exhausted." << exit(FatalError); @@ -433,7 +433,7 @@ bool Foam::mkDir(const fileName& pathName, mode_t mode) default: { FatalErrorInFunction - << "Couldn't create directory " << pathName + << "Couldn't create directory " << filePath << exit(FatalError); return false; diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C index d17cbfa1a5..90272813f1 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,12 +37,12 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::IFstreamAllocator::IFstreamAllocator(const fileName& pathname) +Foam::IFstreamAllocator::IFstreamAllocator(const fileName& filePath) : ifPtr_(nullptr), compression_(IOstream::UNCOMPRESSED) { - if (pathname.empty()) + if (filePath.empty()) { if (IFstream::debug) { @@ -50,32 +50,32 @@ Foam::IFstreamAllocator::IFstreamAllocator(const fileName& pathname) } } - ifPtr_ = new ifstream(pathname.c_str()); + ifPtr_ = new ifstream(filePath.c_str()); // If the file is compressed, decompress it before reading. if (!ifPtr_->good()) { - if (isFile(pathname + ".gz", false, false)) + if (isFile(filePath + ".gz", false, false)) { delete ifPtr_; if (IFstream::debug) { - InfoInFunction << "Decompressing " << pathname + ".gz" << endl; + InfoInFunction << "Decompressing " << filePath + ".gz" << endl; } - ifPtr_ = new igzstream((pathname + ".gz").c_str()); + ifPtr_ = new igzstream((filePath + ".gz").c_str()); if (ifPtr_->good()) { compression_ = IOstream::COMPRESSED; } } - else if (isFile(pathname + ".orig", false, false)) + else if (isFile(filePath + ".orig", false, false)) { delete ifPtr_; - ifPtr_ = new ifstream((pathname + ".orig").c_str()); + ifPtr_ = new ifstream((filePath + ".orig").c_str()); } } } @@ -91,12 +91,12 @@ Foam::IFstreamAllocator::~IFstreamAllocator() Foam::IFstream::IFstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format, versionNumber version ) : - IFstreamAllocator(pathname), + IFstreamAllocator(filePath), ISstream ( *ifPtr_, @@ -105,7 +105,7 @@ Foam::IFstream::IFstream version, IFstreamAllocator::compression_ ), - pathname_(pathname) + filePath_(filePath) { setClosed(); @@ -175,7 +175,7 @@ Foam::IFstream& Foam::IFstream::operator()() const if (!good()) { // also checks variants - if (isFile(pathname_, true, true)) + if (isFile(filePath_, true, true)) { check("IFstream::operator()"); FatalIOError.exit(); @@ -183,7 +183,7 @@ Foam::IFstream& Foam::IFstream::operator()() const else { FatalIOErrorInFunction(*this) - << "file " << pathname_ << " does not exist" + << "file " << filePath_ << " does not exist" << exit(FatalIOError); } } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.H b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.H index 67261bf1da..675d7131e9 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.H +++ b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,8 +66,8 @@ class IFstreamAllocator // Constructors - //- Construct from pathname - IFstreamAllocator(const fileName& pathname); + //- Construct from filePath + IFstreamAllocator(const fileName& filePath); //- Destructor @@ -86,7 +86,7 @@ class IFstream { // Private Data - fileName pathname_; + fileName filePath_; public: @@ -96,10 +96,10 @@ public: // Constructors - //- Construct from pathname + //- Construct from filePath IFstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format=ASCII, versionNumber version=currentVersion ); @@ -116,13 +116,13 @@ public: //- Return the name of the stream const fileName& name() const { - return pathname_; + return filePath_; } //- Return non-const access to the name of the stream fileName& name() { - return pathname_; + return filePath_; } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C index 000271297c..a39ff9a6a1 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,14 +39,14 @@ namespace Foam Foam::OFstreamAllocator::OFstreamAllocator ( - const fileName& pathname, + const fileName& filePath, IOstream::compressionType compression, const bool append ) : ofPtr_(nullptr) { - if (pathname.empty()) + if (filePath.empty()) { if (OFstream::debug) { @@ -62,43 +62,43 @@ Foam::OFstreamAllocator::OFstreamAllocator if (compression == IOstream::COMPRESSED) { // Get identically named uncompressed version out of the way - fileType pathType = Foam::type(pathname, false, false); + fileType pathType = Foam::type(filePath, false, false); if (pathType == fileType::file || pathType == fileType::link) { - rm(pathname); + rm(filePath); } - fileName gzPathName(pathname + ".gz"); + fileName gzfilePath(filePath + ".gz"); - if (!append && Foam::type(gzPathName) == fileType::link) + if (!append && Foam::type(gzfilePath) == fileType::link) { // Disallow writing into softlink to avoid any problems with // e.g. softlinked initial fields - rm(gzPathName); + rm(gzfilePath); } - ofPtr_ = new ogzstream(gzPathName.c_str(), mode); + ofPtr_ = new ogzstream(gzfilePath.c_str(), mode); } else { // get identically named compressed version out of the way - fileName gzPathName(pathname + ".gz"); - fileType gzType = Foam::type(gzPathName, false, false); + fileName gzfilePath(filePath + ".gz"); + fileType gzType = Foam::type(gzfilePath, false, false); if (gzType == fileType::file || gzType == fileType::link) { - rm(gzPathName); + rm(gzfilePath); } if ( !append - && Foam::type(pathname, false, false) == fileType::link + && Foam::type(filePath, false, false) == fileType::link ) { // Disallow writing into softlink to avoid any problems with // e.g. softlinked initial fields - rm(pathname); + rm(filePath); } - ofPtr_ = new ofstream(pathname.c_str(), mode); + ofPtr_ = new ofstream(filePath.c_str(), mode); } } @@ -113,16 +113,16 @@ Foam::OFstreamAllocator::~OFstreamAllocator() Foam::OFstream::OFstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format, versionNumber version, compressionType compression, const bool append ) : - OFstreamAllocator(pathname, compression, append), + OFstreamAllocator(filePath, compression, append), OSstream(*ofPtr_, "OFstream.sinkFile_", format, version, compression), - pathname_(pathname) + filePath_(filePath) { setClosed(); setState(ofPtr_->rdstate()); @@ -132,7 +132,7 @@ Foam::OFstream::OFstream if (debug) { InfoInFunction - << "Could not open file " << pathname + << "Could not open file " << filePath << "for input\n" "in stream " << info() << Foam::endl; } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H index b73e7c6ee1..582c211112 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H +++ b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,10 +62,10 @@ class OFstreamAllocator // Constructors - //- Construct from pathname + //- Construct from filePath OFstreamAllocator ( - const fileName& pathname, + const fileName& filePath, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool append = false ); @@ -87,7 +87,7 @@ class OFstream { // Private Data - fileName pathname_; + fileName filePath_; public: @@ -98,10 +98,10 @@ public: // Constructors - //- Construct from pathname + //- Construct from filePath OFstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED, @@ -120,13 +120,13 @@ public: //- Return the name of the stream const fileName& name() const { - return pathname_; + return filePath_; } //- Return non-const access to the name of the stream fileName& name() { - return pathname_; + return filePath_; } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.C index b8a01dab36..09b47fda31 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ void Foam::masterOFstream::checkWrite Foam::masterOFstream::masterOFstream ( - const fileName& pathName, + const fileName& filePath, streamFormat format, versionNumber version, compressionType compression, @@ -79,7 +79,7 @@ Foam::masterOFstream::masterOFstream ) : OStringStream(format, version), - pathName_(pathName), + filePath_(filePath), compression_(compression), append_(append), write_(write) @@ -93,7 +93,7 @@ Foam::masterOFstream::~masterOFstream() if (Pstream::parRun()) { List filePaths(Pstream::nProcs()); - filePaths[Pstream::myProcNo()] = pathName_; + filePaths[Pstream::myProcNo()] = filePath_; Pstream::gatherList(filePaths); bool uniform = @@ -108,7 +108,7 @@ Foam::masterOFstream::~masterOFstream() { if (Pstream::master() && write_) { - checkWrite(pathName_, str()); + checkWrite(filePath_, str()); } return; } @@ -161,7 +161,7 @@ Foam::masterOFstream::~masterOFstream() } else { - checkWrite(pathName_, str()); + checkWrite(filePath_, str()); } } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.H b/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.H index 7348051b39..91a14e4d30 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.H +++ b/src/OpenFOAM/db/IOstreams/Fstreams/masterOFstream.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,7 +52,7 @@ class masterOFstream { // Private Data - const fileName pathName_; + const fileName filePath_; const IOstream::compressionType compression_; @@ -75,7 +75,7 @@ public: //- Construct and set stream status masterOFstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED, diff --git a/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C b/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C index dcdaacb248..d1aec03d88 100644 --- a/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C +++ b/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -215,7 +215,7 @@ void* Foam::OFstreamCollator::writeAll(void *threadarg) ( ptr->comm_, ptr->typeName_, - ptr->pathName_, + ptr->filePath_, ptr->data_, ptr->sizes_, slaveData, @@ -226,8 +226,8 @@ void* Foam::OFstreamCollator::writeAll(void *threadarg) ); if (!ok) { - FatalIOErrorInFunction(ptr->pathName_) - << "Failed writing " << ptr->pathName_ + FatalIOErrorInFunction(ptr->filePath_) + << "Failed writing " << ptr->filePath_ << exit(FatalIOError); } diff --git a/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.H b/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.H index fcbb3fd3e2..4d0c53777f 100644 --- a/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.H +++ b/src/OpenFOAM/global/fileOperations/collatedFileOperation/OFstreamCollator.H @@ -77,7 +77,7 @@ class OFstreamCollator const label comm_; const word typeName_; - const fileName pathName_; + const fileName filePath_; const string data_; const labelList sizes_; PtrList> slaveData_; @@ -101,7 +101,7 @@ class OFstreamCollator : comm_(comm), typeName_(typeName), - pathName_(filePath), + filePath_(filePath), data_(data), sizes_(sizes), slaveData_(0), diff --git a/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.C b/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.C index 22d6fc2a15..2a3dedbfef 100644 --- a/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.C +++ b/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.C @@ -41,7 +41,7 @@ Foam::threadedCollatedOFstream::threadedCollatedOFstream : OStringStream(format, version), writer_(writer), - pathName_(filePath), + filePath_(filePath), compression_(compression), useThread_(useThread) {} @@ -54,7 +54,7 @@ Foam::threadedCollatedOFstream::~threadedCollatedOFstream() writer_.write ( decomposedBlockData::typeName, - pathName_, + filePath_, str(), IOstream::BINARY, version(), diff --git a/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.H b/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.H index 8ea72d06aa..1148ea214b 100644 --- a/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.H +++ b/src/OpenFOAM/global/fileOperations/collatedFileOperation/threadedCollatedOFstream.H @@ -56,7 +56,7 @@ class threadedCollatedOFstream OFstreamCollator& writer_; - const fileName pathName_; + const fileName filePath_; const IOstream::compressionType compression_; diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.H b/src/OpenFOAM/primitives/strings/fileName/fileName.H index 8cd1a8ccc4..a5fe0cb42c 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileName.H +++ b/src/OpenFOAM/primitives/strings/fileName/fileName.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -247,7 +247,7 @@ public: }; -//- Assemble words and fileNames as pathnames by adding a '/' separator +//- Assemble words and fileNames as filePaths by adding a '/' separator fileName operator/(const string&, const string&); diff --git a/src/conversion/ensight/file/ensightFile.C b/src/conversion/ensight/file/ensightFile.C index a07ed51966..5ec67b9f97 100644 --- a/src/conversion/ensight/file/ensightFile.C +++ b/src/conversion/ensight/file/ensightFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,11 +83,11 @@ Foam::label Foam::ensightFile::subDirWidth() Foam::ensightFile::ensightFile ( - const fileName& pathname, + const fileName& filePath, IOstream::streamFormat format ) : - OFstream(pathname, format) + OFstream(filePath, format) { // ascii formatting specs setf diff --git a/src/conversion/ensight/file/ensightFile.H b/src/conversion/ensight/file/ensightFile.H index 9811533123..f0285d6fe1 100644 --- a/src/conversion/ensight/file/ensightFile.H +++ b/src/conversion/ensight/file/ensightFile.H @@ -68,10 +68,10 @@ public: // Constructors - //- Construct from pathname + //- Construct from filePath ensightFile ( - const fileName& pathname, + const fileName& filePath, IOstream::streamFormat format=IOstream::BINARY ); diff --git a/src/conversion/ensight/file/ensightGeoFile.C b/src/conversion/ensight/file/ensightGeoFile.C index 5b2efd07da..aab24b15b6 100644 --- a/src/conversion/ensight/file/ensightGeoFile.C +++ b/src/conversion/ensight/file/ensightGeoFile.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,11 +29,11 @@ License Foam::ensightGeoFile::ensightGeoFile ( - const fileName& pathname, + const fileName& filePath, IOstream::streamFormat format ) : - ensightFile(pathname, format) + ensightFile(filePath, format) { writeBinaryHeader(); write("Ensight Geometry File"); newline(); diff --git a/src/conversion/ensight/file/ensightGeoFile.H b/src/conversion/ensight/file/ensightGeoFile.H index 4e3e3fc9fc..f369aa2abf 100644 --- a/src/conversion/ensight/file/ensightGeoFile.H +++ b/src/conversion/ensight/file/ensightGeoFile.H @@ -51,10 +51,10 @@ public: // Constructors - //- Construct from pathname + //- Construct from filePath ensightGeoFile ( - const fileName& pathname, + const fileName& filePath, IOstream::streamFormat format=IOstream::BINARY ); diff --git a/src/fileFormats/obj/OBJstream.C b/src/fileFormats/obj/OBJstream.C index 47989f315c..87300d950c 100644 --- a/src/fileFormats/obj/OBJstream.C +++ b/src/fileFormats/obj/OBJstream.C @@ -58,13 +58,13 @@ void Foam::OBJstream::writeAndCheck(const char c) Foam::OBJstream::OBJstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format, versionNumber version, compressionType compression ) : - OFstream(pathname, format, version, compression), + OFstream(filePath, format, version, compression), startOfLine_(true), nVertices_(0) {} diff --git a/src/fileFormats/obj/OBJstream.H b/src/fileFormats/obj/OBJstream.H index 971d9603a4..32f8653e90 100644 --- a/src/fileFormats/obj/OBJstream.H +++ b/src/fileFormats/obj/OBJstream.H @@ -74,10 +74,10 @@ public: // Constructors - //- Construct from pathname + //- Construct from filePath OBJstream ( - const fileName& pathname, + const fileName& filePath, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED diff --git a/wmake/scripts/makeFiles b/wmake/scripts/makeFiles index b91f720eaa..01f4b1a80c 100755 --- a/wmake/scripts/makeFiles +++ b/wmake/scripts/makeFiles @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | Website: https://openfoam.org -# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -63,11 +63,11 @@ echo >> Make/files for file in `find . -name "*.[cCylLfF]" -type f -print` do fileName=`echo ${file##*/}` - pathName=`echo ${file%/*} | sed 's%^\.%%' | sed 's%^/%%' | $dirToString` + filePath=`echo ${file%/*} | sed 's%^\.%%' | sed 's%^/%%' | $dirToString` - if [ -n "$pathName" ] + if [ -n "$filePath" ] then - echo '$('$pathName')/'$fileName >> Make/files + echo '$('$filePath')/'$fileName >> Make/files else echo $fileName >> Make/files fi diff --git a/wmake/src/wmkdep.l b/wmake/src/wmkdep.l index 2c8a017aff..166a219f48 100644 --- a/wmake/src/wmkdep.l +++ b/wmake/src/wmkdep.l @@ -3,7 +3,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,11 +94,11 @@ const char* currentPath = NULL; void nextFile(const char* fileName); int lookUp(struct HashEntry** hashTable, const char* p); -void addFile(char* pathName); -void openFile(const char* pathName); +void addFile(char* filePath); +void openFile(const char* filePath); char* strRep(char* str, struct searchReplace* sr); -char* substitutePath(char* pathName); -void printFile(FILE* file, const char* pathName); +char* substitutePath(char* filePath); +void printFile(FILE* file, const char* filePath); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -285,17 +285,17 @@ int main(int argc, char* argv[]) /* Add a directory name to the file name */ char* addDirectoryName(const char* dirName, const char* fileName) { - char* pathName = (char*)malloc(strlen(dirName) + strlen(fileName) + 2); - strcpy(pathName, dirName); + char* filePath = (char*)malloc(strlen(dirName) + strlen(fileName) + 2); + strcpy(filePath, dirName); if (dirName[strlen(dirName)-1] != '/') { - strcat(pathName, "/"); + strcat(filePath, "/"); } - strcat(pathName, fileName); + strcat(filePath, fileName); - return pathName; + return filePath; } @@ -317,17 +317,17 @@ void nextFile(const char* fileName) int i; for (i = 0; i < nDirectories; i++) { - char* pathName = addDirectoryName(directories[i], fileName); + char* filePath = addDirectoryName(directories[i], fileName); - if (access(pathName, R_OK ) != -1) + if (access(filePath, R_OK ) != -1) { - addFile(pathName); + addFile(filePath); currentPath = directories[i]; return; } - free(pathName); + free(filePath); } if (nDirectories == 0) @@ -393,7 +393,7 @@ int lookUp(struct HashEntry** hashTable, const char* p) /* Add file to list */ -void addFile(char* pathName) +void addFile(char* filePath) { if (nFiles == maxNfiles - 1) { @@ -401,20 +401,20 @@ void addFile(char* pathName) files = (char**)realloc(files, sizeof(char*)*maxNfiles); } - files[nFiles++] = pathName; + files[nFiles++] = filePath; } /* Open file and set yyin */ -void openFile(const char* pathName) +void openFile(const char* filePath) { - if (!(yyin = fopen(pathName, "r"))) + if (!(yyin = fopen(filePath, "r"))) { fprintf ( stderr, "could not open file %s for source file %s due to %s\n", - pathName, sourceFile, strerror(errno) + filePath, sourceFile, strerror(errno) ); } } @@ -455,25 +455,25 @@ char* strRep(char* str, struct searchReplace* sr) /* Substitute path components with command-line replacements */ -char* substitutePath(char* pathName) +char* substitutePath(char* filePath) { if (nReplacements) { int i; for (i = 0; i < nReplacements; i++) { - pathName = strRep(pathName, &replacements[i]); + filePath = strRep(filePath, &replacements[i]); } } - return pathName; + return filePath; } /* Print file path to the dependencies file */ -void printFile(FILE* file, const char* pathName) +void printFile(FILE* file, const char* filePath) { - fprintf(file, "%s \\\n", pathName); + fprintf(file, "%s \\\n", filePath); }