Hi Rui,

The getCharacter() approach looks to be the cleanest way to tackle
this issue.  With this change I don't think the readWrappedString(..)
method should have the check against _preReadString at the start i.e.

    virtual void readWrappedString( std::string& str )
    {
        if ( !_preReadString.empty() )
        {
            str = _preReadString;
            return;
        }

Is incorrect and should this section should be removed.

Thoughst?
Robert.

On Fri, Jul 15, 2011 at 2:29 PM, Wang Rui <[email protected]> wrote:
> Hi Robert,
>
> Yes, I think it is a problem to be considered, too. The best way to
> use _preReadString I hope is to treat it as if it is the start part of
> the input stream. To make the idea work with readWrappedString(), I
> just create a getCharacter() method to call either _preReadString[] or
> _in->get() to retrieve a character. Please have a look at the file
> attached to see if it could work.
>
> Cheers,
>
> Wang Rui
>
>
> 2011/7/15 Robert Osfield <[email protected]>:
>> When reviewing the changes to
>> AsciiStreamOperator::readWrappedString(..) struck me as a potential
>> bug.  I understand how these changes are required, but I wonder if
>> that they aren't sufficient as they don't handle the possibility that
>> the _preReadString starts with ", and if it does whether it ends with
>> a ".   I strikes me that if it does begin with a " then one should
>> then search for any enclosed " and either return the substring and set
>> the  _preReadString to the remainder if it exists, or continue adding
>> characters to the string by reading them from the stream until the
>> full balanced string is read.
>>
>> Thoughts?
>> Robert.
>>
>> On Mon, Jul 4, 2011 at 4:23 AM, Wang Rui <[email protected]> wrote:
>>> Hi Robert,
>>>
>>> The files attached should be separately put into the directories
>>> src/osgPlugins/osg and src/osgWrappers/serializers/osgSim. They fix a
>>> serious infinite loop problem that may be caused by the stream buffer
>>> mechanism under Windows and some osgSim wrapper bugs pointed by
>>> Andreas. I've asked the community to help test them and hope now we
>>> can solve these recent .osgt file reading issues.
>>>
>>> Cheers,
>>>
>>> Wang Rui
>>>
>>> _______________________________________________
>>> osg-submissions mailing list
>>> [email protected]
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>>
>>>
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to