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
ed4bd548
Commit
ed4bd548
authored
5 years ago
by
Mark OLESEN
Browse files
Options
Downloads
Patches
Plain Diff
STYLE: provide return value for IOstream::fatalCheck()
- allows reuse as base implementation for IOstream::check()
parent
ac709da3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C
+7
-10
7 additions, 10 deletions
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H
+5
-3
5 additions, 3 deletions
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H
with
12 additions
and
13 deletions
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C
+
7
−
10
View file @
ed4bd548
...
@@ -50,25 +50,22 @@ Foam::fileName& Foam::IOstream::name()
...
@@ -50,25 +50,22 @@ Foam::fileName& Foam::IOstream::name()
bool
Foam
::
IOstream
::
check
(
const
char
*
operation
)
const
bool
Foam
::
IOstream
::
check
(
const
char
*
operation
)
const
{
{
if
(
bad
())
return
fatalCheck
(
operation
);
{
FatalIOErrorInFunction
(
*
this
)
<<
"error in IOstream "
<<
name
()
<<
" for operation "
<<
operation
<<
exit
(
FatalIOError
);
}
return
!
bad
();
}
}
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
)
FatalIOErrorInFunction
(
*
this
)
<<
"error in IOstream "
<<
name
()
<<
" for operation "
<<
operation
<<
"error in IOstream "
<<
name
()
<<
" for operation "
<<
operation
<<
exit
(
FatalIOError
);
<<
exit
(
FatalIOError
);
}
}
return
ok
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H
+
5
−
3
View file @
ed4bd548
...
@@ -199,12 +199,14 @@ public:
...
@@ -199,12 +199,14 @@ public:
// Check
// Check
//- Check IOstream status for given operation.
//- 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
;
virtual
bool
check
(
const
char
*
operation
)
const
;
//- Check IOstream status for given operation.
//- Check IOstream status for given operation.
//
Print IOstream state if
error has occurred
and exit
//
Generate a FatalIOError when an
error has occurred
.
void
fatalCheck
(
const
char
*
operation
)
const
;
bool
fatalCheck
(
const
char
*
operation
)
const
;
//- Return true if stream has been opened
//- Return true if stream has been opened
bool
opened
()
const
bool
opened
()
const
...
...
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