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
ed4bd548
Commit
ed4bd548
authored
Feb 14, 2020
by
Mark OLESEN
Browse files
STYLE: provide return value for IOstream::fatalCheck()
- allows reuse as base implementation for IOstream::check()
parent
ac709da3
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C
View file @
ed4bd548
...
...
@@ -50,25 +50,22 @@ Foam::fileName& Foam::IOstream::name()
bool
Foam
::
IOstream
::
check
(
const
char
*
operation
)
const
{
if
(
bad
())
{
FatalIOErrorInFunction
(
*
this
)
<<
"error in IOstream "
<<
name
()
<<
" for operation "
<<
operation
<<
exit
(
FatalIOError
);
}
return
!
bad
();
return
fatalCheck
(
operation
);
}
void
Foam
::
IOstream
::
fatalCheck
(
const
char
*
operation
)
const
bool
Foam
::
IOstream
::
fatalCheck
(
const
char
*
operation
)
const
{
if
(
bad
())
const
bool
ok
=
!
bad
();
if
(
!
ok
)
{
FatalIOErrorInFunction
(
*
this
)
<<
"error in IOstream "
<<
name
()
<<
" for operation "
<<
operation
<<
exit
(
FatalIOError
);
}
return
ok
;
}
...
...
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H
View file @
ed4bd548
...
...
@@ -199,12 +199,14 @@ public:
// Check
//- Check IOstream status for given operation.
// Print IOstream state if error has occurred
// Print IOstream state or generate a FatalIOError
// when an error has occurred.
// The base implementation is a fatalCheck
virtual
bool
check
(
const
char
*
operation
)
const
;
//- Check IOstream status for given operation.
//
Print IOstream state if
error has occurred
and exit
void
fatalCheck
(
const
char
*
operation
)
const
;
//
Generate a FatalIOError when an
error has occurred
.
bool
fatalCheck
(
const
char
*
operation
)
const
;
//- Return true if stream has been opened
bool
opened
()
const
...
...
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