-
-
Notifications
You must be signed in to change notification settings - Fork 62
Add Char wrapper; implement KeyFile::set_list_separator() with it #248
Add Char wrapper; implement KeyFile::set_list_separator() with it #248
Conversation
We will use this to actually bind KeyFile::set_list_separator(), and as a general tool to pass values to C functions which expect a C 'char'.
/// } | ||
/// ``` | ||
/// | ||
/// This would be inconvenient because users would have to do the conversion from a Rust `char` to an `i8` by hand. It would be the same case for `libc::c_char`, which is just a type alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could pass b'a'
for example
Gir.toml
Outdated
@@ -252,6 +252,10 @@ status = "generate" | |||
# file parameter needs to be a PathBuf | |||
ignore = true | |||
[[object.function]] | |||
name = "set_list_separator" | |||
# separator parameter neds to be a glib::Char |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need
6ed0260
to
e41d389
Compare
Better do regen with same |
@federicomenaquintero I'm very sorry for long delay. |
@GuillaumeGomez, seems @federicomenaquintero don't have time, maybe we just merge PR as is and then I make PR that add |
Sure, let's do it like that then. Thanks everyone! |
I'm in the process of adding "impl ToGlib" for all the fundamental types, so that gnome-class will have an easier time passing them around: then it can just call .to_glib() on every method argument with a fundamental type.
Along the way I ran into the distinction between Rust's
char
and Glib's Cc_char
. Here we introduce aChar
wrapper, which can be created fallibly from a Rustchar
. When it succeeds, the result can be passed to C functions that take ac_char
.Finally, we implement
KeyFile::set_list_separator
in terms of this.