Changeset 12696
- Timestamp:
- 07/17/11 12:33:46 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/branches/OpenSceneGraph-3.0/src/osgPlugins/osg/AsciiStreamOperator.h
r12689 r12696 247 247 virtual void readWrappedString( std::string& str ) 248 248 { 249 if ( !_preReadString.empty() )250 {251 str = _preReadString;252 return;253 }254 255 249 char ch; 256 _in->get( ch ); checkStream();250 getCharacter( ch ); 257 251 258 252 // skip white space 259 253 while ( ch==' ' || (ch=='\n') || (ch=='\r')) 260 254 { 261 _in->get( ch ); checkStream();255 getCharacter( ch ); 262 256 } 263 257 … … 265 259 { 266 260 // we have an "wrapped string" 267 _in->get( ch ); checkStream();261 getCharacter( ch ); 268 262 while ( ch!='"' ) 269 263 { 270 264 if (ch=='\\') 271 265 { 272 _in->get( ch ); checkStream();266 getCharacter( ch ); 273 267 str += ch; 274 268 } 275 269 else str += ch; 276 270 277 _in->get( ch ); checkStream();271 getCharacter( ch ); 278 272 } 279 273 } … … 284 278 { 285 279 str += ch; 286 _in->get( ch ); checkStream();280 getCharacter( ch ); 287 281 } 288 282 } … … 322 316 323 317 protected: 318 void getCharacter( char& ch ) 319 { 320 if ( !_preReadString.empty() ) 321 { 322 ch = _preReadString[0]; 323 _preReadString.erase( _preReadString.begin() ); 324 } 325 else 326 { 327 _in->get( ch ); 328 checkStream(); 329 } 330 } 331 324 332 std::string _preReadString; 325 333 };
