FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

void* to string?

 
Post new topic   Reply to topic     Forum Index -> gtkD
View previous topic :: View next topic  
Author Message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Sun Dec 20, 2009 7:32 am    Post subject: void* to string? Reply with quote

I'm trying to get the URI-s of files I've selected in FileChooserDialog. I got the ListG and used function ListG.nthData().

And now I've got void*. How to convert it into D string?
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Sun Dec 20, 2009 9:50 am    Post subject: Reply with quote

cast is to a char* and use toString. there is a toString in glib.Str.

toString( cast(char*)myvar )
Back to top
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Sun Dec 20, 2009 12:08 pm    Post subject: Reply with quote

Thanks a lot, works Smile
Back to top
View user's profile Send private message
Mitu



Joined: 22 Sep 2009
Posts: 59
Location: Poland

PostPosted: Tue Dec 22, 2009 4:07 am    Post subject: Reply with quote

Well, another problem has come up.

After such a conversions spaces are replaced with %20 and some chars unavailable in english language are replest with %XX%XX (where X is a hex digit). Is there any way to avoid it or I just have to use the replace() method?
Back to top
View user's profile Send private message
Mike Wey



Joined: 07 May 2007
Posts: 428

PostPosted: Tue Dec 22, 2009 6:59 am    Post subject: Reply with quote

The strings might be URI encoded. that would be a reason why some chars are %XX.

there is glib.URI.unescapeString() if you need the unescaped string.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> gtkD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group