]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/gtk/private.h
no changes, just corrected the comment for wxConvLocal
[wxWidgets.git] / include / wx / gtk / private.h
index 4c6be9b94e33ed962e012ea49fe18e7f7455ebbd..2ce2865725f3fbf12c5ee31d08941f272af4e66f 100644 (file)
@@ -60,6 +60,26 @@ G_END_DECLS
 extern void wxapp_install_idle_handler();
 extern bool g_isIdle;
 
+//-----------------------------------------------------------------------------
+// Convenience class for g_freeing a gchar* on scope exit automatically
+//-----------------------------------------------------------------------------
+
+class wxGtkString
+{
+public:
+    explicit wxGtkString(gchar *s) : m_str(s) { }
+    ~wxGtkString() { g_free(m_str); }
+
+    const gchar *c_str() const { return m_str; }
+
+    operator gchar *() const { return m_str; }
+
+private:
+    gchar *m_str;
+
+    DECLARE_NO_COPY_CLASS(wxGtkString)
+};
+
 //-----------------------------------------------------------------------------
 // GTK+ scroll types -> wxEventType
 //-----------------------------------------------------------------------------