diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-02-13 04:43:06 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-02-13 04:43:06 +0000 |
commit | 33be82a7789abdb8b9f6842a69c4c8f3b4ae830b (patch) | |
tree | 138fa19097c1669582ca022ca76c2391d4a2abc5 | |
parent | c9925dd2bc26ad9b7f1395a8c1ddfb2786276ae6 (diff) | |
download | libbu++-33be82a7789abdb8b9f6842a69c4c8f3b4ae830b.tar.gz libbu++-33be82a7789abdb8b9f6842a69c4c8f3b4ae830b.tar.bz2 libbu++-33be82a7789abdb8b9f6842a69c4c8f3b4ae830b.tar.xz libbu++-33be82a7789abdb8b9f6842a69c4c8f3b4ae830b.zip |
There may be some slightly better error reporting in TafReader now...
-rw-r--r-- | src/tafreader.cpp | 12 | ||||
-rw-r--r-- | src/tafreader.h | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/tafreader.cpp b/src/tafreader.cpp index 4f0e1ec..29796f1 100644 --- a/src/tafreader.cpp +++ b/src/tafreader.cpp | |||
@@ -13,7 +13,8 @@ using namespace Bu; | |||
13 | 13 | ||
14 | Bu::TafReader::TafReader( Bu::Stream &sIn ) : | 14 | Bu::TafReader::TafReader( Bu::Stream &sIn ) : |
15 | c( 0 ), | 15 | c( 0 ), |
16 | sIn( sIn ) | 16 | sIn( sIn ), |
17 | iLine( 1 ), iCol( 1 ) | ||
17 | { | 18 | { |
18 | next(); next(); | 19 | next(); next(); |
19 | } | 20 | } |
@@ -62,7 +63,7 @@ void Bu::TafReader::groupContent( Bu::TafGroup *pGroup ) | |||
62 | else if( c == '/' && la == '/' ) | 63 | else if( c == '/' && la == '/' ) |
63 | pGroup->addChild( readComment( true ) ); | 64 | pGroup->addChild( readComment( true ) ); |
64 | else if( c == ':' ) | 65 | else if( c == ':' ) |
65 | throw TafException("Encountered stray ':' in taf stream."); | 66 | throw TafException("Encountered stray ':' in taf stream at %d:%d.", iLine, iCol ); |
66 | else | 67 | else |
67 | pGroup->addChild( readProperty() ); | 68 | pGroup->addChild( readProperty() ); |
68 | } | 69 | } |
@@ -187,6 +188,13 @@ bool Bu::TafReader::isws() | |||
187 | 188 | ||
188 | void Bu::TafReader::next() | 189 | void Bu::TafReader::next() |
189 | { | 190 | { |
191 | if( c == '\n' ) | ||
192 | { | ||
193 | iLine++; | ||
194 | iCol = 1; | ||
195 | } | ||
196 | else | ||
197 | iCol++; | ||
190 | if( c == '}' ) | 198 | if( c == '}' ) |
191 | { | 199 | { |
192 | sIn.read( &c, 1 ); | 200 | sIn.read( &c, 1 ); |
diff --git a/src/tafreader.h b/src/tafreader.h index 3668296..ce67a5f 100644 --- a/src/tafreader.h +++ b/src/tafreader.h | |||
@@ -37,6 +37,7 @@ namespace Bu | |||
37 | Bu::FString readStr(); | 37 | Bu::FString readStr(); |
38 | char c, la; | 38 | char c, la; |
39 | Bu::Stream &sIn; | 39 | Bu::Stream &sIn; |
40 | int iLine, iCol; | ||
40 | }; | 41 | }; |
41 | } | 42 | } |
42 | 43 | ||