1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
30 \*---------------------------------------------------------------------------*/
36 #include "IOstreams.H"
37 #include "OSspecific.H"
42 void printCleaning(fileName& pathName)
44 Info<< "fileName = " << pathName << nl
45 << " path() = " << pathName.path() << nl
46 << " name() = " << pathName.name() << nl
47 << " joined = " << pathName.path()/pathName.name() << nl << nl;
51 Info<< "cleaned = " << pathName << nl
52 << " path() = " << pathName.path() << nl
53 << " name() = " << pathName.name() << nl
54 << " joined = " << pathName.path()/pathName.name() << nl << nl;
56 IOobject::writeDivider(Info);
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 int main(int argc, char *argv[])
66 argList::noParallel();
67 argList::validArgs.insert("fileName .. fileNameN");
68 argList::addOption("istream", "fileName", "test Istream values");
70 argList args(argc, argv, false, true);
72 if (args.size() <= 1 && args.options().empty())
78 if (args.optionReadIfPresent("case", pathName))
82 << "path = " << args.path() << nl
83 << "root = " << args.rootPath() << nl
84 << "case = " << args.caseName() << nl
85 << "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
86 << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
89 printCleaning(pathName);
92 for (label argI=1; argI < args.size(); ++argI)
94 pathName = args[argI];
95 printCleaning(pathName);
98 if (args.optionFound("istream"))
100 args.optionLookup("istream")() >> pathName;
104 << "path = " << args.path() << nl
105 << "root = " << args.rootPath() << nl
106 << "case = " << args.caseName() << nl
107 << "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
108 << "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
111 printCleaning(pathName);
114 Info<< "\nEnd\n" << endl;
119 // ************************************************************************* //