On 24-3-2014 21:57, Krzysztof KosiĆski wrote:
2014-03-24 21:16 GMT+01:00 Johan Engelen <jbc.engelen@...2592...>:
Hi all, To easier use repr->setAttribute, I want to add two extra (overloaded) functions
virtual void setAttribute(gchar const *key, gchar const *value,
bool is_interactive=false)=0; virtual void setAttribute(gchar const *key, Glib::ustring const &value, bool is_interactive=false)=0; virtual void setAttribute(Glib::ustring const &key, Glib::ustring const &value, bool is_interactive=false)=0;
Should I use std::string or Glib::ustring for this?
The XML tree currently uses the GC allocator, so to avoid memory leaks you cannot use any class that uses the standard allocators within it. You would have to use std::string with a nonstandard allocator.
If this is only about adding an interface without any internal changes, then I think Glib::ustring is the better choice, since the XML data inside is in UTF-8.
Indeed for now, convenience interface functions. Thanks, I agree with Glib::ustring.
Can you have a look at rev. 13203 and make amendments if necessary?
Thanks, Johan