[glibmm] Gio::Converter: Put enums inside class.



commit 738136266abc41f5bfd719793face1b65f8b8c68
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Apr 18 11:22:45 2017 +0200

    Gio::Converter: Put enums inside class.
    
    Change ConverterFlags and ConverterResult to Converter::Flags and Covnerter::Result.

 gio/src/converter.ccg   |    3 +++
 gio/src/converter.hg    |    9 +++++----
 tools/m4/convert_gio.m4 |    4 ++--
 3 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gio/src/converter.ccg b/gio/src/converter.ccg
index b80d676..0f2d200 100644
--- a/gio/src/converter.ccg
+++ b/gio/src/converter.ccg
@@ -19,6 +19,9 @@
 
 #include <gio/gio.h>
 
+using Flags = Gio::Converter::Flags;
+using Result = Gio::Converter::Result;
+
 namespace Gio
 {
 
diff --git a/gio/src/converter.hg b/gio/src/converter.hg
index 0319535..cde99f8 100644
--- a/gio/src/converter.hg
+++ b/gio/src/converter.hg
@@ -30,8 +30,6 @@ typedef struct _GConverterIface GConverterIface;
 namespace Gio
 {
 
-_WRAP_ENUM(ConverterResult, GConverterResult)
-_WRAP_ENUM(ConverterFlags, GConverterFlags)
 
 /** Converter - Data conversion interface.
  * Converter is implemented by objects that convert binary data in various
@@ -47,11 +45,14 @@ class Converter : public Glib::Interface
   _CLASS_INTERFACE(Converter, GConverter, G_CONVERTER, GConverterIface)
 
 public:
-  _WRAP_METHOD(ConverterResult convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, 
ConverterFlags flags, gsize& bytes_read, gsize& bytes_written), g_converter_convert, errthrow)
+  _WRAP_ENUM(Result, GConverterResult)
+  _WRAP_ENUM(Flags, GConverterFlags)
+
+  _WRAP_METHOD(Result convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, Flags 
flags, gsize& bytes_read, gsize& bytes_written), g_converter_convert, errthrow)
   _WRAP_METHOD(void reset(), g_converter_reset)
 
 #m4 _CONVERSION(`gsize*',`gsize&',`*($3)')
-  _WRAP_VFUNC(ConverterResult convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, 
ConverterFlags flags, gsize& bytes_read, gsize& bytes_written), "convert", errthrow)
+  _WRAP_VFUNC(Result convert(const void* inbuf, gsize inbuf_size, void* outbuf, gsize outbuf_size, Flags 
flags, gsize& bytes_read, gsize& bytes_written), "convert", errthrow)
 
   _WRAP_VFUNC(void reset(), "reset")
 };
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index d5aceb3..d4cf3b8 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -29,8 +29,8 @@ _CONV_GIO_INCLASS_ENUM(AppInfo,CreateFlags)
 _CONV_GIO_INCLASS_ENUM(Application,Flags)
 _CONV_GIO_ENUM(AskPasswordFlags)
 _CONV_GIO_ENUM(BusType)
-_CONV_GIO_ENUM(ConverterFlags)
-_CONV_GIO_ENUM(ConverterResult)
+_CONV_GIO_INCLASS_ENUM(Converter,Flags)
+_CONV_GIO_INCLASS_ENUM(Converter,Result)
 _CONV_GIO_ENUM(CredentialsType)
 _CONV_GIO_ENUM(DataStreamByteOrder)
 _CONV_GIO_ENUM(DataStreamNewlineType)


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