[glibmm] Checksum: Change ChecksumType to Checksum::Type.



commit df1054edd96b72b3afba661f71631cfdc9e18e15
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Apr 18 20:04:32 2017 +0200

    Checksum: Change ChecksumType to Checksum::Type.

 glib/src/checksum.ccg |    6 +++---
 glib/src/checksum.hg  |   16 ++++++++--------
 2 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/glib/src/checksum.ccg b/glib/src/checksum.ccg
index 140ea79..0db13da 100644
--- a/glib/src/checksum.ccg
+++ b/glib/src/checksum.ccg
@@ -21,7 +21,7 @@
 namespace Glib
 {
 
-Checksum::Checksum(ChecksumType type) : gobject_(g_checksum_new((GChecksumType)type))
+Checksum::Checksum(Type type) : gobject_(g_checksum_new((GChecksumType)type))
 {
 }
 
@@ -31,13 +31,13 @@ Checksum::operator bool() const
 }
 
 gssize
-Checksum::get_length(ChecksumType checksum_type)
+Checksum::get_length(Type checksum_type)
 {
   return g_checksum_type_get_length((GChecksumType)checksum_type);
 }
 
 std::string
-Checksum::compute_checksum(ChecksumType checksum_type, const std::string& data)
+Checksum::compute_checksum(Type checksum_type, const std::string& data)
 {
   return Glib::convert_return_gchar_ptr_to_ustring(
     g_compute_checksum_for_string(((GChecksumType)checksum_type), data.c_str(), data.size()));
diff --git a/glib/src/checksum.hg b/glib/src/checksum.hg
index b3a5555..9394eb2 100644
--- a/glib/src/checksum.hg
+++ b/glib/src/checksum.hg
@@ -43,16 +43,16 @@ class Checksum
   _IGNORE(g_checksum_copy, g_checksum_free)
 
 public:
-  _WRAP_ENUM(ChecksumType, GChecksumType, NO_GTYPE)
+  _WRAP_ENUM(Type, GChecksumType, NO_GTYPE)
 
-#m4 _CONVERSION(`ChecksumType', `GChecksumType', `(($2)$3)')
+#m4 _CONVERSION(`Type', `GChecksumType', `(static_cast<$2>($3))')
 
   /** Creates a new Checksum, using the checksum algorithm @a checksum_type.
    * If the checksum_type is not known, then operator bool() will return false.
    *
    * @param checksum_type Checksum type, one of defined above.
    */
-  explicit Checksum(ChecksumType checksum_type);
+  explicit Checksum(Type checksum_type);
 
   /** Returns true if the Checksum object is valid.
    * This will return false, for instance, if an unsupported checksum type was provided to the constructor.
@@ -75,25 +75,25 @@ public:
   _WRAP_METHOD(std::string get_string() const, g_checksum_get_string)
 
 
-  _WRAP_METHOD(static std::string compute_checksum(ChecksumType checksum_type, const guchar* data, gsize 
length), g_compute_checksum_for_data)
+  _WRAP_METHOD(static std::string compute_checksum(Type checksum_type, const guchar* data, gsize length), 
g_compute_checksum_for_data)
 
   /** Computes the checksum of a string.
    *
-   * @param checksum_type A ChecksumType
+   * @param checksum_type A Type
    * @param str The string to compute the checksum of.
    * @result The checksum as a hexadecimal string.
    */
-  static std::string compute_checksum(ChecksumType checksum_type, const std::string& str);
+  static std::string compute_checksum(Type checksum_type, const std::string& str);
   _IGNORE(g_compute_checksum_for_string)
 
 
   //We don't use _WRAP_METHOD because this is not really a GCheckSum function:
   /** Gets the length in bytes of digests of type @a checksum_type.
    *
-   * @param checksum_type A ChecksumType.
+   * @param checksum_type A Type.
    * @result The checksum length, or -1 if @a checksum_type is not supported.
    */
-  static gssize get_length(ChecksumType checksum_type);
+  static gssize get_length(Type checksum_type);
 };
 
 } //namespace Glib


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