GNOME Bugzilla – Bug 625301
[gdbus-codegen] --output-prefix can contain hyphens
Last modified: 2018-05-24 12:32:01 UTC
I want to have an --output-prefix set as "e-gdbus" for my needs, which is generating file names fine, but with defines and marshales it doesn't change hyphens to underscores, thus makes code uncompilable.
Created attachment 166572 [details] [review] proposed gbt patch for gdbus-binding-tool; Please consider using patch like this. Thanks.
The --output-prefix option is supposed to take a CamelCase name, e.g. you should use EGDBus and C symbols should then be prefixed with e_gdbus_ and structs with EGDBus... this is probably not working for you there's a lot of caps right after each other and _camel_case_to_uscore() isn't working like we want, right? Maybe we should support the Ugly_Case style - e.g. if we detect underscores in something supposed to be CamelCase, then use the underscores as places for where to split and remove them for the CamelCase name. In your example, "--output-prefix E_GDBus" would then yield EGDBus and e_gdbus as desired and things like "--output-prefix UGLY_Case_PreFix" would yield UGLYCasePreFix and ugly_case_prefix.
Do you mean '--namespace' instead? as documentation says: > --namespace The namespace to use for generated code. In CamelCase format. > > --output-prefix A prefix to use for all generated files. Defaults to generated if you are interested, then my full command line is: gdbus-codegen --namespace=EGdbus --strip-prefix=org.gnome.evolution.dataserver.calendar --output-prefix=e-gdbus e-data-cal-factory.xml e-data-cal-view.xml e-data-cal.xml which is generating files as I want them, i.e. e-gdbus-bindings.h. With --output-prefix=EGdbus I get EGdbus-bindings.h, but also egdbus-egdbuscal.c, so this is also somehow inconsistent. Allowing me to not use CamelCase in --output-prefix and include the patch makes it the easiest way for me. But I'm not sure how for you :)
Yeah, I clearly mixed up --namespace and --output-prefix here, sorry.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/323.