summaryrefslogtreecommitdiff
path: root/glib/src/checksum.ccg
diff options
context:
space:
mode:
authorMurray Cumming <murrayc@murrayc.com>2008-01-20 17:52:05 +0000
committerMurray Cumming <murrayc@src.gnome.org>2008-01-20 17:52:05 +0000
commit20f7cec8edaa8e9daa20450bb52473afbcea4d30 (patch)
treeda8f852218d65bf0b7c43418bb6ec3e336e2b3f8 /glib/src/checksum.ccg
parent539aae373d85ac495223740a8727435ae5c88a48 (diff)
downloadglibmm-20f7cec8edaa8e9daa20450bb52473afbcea4d30.tar.gz
Ignore g_input_stream_clear_pending() as well as the other implementation
2008-01-20 Murray Cumming <murrayc@murrayc.com> * gio/src/inputstream.hg: Ignore g_input_stream_clear_pending() as well as the other implementation functions. * gio/src/outputstream.hg: Ignore the equivalent functions here, assuming that they are also only for implementations. svn path=/trunk/; revision=527
Diffstat (limited to 'glib/src/checksum.ccg')
-rw-r--r--glib/src/checksum.ccg51
1 files changed, 51 insertions, 0 deletions
diff --git a/glib/src/checksum.ccg b/glib/src/checksum.ccg
new file mode 100644
index 00000000..0f686168
--- /dev/null
+++ b/glib/src/checksum.ccg
@@ -0,0 +1,51 @@
+/* $Id$ */
+
+/* Copyright (C) 2002 The gtkmm Development Team
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include <glib/gchecksum.h>
+
+#include <glib.h>
+#include <glibmm/utility.h>
+#include <glibmm/checksum.h>
+
+namespace Glib
+{
+
+Checksum::Checksum(ChecksumType type)
+: gobject_(g_checksum_new((GChecksumType)type))
+{
+}
+
+
+gssize Checksum::get_length(ChecksumType type)
+{
+ return g_checksum_type_get_length((GChecksumType)type);
+}
+
+std::string Checksum::compute_checksum(ChecksumType type, const std::string& data)
+{
+ return Glib::convert_return_gchar_ptr_to_ustring(g_compute_checksum_for_string(((GChecksumType)type), data.c_str(), -1));
+}
+
+void Checksum::update(const std::string& data)
+{
+ g_checksum_update(gobj(), (const guchar*)data.c_str(), data.size());
+}
+
+} // Glib namespace
+
+