diff options
Diffstat (limited to 'src')
| -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 | ||
