New string implementation: dstring 1.0

Chris Miller chris at dprogramming.com
Thu Oct 12 01:59:03 PDT 2006


On Wed, 11 Oct 2006 17:27:52 -0400, Chad J spamIsBad gmail.com">  
<"<""gamerChad"@"> wrote:

> Chris Miller wrote:
>> Check out the FAQ at http://www.dprogramming.com/dstring.php and give  
>> it a  spin.
>> Documentation is online at   
>> http://www.dprogramming.com/docs/dstring/dstring.html
>>  Let me know what you think!
>
> Looks cool!
>
> I'm to strapped on time to try it out right now, but I will when I get  
> the chance.  I do have a couple questions and a comment based on the  
> documentation:
>
> - Is toString() the same as toUTF8()?  If so, I'd like to see something  
> in the documentation to say they are the same.

Yes, they are the same; they both state returning UTF-8 so I didn't think  
it was necessary. It mainly only has toString for consistency with other D  
types and so it will work directly with writef.

>
> - Are there plans to extend this to act as a string manipulating library  
> as well as a string type, adding stuff from phobos like toUpper(),  
> toLower(), capitalize(), split(), etc?  That would be cool.

If there is enough interest, yes.

>
> - Seems like it would be handy to have functions for converting to C  
> style null terminated strings.  Something like char* toUTF8C() and  
> wchar* toUTF16C().

I wasn't sure about this because it's not guaranteed that C uses Unicode;  
but I guess toUTF8z(), toUTF16z() and toUTF32z() would be fine, which only  
mean zero-terminated, not necessarily compatible with C.

>
> This looks like a very useful string type.  I just hope that if people  
> like it, it becomes part of the standard library or some such so that  
> newbs aren't caught by indexing/slicing in the current string-as-array  
> approach.  Anyhow, thanks for doing that.

Thanks



More information about the Digitalmars-d-announce mailing list