From 2a01530fcf9b4a5ab5f38c09aea1367b914571c3 Mon Sep 17 00:00:00 2001 From: henry Date: Wed, 23 Jul 2008 17:54:24 +0100 Subject: [PATCH] Removed spurious files --- .../db/IOstreams/Fstreams/zfIFstream.C | 179 ------------------ .../db/IOstreams/Fstreams/zfOFstream.C | 151 --------------- 2 files changed, 330 deletions(-) delete mode 100644 src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C delete mode 100644 src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C deleted file mode 100644 index da862fdf99..0000000000 --- a/src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C +++ /dev/null @@ -1,179 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "IFstream.H" -#include "OSspecific.H" -#include "zfstream.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(IFstream, 0); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -IFstreamAllocator::IFstreamAllocator(const fileName& pathname) -: - ifPtr_(NULL), - compression_(IOstream::UNCOMPRESSED) -{ - if (!pathname.size()) - { - if (IFstream::debug) - { - Info<< "IFstreamAllocator::IFstreamAllocator" - "(const fileName& pathname) : " - "can't open null file " - << endl; - } - } - - ifPtr_ = new ifstream(pathname.c_str()); - - // If the file is compressed, decompress it before reading. - if (!ifPtr_->good() && file(pathname + ".gz")) - { - if (IFstream::debug) - { - Info<< "IFstreamAllocator::IFstreamAllocator" - "(const fileName& pathname) : " - "decompressing " << pathname + ".gz" - << endl; - } - - delete ifPtr_; - - ifPtr_ = new gzifstream((pathname + ".gz").c_str()); - - if (ifPtr_->good()) - { - compression_ = IOstream::COMPRESSED; - } - } -} - - -IFstreamAllocator::~IFstreamAllocator() -{ - delete ifPtr_; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -IFstream::IFstream -( - const fileName& pathname, - streamFormat format, - versionNumber version -) -: - IFstreamAllocator(pathname), - ISstream - ( - *ifPtr_, - "IFstream.sourceFile_", - format, - version, - IFstreamAllocator::compression_ - ), - pathname_(pathname) -{ - setClosed(); - - setState(ifPtr_->rdstate()); - - if (!good()) - { - if (debug) - { - Info<< "IFstream::IFstream(const fileName& pathname," - "streamFormat format=ASCII," - "versionNumber version=currentVersion) : " - "couldn't open File for input" - << endl << info() << endl; - } - - setBad(); - } - else - { - setOpened(); - } - - lineNumber_ = 1; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -IFstream::~IFstream() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void IFstream::print(Ostream& os) const -{ - // Print File data - os << "IFstream: "; - ISstream::print(os); -} - - -//- Return a non-const reference to const Istream -// Needed for read-constructors where the stream argument is temporary: -// e.g. thing thisThing(IFstream("thingFileName")()); -IFstream& IFstream::operator()() const -{ - if (!good()) - { - if (!file(pathname_) && !file(pathname_ + ".gz")) - { - FatalIOErrorIn("IFstream::operator()", *this) - << "file " << pathname_ << " does not exist" - << exit(FatalIOError); - } - else - { - check("IFstream::operator()"); - FatalIOError.exit(); - } - } - - return const_cast(*this); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C deleted file mode 100644 index e2cc170627..0000000000 --- a/src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C +++ /dev/null @@ -1,151 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "OFstream.H" -#include "OSspecific.H" -#include "zfstream.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(OFstream, 0); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -OFstreamAllocator::OFstreamAllocator -( - const fileName& pathname, - IOstream::compressionType compression -) -: - ofPtr_(NULL) -{ - if (!pathname.size()) - { - if (OFstream::debug) - { - Info - << "OFstreamAllocator::OFstreamAllocator" - "(const fileName& pathname) : " - "can't open null file " - << endl; - } - } - - if (compression == IOstream::COMPRESSED) - { - if (file(pathname)) - { - rm(pathname); - } - - gzofstream* gzofPtr = new gzofstream((pathname + ".gz").c_str()); - gzofPtr->buffer_.setcompressionlevel(Z_BEST_SPEED); - ofPtr_ = gzofPtr; - } - else - { - if (file(pathname + ".gz")) - { - rm(pathname + ".gz"); - } - - ofPtr_ = new ofstream(pathname.c_str()); - } -} - - -OFstreamAllocator::~OFstreamAllocator() -{ - delete ofPtr_; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -OFstream::OFstream -( - const fileName& pathname, - streamFormat format, - versionNumber version, - compressionType compression -) -: - OFstreamAllocator(pathname, compression), - OSstream(*ofPtr_, "OFstream.sinkFile_", format, version, compression), - pathname_(pathname) -{ - setClosed(); - - setState(ofPtr_->rdstate()); - - if (!good()) - { - if (debug) - { - Info<< "IFstream::IFstream(const fileName& pathname," - "streamFormat format=ASCII," - "versionNumber version=currentVersion) : " - "couldn't open File for input\n" - "in stream " << info() << Foam::endl; - } - - setBad(); - } - else - { - setOpened(); - } - - lineNumber_ = 1; -} - - -// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // - -OFstream::~OFstream() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void OFstream::print(Ostream& os) const -{ - // Print File data - os << " OFstream: "; - OSstream::print(os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* //