[glibmm/glibmm-2-64] Glib::get_host_name(): Return a Glib::ustring



commit 3261b2ad7e57f749d0fd63b7be7b937d4efeac91
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Sun Mar 15 15:20:06 2020 +0100

    Glib::get_host_name(): Return a Glib::ustring
    
    g_get_host_name() returns a UTF-8 string.

 glib/src/miscutils.ccg | 4 ++--
 glib/src/miscutils.hg  | 8 +++-----
 2 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg
index 199035a6..67e0db81 100644
--- a/glib/src/miscutils.ccg
+++ b/glib/src/miscutils.ccg
@@ -98,10 +98,10 @@ get_real_name()
   return convert_const_gchar_ptr_to_stdstring(g_get_real_name());
 }
 
-std::string
+Glib::ustring
 get_host_name()
 {
-  return convert_const_gchar_ptr_to_stdstring(g_get_host_name());
+  return convert_const_gchar_ptr_to_ustring(g_get_host_name());
 }
 
 std::string
diff --git a/glib/src/miscutils.hg b/glib/src/miscutils.hg
index 10809bde..2d7b0df3 100644
--- a/glib/src/miscutils.hg
+++ b/glib/src/miscutils.hg
@@ -182,17 +182,15 @@ std::string get_real_name();
  * is. Callers should not rely on the return value having any specific
  * properties like uniqueness for security purposes. Even if the name
  * of the machine is changed while an application is running, the
- * return value from this function does not change. The returned
- * string is owned by GLib and should not be modified or freed. If no
- * name can be determined, a default fixed string "localhost" is
- * returned.
+ * return value from this function does not change. If no name can be
+ * determined, a default fixed string "localhost" is returned.
  *
  * @return The host name of the machine.
  *
  * @newin{2,64}
  */
 GLIBMM_API
-std::string get_host_name();
+Glib::ustring get_host_name();
 
 /** Gets the current user's home directory.
  * @return The current user's home directory or an empty string if not defined.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]