Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
yaml-cpp
Commits
555fb5c3
Commit
555fb5c3
authored
Jul 26, 2009
by
Jesse Beder
Browse files
Fixed the Exception::what() function
parent
2160bb2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
include/exceptions.h
include/exceptions.h
+9
-6
No files found.
include/exceptions.h
View file @
555fb5c3
...
...
@@ -61,16 +61,19 @@ namespace YAML
class
Exception
:
public
std
::
exception
{
public:
Exception
(
int
line_
,
int
column_
,
const
std
::
string
&
msg_
)
:
line
(
line_
),
column
(
column_
),
msg
(
msg_
)
{}
:
line
(
line_
),
column
(
column_
),
msg
(
msg_
)
{
std
::
stringstream
output
;
output
<<
"Error at line "
<<
line
+
1
<<
", column "
<<
column
+
1
<<
": "
<<
msg
;
what_
=
output
.
str
();
}
virtual
~
Exception
()
throw
()
{}
virtual
const
char
*
what
()
const
throw
()
{
std
::
stringstream
output
;
output
<<
"Error at line "
<<
line
+
1
<<
", column "
<<
column
+
1
<<
": "
<<
msg
;
return
output
.
str
().
c_str
();
}
virtual
const
char
*
what
()
const
throw
()
{
return
what_
.
c_str
();
}
int
line
,
column
;
std
::
string
msg
;
private:
std
::
string
what_
;
};
class
ParserException
:
public
Exception
{
...
...
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