Some additional information: in_avail() just returns 4096 when unget()
fails. Is it possible that the stream buffer is full?

2011/6/30 Wang Rui <[email protected]>:
> Hi J-S and all,
>
> I've put some marks in the matchString() method and now I've collected
> some information. While unget() command is executed in the loop, the
> rdbuf()->sungetc() returns 'eof' somehow, and the istream is thus set
> to badbit. The reading process will then halt because the entire
> stream is locked in an unexpected way. The seekg() function, which
> won't use rdbuf() directly, avoids this problem but causes another
> issue discussed before.
>
> I guess if there is a 'sync' mechanism in the istream function
> internally that reset the rdbuf() regardless of the fact that we are
> still reading characters back. I tried putback() and it doesn't work
> either. I don't know if this is a Windows-specified issue.
>
> A best solution I think is to pre-read the string without changing the
> stream buffer pointer, but I can't find a way to do that. I'll try to
> look for different ways to do that, and if you have some other idea,
> it will be appreciated that you can share it.
>
> Regards,
>
> Wang Rui
>
>
> 2011/6/29 Jean-Sébastien Guay <[email protected]>:
>> Hello Wang Rui,
>>
>>> The bug seems to be caused because of the modification in rev 12669,
>>> which uses unget() instead of seekg() to solve the problem of unix
>>> file endings. Roll back and convert the .osg file to .osgt under
>>> Windows and you may view it smoothly. But the trunk version could
>>> neither view these files (including dumptruck, lz and spaceship AFAIK)
>>> with unix nor windows endings.
>>
>> Argh, sorry my "fix" (rather a workaround) caused this problem...
>>
>> But you never say what exactly the problem is that unget() causes... Since
>> cow.osgt seems to work, what is different in these files?
>>
>>> Is it possible that there is another solution for replacing the
>>> seekg() function?
>>
>> I don't know enough about stream i/o to be able to answer. Sorry.
>>
>> J-S
>> --
>> ______________________________________________________
>> Jean-Sebastien Guay    [email protected]
>>                               http://www.cm-labs.com/
>>                    http://whitestar02.dyndns-web.com/
>> _______________________________________________
>> osg-users mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to