summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2017-04-18 20:04:32 +0200
committerMurray Cumming <murrayc@murrayc.com>2017-04-18 21:53:16 +0200
commitdf1054edd96b72b3afba661f71631cfdc9e18e15 (patch)
tree26cc2c012b7cb411d18200b03ec050079f69b83a
parent3dce5e5d70d6fcb36543494d9efe698a1d9b1a3d (diff)
downloadglibmm-df1054edd96b72b3afba661f71631cfdc9e18e15.tar.gz
Checksum: Change ChecksumType to Checksum::Type.
-rw-r--r--glib/src/checksum.ccg6
-rw-r--r--glib/src/checksum.hg16
2 files changed, 11 insertions, 11 deletions
diff --git a/glib/src/checksum.ccg b/glib/src/checksum.ccg
index 140ea792..0db13da5 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 b3a55555..9394eb2c 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