Re: std::string vs other strings

Roman Kubiak <[email protected]> Fri, 9 Nov 2012 22:54:22 +0100
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <CACugK=aJ3A6nEGFyYmNbSSy5izMZNQ+iQeZcs9zUUU-KSUfJLQ@mail.gmail.com>
I found this some time ago:
http://blog.strixcode.com/2010/06/using-qstring-with-luabind.html

But i never got it to work with JUCE's String class, if anyone could share
a piece of converter code that works with a custom String class that would
be nice.

====================================================================
         _ _                              _           _ _        _
__ _____| | |_ __ _ __ _ ___   __ ___ _ _| |_ _ _ ___| | |___ __| |
\ V / _ \ |  _/ _` / _` / -_) / _/ _ \ ' \  _| '_/ _ \ | / -_) _` |
 \_/\___/_|\__\__,_\__, \___| \__\___/_||_\__|_| \___/_|_\___\__,_|
                   |___/
====================================================================






On Fri, Nov 9, 2012 at 10:14 PM, Cory Riddell <[email protected]> wrote:

> I can bind a function like:
>
> const char* say_hello()
> {
>     return "hello";
> }
>
> or
>
> std::string say_hello()
> {
>     return std::string("hello");
> }
>
> and use it with luabind easily. If I want to return another string
> format like MFC's CString or Qt's QString, what do I need to do? I
> grepped the source looking for something like:
>   class_<std::string>("???")
>     .def( ... )
>
> I figured I would do the same thing for other string types, but I didn't
> find anything. Why does std::string just seem to work?
>
> Cory
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_nov
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user