aboutsummaryrefslogtreecommitdiff
path: root/src/tafreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/tafreader.cpp')
-rw-r--r--src/tafreader.cpp41
1 files changed, 32 insertions, 9 deletions
diff --git a/src/tafreader.cpp b/src/tafreader.cpp
index 5609f7c..efcb3d9 100644
--- a/src/tafreader.cpp
+++ b/src/tafreader.cpp
@@ -49,6 +49,8 @@ void Bu::TafReader::groupContent( Bu::TafGroup *pGroup )
49 return; 49 return;
50 else if( c == '/' && la == '*' ) 50 else if( c == '/' && la == '*' )
51 pGroup->addChild( readComment() ); 51 pGroup->addChild( readComment() );
52 else if( c == '/' && la == '/' )
53 pGroup->addChild( readComment( true ) );
52 else if( c == ':' ) 54 else if( c == ':' )
53 throw TafException("Encountered stray ':' in taf stream."); 55 throw TafException("Encountered stray ':' in taf stream.");
54 else 56 else
@@ -71,22 +73,43 @@ Bu::TafProperty *Bu::TafReader::readProperty()
71 //printf(" %s = %s\n", sName.getStr(), sValue.getStr() ); 73 //printf(" %s = %s\n", sName.getStr(), sValue.getStr() );
72} 74}
73 75
74Bu::TafComment *Bu::TafReader::readComment() 76Bu::TafComment *Bu::TafReader::readComment( bool bEOL )
75{ 77{
76 next();
77 FString sCmnt; 78 FString sCmnt;
78 for(;;) 79 next();
80 if( bEOL )
79 { 81 {
80 next(); 82 for(;;)
81 if( c == '*' && la == '/' )
82 { 83 {
83 next(); next(); 84 next();
84 break; 85 if( c == '\n' && la == '\r' )
86 {
87 next(); next();
88 break;
89 }
90 else if( c == '\n' || c == '\r' )
91 {
92 next();
93 break;
94 }
95 sCmnt += c;
96 }
97 }
98 else
99 {
100 for(;;)
101 {
102 next();
103 if( c == '*' && la == '/' )
104 {
105 next(); next();
106 break;
107 }
108 sCmnt += c;
85 } 109 }
86 sCmnt += c;
87 } 110 }
88 111
89 return new TafComment( sCmnt ); 112 return new TafComment( sCmnt, bEOL );
90} 113}
91 114
92Bu::FString Bu::TafReader::readStr() 115Bu::FString Bu::TafReader::readStr()