Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
1bc9eea3
Commit
1bc9eea3
authored
16 years ago
by
Andrew Heather
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of
ssh://noisy/home/noisy2/OpenFOAM/OpenFOAM-dev
parents
4a2475ac
4d5ce2ea
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C
+0
-179
0 additions, 179 deletions
src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C
src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C
+0
-151
0 additions, 151 deletions
src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C
with
0 additions
and
330 deletions
src/OpenFOAM/db/IOstreams/Fstreams/zfIFstream.C
deleted
100644 → 0
+
0
−
179
View file @
4a2475ac
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
<
IFstream
&>
(
*
this
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// ************************************************************************* //
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/IOstreams/Fstreams/zfOFstream.C
deleted
100644 → 0
+
0
−
151
View file @
4a2475ac
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment