Pelagicore / gdbus-codegen-glibmm

Code generator for C++ D-Bus stubs and proxies using Giomm/Glibmm
GNU Lesser General Public License v2.1
23 stars 25 forks source link

How to generate std::vector<guint8> type #92

Open Jackie-Yang opened 4 years ago

Jackie-Yang commented 4 years ago

I try to use type="ay", but it will generage std::string.

mardy commented 4 years ago

I don't know why it was decided to map "ay" to std::string, but it makes some sense, since std::string can also contain NULL bytes.

On the other hand, it would be nice if gdbus-codegen-glibmm supported D-Bus type annotations and allowed the developer to choose the C++ type (like QtDBus does).

martin-ejdestig commented 4 years ago

See also #82 . (I think it comes from the fact that "ay" is treated as a '\0' terminated string, char *, in Glib instead of e.g. a GByteArray. Glib even requires "ay" to be '\0' terminated to function correctly. Even though there is no such requirement in D-Bus, of course.)