Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
xerus
xerus
Commits
ad80999d
Commit
ad80999d
authored
Dec 01, 2019
by
Sebastian Wolf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let Exceptions now use stringstreams
parent
99366b97
Pipeline
#1841
failed with stages
in 12 minutes and 18 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
include/xerus/misc/exceptions.h
include/xerus/misc/exceptions.h
+3
-3
src/xerus/misc/exceptions.cpp
src/xerus/misc/exceptions.cpp
+4
-3
src/xerus/misc/fileUtilities.cpp
src/xerus/misc/fileUtilities.cpp
+1
-1
No files found.
include/xerus/misc/exceptions.h
View file @
ad80999d
...
...
@@ -37,7 +37,7 @@ namespace xerus {
class
generic_error
:
public
std
::
exception
{
public:
///@brief String containing all relevant information concerning this error.
std
::
string
error_info
;
std
::
string
stream
error_info
;
/// @brief: Normal constructor without preset error_info.
generic_error
();
...
...
@@ -52,7 +52,7 @@ namespace xerus {
template
<
typename
error_t
,
class
T
>
typename
std
::
enable_if
<
std
::
is_base_of
<
generic_error
,
error_t
>::
value
,
error_t
&>::
type
operator
<<
(
error_t
&
o
,
const
T
&
_info
)
noexcept
{
o
.
error_info
+=
to_string
(
_info
);
o
.
error_info
<<
to_string
(
_info
);
return
o
;
}
...
...
@@ -60,7 +60,7 @@ namespace xerus {
template
<
typename
error_t
,
class
T
>
typename
std
::
enable_if
<
std
::
is_base_of
<
generic_error
,
error_t
>::
value
,
error_t
&>::
type
operator
<<
(
error_t
&&
o
,
const
T
&
_info
)
noexcept
{
o
.
error_info
+=
to_string
(
_info
);
o
.
error_info
<<
to_string
(
_info
);
return
o
;
}
}
...
...
src/xerus/misc/exceptions.cpp
View file @
ad80999d
...
...
@@ -28,11 +28,12 @@ namespace xerus {
namespace
misc
{
generic_error
::
generic_error
()
{}
generic_error
::
generic_error
(
const
generic_error
&
_other
)
noexcept
:
error_info
(
_other
.
error_info
)
{
}
generic_error
::
generic_error
(
const
generic_error
&
_other
)
noexcept
{
error_info
<<
_other
.
error_info
.
rdbuf
();
}
const
char
*
generic_error
::
what
()
const
noexcept
{
return
error_info
.
c_str
();
return
error_info
.
str
().
c_str
();
}
}
// namespace misc
...
...
src/xerus/misc/fileUtilities.cpp
View file @
ad80999d
...
...
@@ -39,7 +39,7 @@
#pragma GCC diagnostic pop
namespace
xerus
{
namespace
misc
{
void
create_directories_for_file
(
const
std
::
string
&
_path
)
{
if
(
_path
.
find
(
'/'
)
!=
std
::
string
::
npos
)
{
std
::
string
folder
=
_path
.
substr
(
0
,
_path
.
find_last_of
(
'/'
));
...
...
Write
Preview
Markdown
is supported
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