[sldev] Uses of LLString and std::string ?

Nik Radford nik at terminaldischarge.net
Wed Jan 23 08:37:50 PST 2008


I thought it was because the std library wasn't too stable when they
started out writing SL so they ended up writing there own imlpementation
of things.

I assume over time, std got stable and standard like and stuff and so its
been okay to use it thus the intermixing.

Though I'm probably wrong :P I usually am.

Nik

> I believe the point of LLString is to protect against NULL pointer
> assignments.  It's legacy from a time when we used char* strings and
> began mixing in std::string.  Assigning a standard string to NULL
> dereferences NULL, causing a crash.  LLString protects against this by
> checking for NULL on assignment for char* strings.
>
> Alissa Sabre wrote:
>> I have a question.
>>
>> SL viewer uses two data types LLString and std::string, that are
>> almost identical.  They are sometimes intermixed.  LLString to
>> std::string conversion is by a simple upcasting, but the opposit is by
>> a deep copy through a constructor that requires some overhead.
>>
>> What is the purpose of LLString?  In case it has some, then the next
>> question is why LL uses both LLString and std::string?  (Cf. LL never
>> uses C++ bool type.)
>>
>> Assuming there is a good reason to use both LLString and std::string
>> in SL viewer, what is the criteria (or guidelines) to choose from
>> LLString and std::string?
>>
>>     Alissa Sabre
>> --------------------------------------
>> Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
>> http://pr.mail.yahoo.co.jp/toolbar/
>> _______________________________________________
>> Click here to unsubscribe or manage your list subscription:
>> /index.html
>>
>
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>


Nik.

------------------------------------------
E-Mail:    Nik at Terminaldischarge.net
(We)Blog:  http://blog.terminaldischarge.net



More information about the SLDev mailing list