[glibmm] Glib::get_host_name(): Return a Glib::ustring



commit b5521245a0e7a01a6ee70c5789f093fdb1a3ecef
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Mon Oct 7 11:17:06 2019 +0200

    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  | 11 +++++------
 2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/glib/src/miscutils.ccg b/glib/src/miscutils.ccg
index 770e1a69..5faa88f1 100644
--- a/glib/src/miscutils.ccg
+++ b/glib/src/miscutils.ccg
@@ -92,10 +92,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 e223264c..7e239d83 100644
--- a/glib/src/miscutils.hg
+++ b/glib/src/miscutils.hg
@@ -171,16 +171,14 @@ 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}
  */
-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.
@@ -266,7 +264,8 @@ std::string get_user_cache_dir();
 /** Returns a directory that is unique to the current user on the local system.
  *
  * This is the directory specified in the XDG_RUNTIME_DIR environment variable.
- * In the case that this variable is not set, we return the value of g_get_user_cache_dir(), after verifying 
that it exists.
+ * In the case that this variable is not set, we return the value of
+ * Glib::get_user_cache_dir(), after verifying that it exists.
  *
  * @newin{2,64}
  */


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