Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Seitosh
Seitosh
Commits
2276eecc
Commit
2276eecc
authored
Jul 08, 2016
by
thomas.forbriger
Browse files
libdatrwxx [WP]: make report_violation fit for multiline messages
parent
0c5c97c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/libs/libdatrwxx/report.cc
View file @
2276eecc
...
...
@@ -56,34 +56,37 @@ namespace datrw {
const
std
::
string
&
condition
)
{
cerr
<<
"ERROR message from "
<<
datrw
::
libversion
<<
":"
<<
endl
;
cerr
<<
" A problem occured while "
"reading or writing time series data!"
<<
endl
;
if
(
message
.
empty
())
{
cerr
<<
" No message"
<<
endl
;
}
else
{
cerr
<<
" "
<<
message
<<
endl
;
}
if
(
!
condition
.
empty
())
{
cerr
<<
" Violation of condition"
<<
endl
<<
"
\"
"
<<
condition
<<
"
\"
"
<<
endl
;
}
if
(
!
file
.
empty
())
{
cerr
<<
" triggered in
\"
"
<<
file
<<
"
\"
at line #"
<<
line
<<
endl
;
}
cerr
<<
endl
;
cerr
<<
"ERROR: "
<<
datrw
::
libversion
<<
" "
;
cerr
<<
"reports violation of condition:"
<<
endl
;
cerr
<<
"
\"
"
<<
condition
<<
"
\"
"
<<
endl
;
cerr
<<
" while reading or writing time series data"
<<
endl
;
cerr
<<
" in "
<<
file
<<
" at line "
<<
line
<<
endl
;
cerr
<<
" "
<<
message
<<
endl
;
}
cerr
<<
"ERROR message from "
<<
datrw
::
libversion
<<
":"
<<
endl
;
cerr
<<
" A problem occured while "
"reading or writing time series data!"
<<
endl
;
if
(
!
condition
.
empty
())
{
cerr
<<
" Violation of condition"
<<
endl
<<
"
\"
"
<<
condition
<<
"
\"
"
<<
endl
;
}
if
(
!
file
.
empty
())
{
cerr
<<
" triggered in
\"
"
<<
file
<<
"
\"
at line #"
<<
line
<<
endl
;
}
if
(
message
.
empty
())
{
cerr
<<
" No message"
<<
endl
;
}
else
{
const
std
::
string
delimiter
(
"
\n
"
);
std
::
string
::
size_type
posend
=
0
,
pos
=
0
;
std
::
string
::
size_type
len
=
0
;
while
(
posend
!=
std
::
string
::
npos
)
{
posend
=
message
.
find
(
delimiter
,
pos
);
len
=
posend
-
pos
;
cerr
<<
"| "
<<
message
.
substr
(
pos
,
len
)
<<
endl
;
if
(
posend
!=
std
::
string
::
npos
)
{
len
+=
delimiter
.
length
();
}
pos
+=
len
;
}
// while (posend!=std::string::npos)
}
// if (message.empty())
}
// void report_violation(...)
/*----------------------------------------------------------------------*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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