[med-svn] [libgtextutils] 34/83: Updated Tuple-Parser-Exceptions (added accessors).
Charles Plessy
plessy at moszumanska.debian.org
Wed Jan 8 13:37:27 UTC 2014
This is an automated email from the git hooks/post-receive script.
plessy pushed a commit to branch debian/unstable
in repository libgtextutils.
commit b74b33438ac8f1474d1e80db4fa51dfd2681aad8
Author: A. Gordon <gordon at cshl.edu>
Date: Mon Apr 6 00:23:15 2009 -0400
Updated Tuple-Parser-Exceptions (added accessors).
---
src/gtextutils/tuple_parser.h | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/src/gtextutils/tuple_parser.h b/src/gtextutils/tuple_parser.h
index e0e68bf..06249a0 100644
--- a/src/gtextutils/tuple_parser.h
+++ b/src/gtextutils/tuple_parser.h
@@ -35,10 +35,14 @@ class tuple_parser_premature_end_of_line : public std::runtime_error
{
private:
std::string _what;
+ size_t _expected_columns ;
+ size_t _actual_columns;
public:
tuple_parser_premature_end_of_line(size_t expected_columns, size_t actual_columns) :
- std::runtime_error("")
+ std::runtime_error(""),
+ _expected_columns(expected_columns),
+ _actual_columns(actual_columns)
{
std::ostringstream os;
os << "Error: premature end-of-line, expecting at least "
@@ -50,6 +54,16 @@ public:
_what = os.str();
}
+ size_t expected_columns() const
+ {
+ return _expected_columns ;
+ }
+
+ size_t actual_columns() const
+ {
+ return _actual_columns;
+ }
+
virtual const char* what() const throw()
{
return _what.c_str();
@@ -74,10 +88,12 @@ class tuple_parser_parsing_error: public std::runtime_error
{
private:
std::string _what;
+ size_t _column ;
public:
tuple_parser_parsing_error(size_t column) :
- std::runtime_error("")
+ std::runtime_error(""),
+ _column(column)
{
std::ostringstream os;
os << "Error: invalid input in column "
@@ -86,6 +102,11 @@ public:
_what = os.str();
}
+ size_t column() const throw()
+ {
+ return _column;
+ }
+
virtual const char* what() const throw()
{
return _what.c_str();
--
Alioth's /git/debian-med/git-commit-notice on /srv/git.debian.org/git/debian-med/libgtextutils.git
More information about the debian-med-commit
mailing list