Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
a4c81f59
Commit
a4c81f59
authored
Jul 04, 2017
by
Mark OLESEN
Browse files
ENH: make streams name() methods virtual throughout (issue
#479
)
parent
6a0a8b99
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C
View file @
a4c81f59
...
...
@@ -91,12 +91,11 @@ Foam::IFstream::IFstream
ISstream
(
*
ifPtr_
,
"IFstream.sourceFile_"
,
pathname
,
format
,
version
,
IFstreamAllocator
::
compression_
),
pathname_
(
pathname
)
)
{
setClosed
();
...
...
@@ -166,7 +165,7 @@ Foam::IFstream& Foam::IFstream::operator()() const
if
(
!
good
())
{
// also checks .gz file
if
(
isFile
(
pa
thname
_
,
true
))
if
(
isFile
(
th
is
->
name
()
,
true
))
{
check
(
"IFstream::operator()"
);
FatalIOError
.
exit
();
...
...
@@ -174,7 +173,7 @@ Foam::IFstream& Foam::IFstream::operator()() const
else
{
FatalIOErrorInFunction
(
*
this
)
<<
"file "
<<
pa
thname
_
<<
" does not exist"
<<
"file "
<<
th
is
->
name
()
<<
" does not exist"
<<
exit
(
FatalIOError
);
}
}
...
...
src/OpenFOAM/db/IOstreams/Fstreams/IFstream.H
View file @
a4c81f59
...
...
@@ -84,10 +84,6 @@ class IFstream
public
IFstreamAllocator
,
public
ISstream
{
// Private data
fileName
pathname_
;
public:
// Declare name of the class and its debug switch
...
...
@@ -113,17 +109,8 @@ public:
// Access
//- Return the name of the stream
const
fileName
&
name
()
const
{
return
pathname_
;
}
//- Return non-const access to the name of the stream
fileName
&
name
()
{
return
pathname_
;
}
//- Read/write access to the name of the stream
using
ISstream
::
name
;
// STL stream
...
...
src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C
View file @
a4c81f59
...
...
@@ -93,8 +93,7 @@ Foam::OFstream::OFstream
)
:
OFstreamAllocator
(
pathname
,
compression
),
OSstream
(
*
ofPtr_
,
"OFstream.sinkFile_"
,
format
,
version
,
compression
),
pathname_
(
pathname
)
OSstream
(
*
ofPtr_
,
pathname
,
format
,
version
,
compression
)
{
setClosed
();
setState
(
ofPtr_
->
rdstate
());
...
...
src/OpenFOAM/db/IOstreams/Fstreams/OFstream.H
View file @
a4c81f59
...
...
@@ -84,11 +84,6 @@ class OFstream
private
OFstreamAllocator
,
public
OSstream
{
// Private data
fileName
pathname_
;
public:
// Declare name of the class and its debug switch
...
...
@@ -115,17 +110,8 @@ public:
// Access
//- Return the name of the stream
const
fileName
&
name
()
const
{
return
pathname_
;
}
//- Return non-const access to the name of the stream
fileName
&
name
()
{
return
pathname_
;
}
//- Read/write access to the name of the stream
using
OSstream
::
name
;
// STL stream
...
...
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C
View file @
a4c81f59
...
...
@@ -30,7 +30,7 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
Foam
::
fileName
Foam
::
IOstream
::
n
ame_
(
"IOstream"
);
Foam
::
fileName
Foam
::
IOstream
::
staticN
ame_
(
"IOstream"
);
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
...
...
@@ -89,6 +89,18 @@ Foam::IOstream::compressionEnum(const word& compression)
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const
Foam
::
fileName
&
Foam
::
IOstream
::
name
()
const
{
return
staticName_
;
}
Foam
::
fileName
&
Foam
::
IOstream
::
name
()
{
return
staticName_
;
}
bool
Foam
::
IOstream
::
check
(
const
char
*
operation
)
const
{
if
(
bad
())
...
...
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H
View file @
a4c81f59
...
...
@@ -214,8 +214,8 @@ private:
// Private data
//- Name
of the stream
static
fileName
n
ame_
;
//- Name
for any generic stream - normally treat as readonly
static
fileName
staticN
ame_
;
streamFormat
format_
;
versionNumber
version_
;
...
...
@@ -295,17 +295,11 @@ public:
//- Return the name of the stream
// Useful for Fstream to return the filename
virtual
const
fileName
&
name
()
const
{
return
name_
;
}
virtual
const
fileName
&
name
()
const
;
//- Return non-const access to the name of the stream
// Useful to alter the stream name
virtual
fileName
&
name
()
{
return
name_
;
}
virtual
fileName
&
name
();
// Check
...
...
src/OpenFOAM/db/IOstreams/IOstreams/Istream.H
View file @
a4c81f59
...
...
@@ -72,7 +72,7 @@ public:
// Constructors
//-
S
et stream status
//-
Construct and s
et stream status
Istream
(
streamFormat
format
=
ASCII
,
...
...
src/OpenFOAM/db/IOstreams/IOstreams/Ostream.H
View file @
a4c81f59
...
...
@@ -74,7 +74,7 @@ public:
// Constructors
//-
S
et stream status
//-
Construct and s
et stream status
Ostream
(
streamFormat
format
=
ASCII
,
...
...
src/OpenFOAM/db/IOstreams/Sstreams/ISstream.H
View file @
a4c81f59
...
...
@@ -75,7 +75,7 @@ class ISstream
Istream
&
readVariable
(
string
&
);
//- Disallow default bitwise assignment
void
operator
=
(
const
ISstream
&
);
void
operator
=
(
const
ISstream
&
)
=
delete
;
public:
...
...
src/OpenFOAM/db/IOstreams/Sstreams/OSstream.H
View file @
a4c81f59
...
...
@@ -62,14 +62,14 @@ class OSstream
// Private Member Functions
//- Disallow default bitwise assignment
void
operator
=
(
const
OSstream
&
);
void
operator
=
(
const
OSstream
&
)
=
delete
;
public:
// Constructors
//-
S
et stream status
//-
Construct and s
et stream status
OSstream
(
ostream
&
os
,
...
...
src/OpenFOAM/db/IOstreams/Sstreams/ReadHex.H
View file @
a4c81f59
...
...
@@ -44,7 +44,7 @@ namespace Foam
//- Read a hex label from an input stream
template
<
class
T
>
T
ReadHex
(
ISstream
&
);
T
ReadHex
(
ISstream
&
is
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.H
View file @
a4c81f59
...
...
@@ -68,7 +68,7 @@ public:
// Constructors
//-
S
et stream status
//-
Construct and s
et stream status
prefixOSstream
(
ostream
&
os
,
...
...
src/OpenFOAM/db/IOstreams/StringStreams/IStringStream.H
View file @
a4c81f59
...
...
@@ -67,7 +67,7 @@ public:
ISstream
(
*
(
new
std
::
istringstream
(
buffer
)),
"
IStringStream.sourceFile
"
,
"
input
"
,
format
,
version
)
...
...
@@ -85,7 +85,7 @@ public:
ISstream
(
*
(
new
std
::
istringstream
(
buffer
)),
"
IStringStream.sourceFile
"
,
"
input
"
,
format
,
version
)
...
...
src/OpenFOAM/db/IOstreams/StringStreams/OStringStream.H
View file @
a4c81f59
...
...
@@ -66,7 +66,7 @@ public:
OSstream
(
*
(
new
std
::
ostringstream
()),
"
OStringStream.sinkFile
"
,
"
output
"
,
format
,
version
)
...
...
@@ -126,7 +126,7 @@ public:
// Print
//- Print description to Ostream
void
print
(
Ostream
&
)
const
;
void
print
(
Ostream
&
os
)
const
;
};
...
...
src/OpenFOAM/db/IOstreams/StringStreams/StringStreamsPrint.C
View file @
a4c81f59
...
...
@@ -34,7 +34,7 @@ Description
void
Foam
::
IStringStream
::
print
(
Ostream
&
os
)
const
{
os
<<
"IStringStream "
<<
name
()
<<
" : "
<<
"buffer =
\n
"
<<
str
()
<<
Foam
::
endl
;
<<
"buffer =
\n
"
<<
str
()
<<
Foam
::
endl
;
ISstream
::
print
(
os
);
}
...
...
@@ -43,7 +43,7 @@ void Foam::IStringStream::print(Ostream& os) const
void
Foam
::
OStringStream
::
print
(
Ostream
&
os
)
const
{
os
<<
"OStringStream "
<<
name
()
<<
" : "
<<
"buffer =
\n
"
<<
str
()
<<
Foam
::
endl
;
<<
"buffer =
\n
"
<<
str
()
<<
Foam
::
endl
;
OSstream
::
print
(
os
);
}
...
...
src/OpenFOAM/db/IOstreams/Tstreams/ITstream.H
View file @
a4c81f59
...
...
@@ -126,13 +126,13 @@ public:
// Inquiry
//- Return the name of the stream
const
fileName
&
name
()
const
virtual
const
fileName
&
name
()
const
{
return
name_
;
}
//- Return non-const access to the name of the stream
fileName
&
name
()
virtual
fileName
&
name
()
{
return
name_
;
}
...
...
@@ -165,7 +165,7 @@ public:
// Read functions
//- Return next token from stream
virtual
Istream
&
read
(
token
&
);
virtual
Istream
&
read
(
token
&
t
);
//- Read a character
virtual
Istream
&
read
(
char
&
);
...
...
@@ -203,8 +203,8 @@ public:
// Print
//- Print description of
IO
stream to Ostream
void
print
(
Ostream
&
)
const
;
//- Print description of stream to Ostream
void
print
(
Ostream
&
os
)
const
;
};
...
...
src/OpenFOAM/db/IOstreams/hashes/OSHA1stream.H
View file @
a4c81f59
...
...
@@ -72,7 +72,7 @@ public:
// Member Functions
// Write
// Write
//- Process unbuffered
virtual
std
::
streamsize
xsputn
(
const
char
*
str
,
std
::
streamsize
n
)
...
...
@@ -109,7 +109,7 @@ public:
// Member Functions
// Access
// Access
//- This hides both signatures of std::basic_ios::rdbuf()
sha1streambuf
*
rdbuf
()
...
...
@@ -139,16 +139,16 @@ class OSHA1stream
// Private Member Functions
//- Disallow default bitwise copy construct
OSHA1stream
(
const
OSHA1stream
&
);
OSHA1stream
(
const
OSHA1stream
&
)
=
delete
;
//- Disallow default bitwise assignment
void
operator
=
(
const
OSHA1stream
&
);
void
operator
=
(
const
OSHA1stream
&
)
=
delete
;
public:
// Constructors
//- Construct
and set stream status
//- Construct
with an empty digest
OSHA1stream
(
streamFormat
format
=
ASCII
,
...
...
@@ -158,7 +158,7 @@ public:
OSstream
(
*
(
new
osha1stream
),
"OSHA1stream
.sinkFile_
"
,
"OSHA1stream"
,
format
,
version
)
...
...
@@ -174,7 +174,7 @@ public:
// Member functions
// Access
// Access
//- Full access to the sha1
Foam
::
SHA1
&
sha1
()
...
...
@@ -188,7 +188,8 @@ public:
return
sha1
().
digest
();
}
// Edit
// Edit
//- Clear the SHA1 calculation
void
rewind
()
...
...
src/OpenFOAM/db/IOstreams/token/token.H
View file @
a4c81f59
...
...
@@ -134,10 +134,10 @@ public:
// Private Member Functions
//- Disallow default bitwise copy construct
compound
(
const
compound
&
);
compound
(
const
compound
&
)
=
delete
;
//- Disallow default bitwise assignment
void
operator
=
(
const
compound
&
);
void
operator
=
(
const
compound
&
)
=
delete
;
public:
...
...
@@ -195,11 +195,6 @@ public:
virtual
label
size
()
const
=
0
;
// Check
// Edit
// Write
virtual
void
write
(
Ostream
&
)
const
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment